Do System.getProperty("line.separator")
and System.getProperty("os.name")
always have values?
Or do I need to check the return value in the code for null
?
Do System.getProperty("line.separator")
and System.getProperty("os.name")
always have values?
Or do I need to check the return value in the code for null
?
The question is: can your code handle a null? If yes check for it, even if it is extremely unrealistic that this part of the code will ever be called, if not add a if null -> terminate concept, if that might cause trouble otherwise.
While the JVM will insert this for you, there are still two cases left where you can get null:
None of these cases is likely enough to require to handle them by default.