public class DataFlowRunner
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
DataFlowRunner.TimeStats |
Constructor and Description |
---|
DataFlowRunner(Project project) |
DataFlowRunner(Project project,
PsiElement context) |
DataFlowRunner(Project project,
PsiElement context,
boolean unknownMembersAreNullable,
boolean ignoreAssertions) |
Modifier and Type | Method and Description |
---|---|
protected DfaInstructionState [] |
acceptInstruction(InstructionVisitor visitor,
DfaInstructionState instructionState) |
protected void |
afterInstruction(Instruction instruction) |
RunnerResult |
analyzeBlockRecursively(PsiElement block,
java.util.Collection<? extends DfaMemoryState> states,
StandardInstructionVisitor visitor) |
RunnerResult |
analyzeCodeBlock(PsiCodeBlock block,
InstructionVisitor visitor)
Analyze given code-block without analyzing any parent and children context
|
RunnerResult |
analyzeMethod(PsiElement psiBlock,
InstructionVisitor visitor)
Analyze this particular method (lambda, class initializer) without inlining this method into parent one.
|
RunnerResult |
analyzeMethodRecursively(PsiElement block,
StandardInstructionVisitor visitor) |
RunnerResult |
analyzeMethodWithInlining(PsiElement psiBlock,
InstructionVisitor visitor)
Analyze this particular method (lambda, class initializer) trying to inline it into outer scope if possible.
|
protected void |
beforeInstruction(Instruction instruction) |
protected ControlFlow |
buildFlow(PsiElement psiBlock) |
void |
cancel()
Call this method from the visitor to cancel analysis (e.g.
|
protected java.util.List<DfaInstructionState> |
createInitialInstructionStates(PsiElement psiBlock,
java.util.Collection<? extends DfaMemoryState> memStates,
ControlFlow flow) |
protected DfaMemoryState |
createMemoryState() |
protected DataFlowRunner.TimeStats |
createStatistics() |
void |
forNestedClosures(java.util.function.BiConsumer<? super PsiElement,? super java.util.Collection<? extends DfaMemoryState>> consumer) |
DfaValueFactory |
getFactory() |
Instruction |
getInstruction(int index) |
Instruction [] |
getInstructions() |
protected RunnerResult |
interpret(PsiElement psiBlock,
InstructionVisitor visitor,
ControlFlow flow,
java.util.List<DfaInstructionState> startingStates) |
public DataFlowRunner(Project project)
public DataFlowRunner(Project project, PsiElement context)
public DataFlowRunner(Project project, PsiElement context, boolean unknownMembersAreNullable, boolean ignoreAssertions)
project
- current projectcontext
- analysis context element (code block, class, expression, etc.); used to determine whether we can trust
field initializers (e.g. we usually cannot if context is a constructor)unknownMembersAreNullable
- if true every parameter or method return value without nullity annotation is assumed to be nullableignoreAssertions
- if true, assertion statements will be ignored, as if JVM is started with -da.public DfaValueFactory getFactory()
public final void cancel()
RunnerResult.CANCELLED
will be returned.public final RunnerResult analyzeMethod(PsiElement psiBlock, InstructionVisitor visitor)
psiBlock
- method/lambda/class initializer bodyvisitor
- a visitor to usepublic final RunnerResult analyzeMethodWithInlining(PsiElement psiBlock, InstructionVisitor visitor)
psiBlock
- method/lambda/class initializer bodyvisitor
- a visitor to usepublic final RunnerResult analyzeCodeBlock(PsiCodeBlock block, InstructionVisitor visitor)
block
- block to analyzevisitor
- visitor to useprotected final ControlFlow buildFlow(PsiElement psiBlock)
protected final RunnerResult interpret(PsiElement psiBlock, InstructionVisitor visitor, ControlFlow flow, java.util.List<DfaInstructionState> startingStates)
protected java.util.List<DfaInstructionState> createInitialInstructionStates(PsiElement psiBlock, java.util.Collection<? extends DfaMemoryState> memStates, ControlFlow flow)
protected void beforeInstruction(Instruction instruction)
protected void afterInstruction(Instruction instruction)
public RunnerResult analyzeMethodRecursively(PsiElement block, StandardInstructionVisitor visitor)
public RunnerResult analyzeBlockRecursively(PsiElement block, java.util.Collection<? extends DfaMemoryState> states, StandardInstructionVisitor visitor)
protected DfaInstructionState [] acceptInstruction(InstructionVisitor visitor, DfaInstructionState instructionState)
protected DataFlowRunner.TimeStats createStatistics()
protected DfaMemoryState createMemoryState()
public Instruction [] getInstructions()
public Instruction getInstruction(int index)
public void forNestedClosures(java.util.function.BiConsumer<? super PsiElement,? super java.util.Collection<? extends DfaMemoryState>> consumer)