Versions Compared

Key

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

...

Another pitfall arises when static-final is used inappropriately to declare mutable data. (See guideline OBJ01-J. Be aware that a final reference may not always refer to immutable _mutable_ data.)

Noncompliant Code Example

...

Note that the variable googol is actually a static final reference to an object of type BigDecimal. Because instances of BigDecimal are immutable, guideline OBJ01-J. Be aware that a final reference may not always refer to immutable _mutable_ data is irrelevant in this case.

...