Class ImmutableAnalysis


public class ImmutableAnalysis
extends Object
Analyzes types for deep immutability.
  • Constructor Details

  • Method Details

    • checkInvocation

      public ThreadSafety.Violation checkInvocation​( methodType, symbol)
    • checkForImmutability

      public ThreadSafety.Violation checkForImmutability​(Optional<com.sun.source.tree.ClassTree> tree,<String> immutableTyParams, type, ImmutableAnalysis.ViolationReporter reporter)
      Check that an @Immutable-annotated class:
      • does not declare or inherit any mutable fields,
      • any immutable supertypes are instantiated with immutable type arguments as required by their containerOf spec, and
      • any enclosing instances are immutable.
      requiring supertypes to be annotated immutable would be too restrictive.