public class BlockScope extends Scope
Scope.Substitutor| Modifier and Type | Field and Description |
|---|---|
Statement |
blockStatement |
static VariableBinding[] |
EmulationPathToImplicitThis |
CaseStatement |
enclosingCase |
FlowInfo |
finallyInfo
Used only during analyseCode and only for checking if a resource was closed in a finallyBlock.
|
boolean |
insideTypeAnnotation |
int |
localIndex |
LocalVariableBinding[] |
locals |
int |
maxOffset |
static VariableBinding[] |
NoEnclosingInstanceInConstructorCall |
static VariableBinding[] |
NoEnclosingInstanceInStaticContext |
int |
offset |
BlockScope[] |
shiftScopes |
int |
startIndex |
int |
subscopeCount |
Scope[] |
subscopes |
AUTOBOX_COMPATIBLE, BLOCK_SCOPE, CLASS_SCOPE, COMPATIBLE, COMPILATION_UNIT_SCOPE, EQUAL_OR_MORE_SPECIFIC, kind, METHOD_SCOPE, MODULE_SCOPE, MORE_GENERIC, NOT_COMPATIBLE, NOT_REDUNDANT, NOT_RELATED, parent, VARARGS_COMPATIBLE| Modifier | Constructor and Description |
|---|---|
|
BlockScope(BlockScope parent) |
|
BlockScope(BlockScope parent,
boolean addToParentScope) |
|
BlockScope(BlockScope parent,
int variableCount) |
protected |
BlockScope(int kind,
Scope parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAnonymousType(TypeDeclaration anonymousType,
ReferenceBinding superBinding) |
void |
addLocalType(TypeDeclaration localType) |
void |
addLocalVariable(LocalVariableBinding binding) |
void |
addSubscope(Scope childScope) |
void |
adjustCurrentAndSubScopeLocalVariablePositions(int delta) |
void |
adjustLocalVariablePositions(int delta,
boolean offsetAlreadyUpdated) |
boolean |
allowBlankFinalFieldAssignment(FieldBinding binding)
Answer true if the receiver is suitable for assigning final blank fields.
|
void |
checkAppropriateMethodAgainstSupers(char[] selector,
MethodBinding compileTimeMethod,
TypeBinding[] parameters,
InvocationSite site)
15.12.3 (Java 8) "Compile-Time Step 3: Is the Chosen Method Appropriate?"
|
void |
checkUnclosedCloseables(FlowInfo flowInfo,
FlowContext flowContext,
ASTNode location,
BlockScope locationScope)
At the end of a block check the closing-status of all tracked closeables that are declared in this block.
|
void |
correlateTrackingVarsIfElse(FlowInfo thenFlowInfo,
FlowInfo elseFlowInfo)
If one branch of an if-else closes any AutoCloseable resource, and if the same
resource is known to be null on the other branch mark it as closed, too,
so that merging both branches indicates that the resource is always closed.
|
void |
emulateOuterAccess(LocalVariableBinding outerLocalVariable) |
ReferenceBinding |
findLocalType(char[] name) |
LocalDeclaration[] |
findLocalVariableDeclarations(int position)
Returns all declarations of most specific locals containing a given position in their source range.
|
LocalVariableBinding |
findVariable(char[] variableName) |
Binding |
getBinding(char[][] compoundName,
int mask,
InvocationSite invocationSite,
boolean needResolve) |
Binding |
getBinding(char[][] compoundName,
InvocationSite invocationSite) |
VariableBinding[] |
getEmulationPath(LocalVariableBinding outerLocalVariable) |
java.lang.Object[] |
getEmulationPath(ReferenceBinding targetEnclosingType,
boolean onlyExactMatch,
boolean denyEnclosingArgInConstructorCall) |
boolean |
hasResourceTrackers() |
boolean |
isDuplicateLocalVariable(char[] name) |
int |
maxShiftedOffset() |
boolean |
needBlankFinalFieldInitializationCheck(FieldBinding binding)
Returns true if the context requires to check initialization of final blank fields.
|
ProblemReporter |
problemReporter() |
void |
propagateInnerEmulation(ReferenceBinding targetType,
boolean isEnclosingInstanceSupplied) |
void |
pruneWrapperTrackingVar(FakedTrackingVariable trackingVariable)
Unregister a wrapper resource without affecting its inner.
|
TypeDeclaration |
referenceType() |
int |
registerTrackingVariable(FakedTrackingVariable fakedTrackingVariable)
Register a tracking variable and compute its id.
|
void |
removeTrackingVar(FakedTrackingVariable trackingVariable)
When are no longer interested in this tracking variable - remove it.
|
int |
scopeIndex() |
java.lang.String |
toString() |
java.lang.String |
toString(int tab) |
boxing, checkRedundantDefaultNullness, classScope, compareTypes, compilationUnitScope, compilerOptions, computeCompatibleMethod, computeCompatibleMethod, connectTypeVariables, convertEliminatingTypeVariables, createArrayType, createArrayType, createTypeVariables, deferBoundCheck, deferCheck, enclosingClassScope, enclosingLambdaScope, enclosingMethodScope, enclosingReceiverType, enclosingReferenceContext, enclosingSourceType, enclosingTopMostClassScope, environment, findDefaultAbstractMethod, findDirectMemberType, findExactMethod, findField, findField, findMemberType, findMethod, findMethod0, findMethodForArray, findMethodInSuperInterfaces, findPrivilegedHandler, findType, findTypeVariable, getBaseType, getBinding, getCommonReferenceBinding, getConstructor, getConstructor0, getCurrentPackage, getDeclarationModifiers, getExactConstructor, getExactMethod, getField, getImplicitMethod, getJavaIoSerializable, getJavaLangAnnotationAnnotation, getJavaLangAssertionError, getJavaLangBoolean, getJavaLangByte, getJavaLangCharacter, getJavaLangClass, getJavaLangClassNotFoundException, getJavaLangCloneable, getJavaLangDouble, getJavaLangEnum, getJavaLangError, getJavaLangFloat, getJavaLangIllegalArgumentException, getJavaLangIncompatibleClassChangeError, getJavaLangInteger, getJavaLangInvokeLambdaMetafactory, getJavaLangInvokeMethodHandlesLookup, getJavaLangInvokeSerializedLambda, getJavaLangIterable, getJavaLangLong, getJavaLangNoClassDefFoundError, getJavaLangNoSuchFieldError, getJavaLangObject, getJavaLangRecord, getJavaLangReflectField, getJavaLangReflectMethod, getJavaLangRuntimeObjectMethods, getJavaLangShort, getJavaLangString, getJavaLangStringBuffer, getJavaLangStringBuilder, getJavaLangThrowable, getJavaLangVoid, getJavaUtilIterator, getMemberType, getMethod, getOnlyPackage, getPackage, getStaticFactory, getType, getType, getType, getTypeOrPackage, greaterLowerBound, greaterLowerBound, hasDefaultNullnessFor, hasErasedCandidatesCollisions, innermostSwitchCase, invocationType, isAcceptableMethod, isBoxingCompatibleWith, isDefinedInField, isDefinedInMethod, isDefinedInSameUnit, isDefinedInType, isInsideCase, isInsideDeprecatedCode, isInterTypeScope, isLambdaScope, isLambdaSubscope, isSubtypeOfRawType, localCheckRedundantDefaultNullness, localNonNullByDefaultValue, lowerUpperBound, methodScope, minimalErasedCandidates, module, mostSpecificClassMethodBinding, mostSpecificInterfaceMethodBinding, mostSpecificMethodBinding, namedMethodScope, originalReferenceContext, outerMostClassScope, outerMostMethodScope, parameterCompatibilityLevel, parameterCompatibilityLevel, parameterCompatibilityLevel, parameterCompatibilityLevel, recordNonNullByDefault, referenceCompilationUnit, referenceContext, substitute, substitute, substitute, tagAsAccessingEnclosingInstanceStateOf, typeAnnotationsResolutionScope, validateNullAnnotationpublic LocalVariableBinding[] locals
public int localIndex
public int startIndex
public int offset
public int maxOffset
public BlockScope[] shiftScopes
public Scope[] subscopes
public int subscopeCount
public CaseStatement enclosingCase
public static final VariableBinding[] EmulationPathToImplicitThis
public static final VariableBinding[] NoEnclosingInstanceInConstructorCall
public static final VariableBinding[] NoEnclosingInstanceInStaticContext
public boolean insideTypeAnnotation
public Statement blockStatement
public FlowInfo finallyInfo
public BlockScope(BlockScope parent)
public BlockScope(BlockScope parent, boolean addToParentScope)
public BlockScope(BlockScope parent, int variableCount)
protected BlockScope(int kind,
Scope parent)
public final void addAnonymousType(TypeDeclaration anonymousType, ReferenceBinding superBinding)
public final void addLocalType(TypeDeclaration localType)
public final void addLocalVariable(LocalVariableBinding binding)
public void addSubscope(Scope childScope)
public final boolean allowBlankFinalFieldAssignment(FieldBinding binding)
public void adjustLocalVariablePositions(int delta,
boolean offsetAlreadyUpdated)
public void adjustCurrentAndSubScopeLocalVariablePositions(int delta)
public void emulateOuterAccess(LocalVariableBinding outerLocalVariable)
public final ReferenceBinding findLocalType(char[] name)
public LocalDeclaration[] findLocalVariableDeclarations(int position)
public LocalVariableBinding findVariable(char[] variableName)
findVariable in class Scopepublic Binding getBinding(char[][] compoundName, int mask, InvocationSite invocationSite, boolean needResolve)
public final Binding getBinding(char[][] compoundName, InvocationSite invocationSite)
public VariableBinding[] getEmulationPath(LocalVariableBinding outerLocalVariable)
public java.lang.Object[] getEmulationPath(ReferenceBinding targetEnclosingType, boolean onlyExactMatch, boolean denyEnclosingArgInConstructorCall)
public final boolean isDuplicateLocalVariable(char[] name)
public int maxShiftedOffset()
public final boolean needBlankFinalFieldInitializationCheck(FieldBinding binding)
public ProblemReporter problemReporter()
problemReporter in class Scopepublic void propagateInnerEmulation(ReferenceBinding targetType, boolean isEnclosingInstanceSupplied)
public TypeDeclaration referenceType()
public int scopeIndex()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(int tab)
public int registerTrackingVariable(FakedTrackingVariable fakedTrackingVariable)
public void removeTrackingVar(FakedTrackingVariable trackingVariable)
public void pruneWrapperTrackingVar(FakedTrackingVariable trackingVariable)
public boolean hasResourceTrackers()
public void checkUnclosedCloseables(FlowInfo flowInfo, FlowContext flowContext, ASTNode location, BlockScope locationScope)
public void correlateTrackingVarsIfElse(FlowInfo thenFlowInfo, FlowInfo elseFlowInfo)
public void checkAppropriateMethodAgainstSupers(char[] selector,
MethodBinding compileTimeMethod,
TypeBinding[] parameters,
InvocationSite site)