ImmutableModification
Modifying an immutable collection is guaranteed to throw an exception and leave the collection unmodified

Category
Severity
ERROR
Maturity

The problem

Calling a method that modifies a collection on an immutable implementation (e.g. ImmutableList.add) is guaranteed to always throw an UnsupportedOperationException and leave the collection unmodified.

Suppression

Suppress false positives by adding an @SuppressWarnings("ImmutableModification") annotation to the enclosing element.