Package org.sonar.java.se.xproc
Class BehaviorCache
- java.lang.Object
-
- org.sonar.java.se.xproc.BehaviorCache
-
public class BehaviorCache extends Object
-
-
Field Summary
Fields Modifier and Type Field Description Map<String,MethodBehavior>
behaviors
-
Constructor Summary
Constructors Constructor Description BehaviorCache(SquidClassLoader classLoader)
BehaviorCache(SquidClassLoader classLoader, boolean crossFileEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup()
MethodBehavior
get(String signature)
MethodBehavior
get(Symbol.MethodSymbol symbol)
MethodBehavior
methodBehaviorForSymbol(String signature)
MethodBehavior
methodBehaviorForSymbol(Symbol.MethodSymbol symbol)
MethodBehavior
peek(String signature)
Do not trigger any new computation of method behavior, just check if there is a known method behavior for the symbol.void
setFileContext(SymbolicExecutionVisitor sev, SemanticModel semanticModel)
-
-
-
Field Detail
-
behaviors
public final Map<String,MethodBehavior> behaviors
-
-
Constructor Detail
-
BehaviorCache
public BehaviorCache(SquidClassLoader classLoader)
-
BehaviorCache
public BehaviorCache(SquidClassLoader classLoader, boolean crossFileEnabled)
-
-
Method Detail
-
setFileContext
public void setFileContext(@Nullable SymbolicExecutionVisitor sev, @Nullable SemanticModel semanticModel)
-
cleanup
public void cleanup()
-
methodBehaviorForSymbol
public MethodBehavior methodBehaviorForSymbol(Symbol.MethodSymbol symbol)
-
methodBehaviorForSymbol
public MethodBehavior methodBehaviorForSymbol(String signature)
-
get
@CheckForNull public MethodBehavior get(Symbol.MethodSymbol symbol)
-
get
@CheckForNull public MethodBehavior get(String signature)
-
peek
@CheckForNull public MethodBehavior peek(String signature)
Do not trigger any new computation of method behavior, just check if there is a known method behavior for the symbol.- Parameters:
symbol
- The targeted method.- Returns:
- null for methods having no computed method behavior yet, or its method behavior, based on bytecode or source
-
-