Java Coding Best Practices
Online Resources For Java Coding Best Practices
Java: Code Conventions for the Java Programming Language
Java Practices
Writing Robust Java Code
SAKAI
Common Java coding problems
Common Java Security Anti-patterns
Common Java Platform Antipatterns
Assuming objects are immutable
Basing security checks on untrusted sources
Ignoring changes to superclasses
Neglecting to validate inputs
Misusing public static variables
Believing a constructor exception destroys
the object
comes from the JavaOne 2006 presentation entitled 'Common Java Security Anti-patterns'. It contains code examples of each of the above antipatterns.
9/6/2006 - (From Jon + Thomas) When checking for equality between a dynamic object and a static one, make the .equals call on the static object, for example:
if (! "".equals(someRandomString))
The advantage of this is that it never throws a NullPointerException, even if someRandomString is null.