Skip to content

Contracts and non private, non final fields

Abnaxos edited this page Jan 31, 2013 · 1 revision

Fields cannot be annotated. This means that non-final protected, package-local or public fields may be modified from the outside causing contract violations.

Two possibilities:

  • Ignore. Making non-final fields anything other than private is bad style anyway.

  • Allow to annotate fields. This may have a serious performance impact.

Clone this wiki locally