It’s not like NPEs are a problem

Posted by: on Jan 17, 2012 | No Comments


try {
integrationService = ServiceLocator.lookup(IntegrationService.class, "IntegrationServiceBean");
} catch (final RuntimeException e) {
System.out.println("RuntimeException");
return null;
}

This is all running inside a web container. I hope I never have to debug that code.

This doesn’t do what you think it does

Posted by: on Dec 27, 2011 | No Comments

I’ve seen this one countless times. == on a string isn’t the same as .equals; one compares the instance and the other compares the content.

if (localeCode == null || localeCode.trim().isEmpty() || localeCode == "?")