Clicky

Java 8 - Avoid null pointer exception on object calls

June 24, 2016

Optional.ofNullable().orElse(new ())).toString();

for example:
<![CDATA[ Optional.ofNullable(message).orElse(new String()).replace("\t”, " “); ]]>
SyntaxHighlighter.highlight();