Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Guidelines

MET11-J. Understand the difference between overriding and hiding

MET00-J. Follow good design principles while defining methods

MET01-J. Avoid ambiguous uses of overloading

MET02-J. Validate method parameters

MET03MET10-J. For methods that return an array or collection prefer returning an empty array or collection over a null valueMethods that perform a security check must be declared private or final

MET04-J. Ensure that constructors do not call overridable methods

MET05-J. Do not subject overloaded methods to polymorphic invocations

MET06-J. Do not call overridable methods from a privileged block

MET07-J. Do not invoke overridable methods on the clone under construction

MET08-J. Do not use the clone method to copy untrusted method parameters

MET09-J. Always provide feedback about the resulting value of a method

MET02MET10-J. Validate method parametersFor methods that return an array or collection prefer returning an empty array or collection over a null value

MET11-J. Understand the difference between overriding and hidingMET03-J. Methods that perform a security check must be declared private or final

MET12-J. Follow the general contract while overriding the equals method

MET13-J. Ensure that hashCode() is overridden when equals() is overridden

MET04-J. Ensure that constructors do not call overridable methods

MET05-J. Do not subject overloaded methods to polymorphic invocations

MET14-J. Follow the general contract when implementing the compareTo method

MET16-J. Ensure that the clone method calls super.clone

MET15-J. Do not use deprecated or obsolete methods

MET06MET16-J. Do not call overridable methods from a privileged block

MET07-J. Do not invoke overridable methods on the clone under construction

MET08-J. Do not use the clone method to copy untrusted method parametersEnsure that the clone method calls super.clone

Risk Assessment Summary

Recommendations

...