Yes this is bad. I suggest initializing the string variable in the declaration, for example:
private List<String> strings = new ArrayList<String>();
and you can replace the installer with something like
public void addToList(String s) { strings.add(s); }
Therefore, there is no NPE capability.
(Alternatively, do not initialize the string variable in the declaration, add initialization to the addToList method and use the code to check if it returns.)
As for why this is bad, it's hard to say with such a far-fetched example, but it seems that there are too many state changes, and you punish the user of this class for him, forcing the user to handle the exception. There is also a problem that once methods in your program start throwing Exception then that tends to metastasize throughout your code base.
Checking that this instance is populating, something needs to be done, but I think it should be done somewhere that has more knowledge of what is happening than in this class.
source share