|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jdt.internal.compiler.flow.FlowContext
public class FlowContext
Reflects the context of code analysis, keeping track of enclosing try statements, exception handlers, etc...
| Field Summary | |
|---|---|
static int |
ASSIGN_TO_NONNULL
|
ASTNode |
associatedNode
|
static int |
CAN_ONLY_NON_NULL
|
static int |
CAN_ONLY_NULL
|
static int |
CAN_ONLY_NULL_NON_NULL
|
static int |
CHECK_MASK
|
static int |
CONTEXT_MASK
|
static int |
DEFER_NULL_DIAGNOSTIC
|
static int |
EXIT_RESOURCE
|
static int |
HIDE_NULL_COMPARISON_WARNING
used to hide null comparison related warnings inside assert statements |
static int |
HIDE_NULL_COMPARISON_WARNING_MASK
|
static int |
IN_ASSIGNMENT
|
static int |
IN_COMPARISON_NON_NULL
|
static int |
IN_COMPARISON_NULL
|
static int |
IN_INSTANCEOF
|
NullInfoRegistry |
initsOnFinally
|
static int |
MAY_NULL
|
static FlowContext |
NotContinuableContext
|
FlowContext |
parent
|
static int |
PREEMPT_NULL_DIAGNOSTIC
|
TypeBinding[][] |
providedExpectedTypes
|
int |
tagBits
|
| Constructor Summary | |
|---|---|
FlowContext(FlowContext parent,
ASTNode associatedNode)
|
|
| Method Summary | |
|---|---|
BranchLabel |
breakLabel()
|
void |
checkExceptionHandlers(TypeBinding[] raisedExceptions,
ASTNode location,
FlowInfo flowInfo,
BlockScope scope)
|
void |
checkExceptionHandlers(TypeBinding raisedException,
ASTNode location,
FlowInfo flowInfo,
BlockScope scope)
|
void |
checkExceptionHandlers(TypeBinding raisedException,
ASTNode location,
FlowInfo flowInfo,
BlockScope scope,
boolean isExceptionOnAutoClose)
|
BranchLabel |
continueLabel()
|
FlowInfo |
getInitsForFinalBlankInitializationCheck(TypeBinding declaringType,
FlowInfo flowInfo)
|
FlowContext |
getLocalParent()
Answer the parent flow context but be careful not to cross the boundary of a nested type, or null if no such parent exists. |
FlowContext |
getTargetContextForBreakLabel(char[] labelName)
|
FlowContext |
getTargetContextForContinueLabel(char[] labelName)
|
FlowContext |
getTargetContextForDefaultBreak()
|
FlowContext |
getTargetContextForDefaultContinue()
|
java.lang.String |
individualToString()
|
FlowInfo |
initsOnBreak()
|
UnconditionalFlowInfo |
initsOnReturn()
|
protected boolean |
internalRecordNullityMismatch(Expression expression,
TypeBinding providedType,
int nullStatus,
TypeBinding expectedType,
int checkType)
|
boolean |
isBreakable()
|
boolean |
isContinuable()
|
boolean |
isNonReturningContext()
|
boolean |
isSubRoutine()
|
char[] |
labelName()
|
void |
recordBreakFrom(FlowInfo flowInfo)
|
void |
recordBreakTo(FlowContext targetContext)
|
void |
recordContinueFrom(FlowContext innerFlowContext,
FlowInfo flowInfo)
|
boolean |
recordExitAgainstResource(BlockScope scope,
FlowInfo flowInfo,
FakedTrackingVariable trackingVar,
ASTNode reference)
Record that we found an early exit from a method while a resource is in scope. |
protected boolean |
recordFinalAssignment(VariableBinding variable,
Reference finalReference)
|
void |
recordNullityMismatch(BlockScope currentScope,
Expression expression,
TypeBinding providedType,
TypeBinding expectedType,
int nullStatus)
Record that a nullity mismatch was detected against an annotated type reference. |
protected void |
recordNullReference(LocalVariableBinding local,
ASTNode location,
int status)
Record a null reference for use by deferred checks. |
protected void |
recordProvidedExpectedTypes(TypeBinding providedType,
TypeBinding expectedType,
int nullCount)
|
void |
recordReturnFrom(UnconditionalFlowInfo flowInfo)
|
void |
recordSettingFinal(VariableBinding variable,
Reference finalReference,
FlowInfo flowInfo)
|
void |
recordUsingNullReference(Scope scope,
LocalVariableBinding local,
ASTNode location,
int checkType,
FlowInfo flowInfo)
Record a null reference for use by deferred checks. |
SubRoutineStatement |
subroutine()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final FlowContext NotContinuableContext
public ASTNode associatedNode
public FlowContext parent
public NullInfoRegistry initsOnFinally
public int tagBits
public TypeBinding[][] providedExpectedTypes
public static final int DEFER_NULL_DIAGNOSTIC
public static final int PREEMPT_NULL_DIAGNOSTIC
public static final int HIDE_NULL_COMPARISON_WARNING
public static final int HIDE_NULL_COMPARISON_WARNING_MASK
public static final int CAN_ONLY_NULL_NON_NULL
public static final int CAN_ONLY_NULL
public static final int CAN_ONLY_NON_NULL
public static final int MAY_NULL
public static final int ASSIGN_TO_NONNULL
public static final int EXIT_RESOURCE
public static final int CHECK_MASK
public static final int IN_COMPARISON_NULL
public static final int IN_COMPARISON_NON_NULL
public static final int IN_ASSIGNMENT
public static final int IN_INSTANCEOF
public static final int CONTEXT_MASK
| Constructor Detail |
|---|
public FlowContext(FlowContext parent,
ASTNode associatedNode)
| Method Detail |
|---|
public BranchLabel breakLabel()
public void checkExceptionHandlers(TypeBinding raisedException,
ASTNode location,
FlowInfo flowInfo,
BlockScope scope)
public void checkExceptionHandlers(TypeBinding raisedException,
ASTNode location,
FlowInfo flowInfo,
BlockScope scope,
boolean isExceptionOnAutoClose)
isExceptionOnAutoClose - This is for checking exception handlers for exceptions raised during the
auto close of resources inside a try with resources statement. (Relevant for
source levels 1.7 and above only)
public void checkExceptionHandlers(TypeBinding[] raisedExceptions,
ASTNode location,
FlowInfo flowInfo,
BlockScope scope)
public BranchLabel continueLabel()
public FlowInfo getInitsForFinalBlankInitializationCheck(TypeBinding declaringType,
FlowInfo flowInfo)
public FlowContext getTargetContextForBreakLabel(char[] labelName)
public FlowContext getTargetContextForContinueLabel(char[] labelName)
public FlowContext getTargetContextForDefaultBreak()
public FlowContext getTargetContextForDefaultContinue()
public FlowContext getLocalParent()
public java.lang.String individualToString()
public FlowInfo initsOnBreak()
public UnconditionalFlowInfo initsOnReturn()
public boolean isBreakable()
public boolean isContinuable()
public boolean isNonReturningContext()
public boolean isSubRoutine()
public char[] labelName()
public void recordBreakFrom(FlowInfo flowInfo)
public void recordBreakTo(FlowContext targetContext)
public void recordContinueFrom(FlowContext innerFlowContext,
FlowInfo flowInfo)
public boolean recordExitAgainstResource(BlockScope scope,
FlowInfo flowInfo,
FakedTrackingVariable trackingVar,
ASTNode reference)
scope - enclosing scopeflowInfo - flowInfo at the point of the early exittrackingVar - representation of the resourcereference - the return or throw statement marking the early exit
protected void recordProvidedExpectedTypes(TypeBinding providedType,
TypeBinding expectedType,
int nullCount)
protected boolean recordFinalAssignment(VariableBinding variable,
Reference finalReference)
protected void recordNullReference(LocalVariableBinding local,
ASTNode location,
int status)
local - the local variable involved in the checklocation - the location triggering the analysis, for normal null dereference
this is an expression resolving to 'local', for resource leaks it is an
early exit statement.status - the status against which the check must be performed; one of
CAN_ONLY_NULL, CAN_ONLY_NULL_NON_NULL, MAY_NULL,
CAN_ONLY_NON_NULL, potentially
combined with a context indicator (one of IN_COMPARISON_NULL,
IN_COMPARISON_NON_NULL, IN_ASSIGNMENT or IN_INSTANCEOF)public void recordReturnFrom(UnconditionalFlowInfo flowInfo)
public void recordSettingFinal(VariableBinding variable,
Reference finalReference,
FlowInfo flowInfo)
public void recordUsingNullReference(Scope scope,
LocalVariableBinding local,
ASTNode location,
int checkType,
FlowInfo flowInfo)
scope - the scope into which the check is performedlocal - the local variable involved in the checklocation - the location triggering the analysis, for normal null dereference
this is an expression resolving to 'local', for resource leaks it is an
early exit statement.checkType - the status against which the check must be performed; one
of CAN_ONLY_NULL, CAN_ONLY_NULL_NON_NULL, MAY_NULL, potentially
combined with a context indicator (one of IN_COMPARISON_NULL,
IN_COMPARISON_NON_NULL, IN_ASSIGNMENT or IN_INSTANCEOF)
and a bit to indicate whether the reference is being recorded inside an assert,
HIDE_NULL_COMPARISON_WARNINGflowInfo - the flow info at the check point; deferring contexts will
perform supplementary checks against flow info instances that cannot
be known at the time of calling this method (they are influenced by
code that follows the current point)public SubRoutineStatement subroutine()
public java.lang.String toString()
toString in class java.lang.Object
public void recordNullityMismatch(BlockScope currentScope,
Expression expression,
TypeBinding providedType,
TypeBinding expectedType,
int nullStatus)
currentScope - scope for error reportingexpression - the expression violating the specificationprovidedType - the type of the provided value, i.e., either expression or an element thereof (in ForeachStatements)expectedType - the declared type of the spec'ed variable, for error reporting.nullStatus - the null status of expression at the current location
protected boolean internalRecordNullityMismatch(Expression expression,
TypeBinding providedType,
int nullStatus,
TypeBinding expectedType,
int checkType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||