public class ImmutableAnalysis extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ImmutableAnalysis.ViolationReporter
Accepts
violations that are found during the analysis. |
Constructor and Description |
---|
ImmutableAnalysis(BugChecker bugChecker,
VisitorState state,
WellKnownMutability wellKnownMutability) |
Modifier and Type | Method and Description |
---|---|
ThreadSafety.Violation |
checkForImmutability(Optional<com.sun.source.tree.ClassTree> tree,
com.google.common.collect.ImmutableSet<String> immutableTyParams,
com.sun.tools.javac.code.Type.ClassType 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. |
ThreadSafety.Violation |
checkInvocation(com.sun.tools.javac.code.Type methodType,
com.sun.tools.javac.code.Symbol symbol) |
public ImmutableAnalysis(BugChecker bugChecker, VisitorState state, WellKnownMutability wellKnownMutability)
public ThreadSafety.Violation checkInvocation(com.sun.tools.javac.code.Type methodType, com.sun.tools.javac.code.Symbol symbol)
public ThreadSafety.Violation checkForImmutability(Optional<com.sun.source.tree.ClassTree> tree, com.google.common.collect.ImmutableSet<String> immutableTyParams, com.sun.tools.javac.code.Type.ClassType type, ImmutableAnalysis.ViolationReporter reporter)
@Immutable
-annotated class:
Copyright © 2019. All rights reserved.