Skip to end of metadata
Go to start of metadata

Online Resources For Java Coding Best Practices

SAKAI

Common Java coding problems

Common Java Security Anti-patterns

Common Java Platform Antipatterns

  1. Assuming objects are immutable
  2. Basing security checks on untrusted sources
  3. Ignoring changes to superclasses
  4. Neglecting to validate inputs
  5. Misusing public static variables
  6. Believing a constructor exception destroys
    the object

This powerpoint presentation comes from the JavaOne 2006 presentation entitled 'Common Java Security Anti-patterns'. It contains code examples of each of the above antipatterns.

  • No labels

1 Comment

  1. 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.