Class CodeSnippetScope
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope
org.aspectj.org.eclipse.jdt.internal.eval.CodeSnippetScope
This scope is used for code snippet lookup to emulate private, protected and default access.
These accesses inside inner classes are not managed yet.
-
Nested Class Summary
Nested classes/interfaces inherited from class Scope
Scope.Substitutor -
Field Summary
Fields inherited from class BlockScope
blockStatement, EmulationPathToImplicitThis, enclosingCase, finallyInfo, insideTypeDeclarationAnnotations, localIndex, locals, maxOffset, NoEnclosingInstanceInConstructorCall, NoEnclosingInstanceInStaticContext, offset, resolvingGuardExpression, shiftScopes, startIndex, subscopeCount, subscopesModifier and TypeFieldDescriptionstatic final VariableBinding[]Used only during analyseCode and only for checking if a resource was closed in a finallyBlock.booleanintintstatic final VariableBinding[]static final VariableBinding[]intbooleanintintScope[]Fields inherited from class Scope
AUTOBOX_COMPATIBLE, BLOCK_SCOPE, CLASS_SCOPE, COMPATIBLE, COMPATIBLE_IGNORING_MISSING_TYPE, COMPILATION_UNIT_SCOPE, compilationUnitScope, EQUAL_OR_MORE_SPECIFIC, kind, METHOD_SCOPE, MODULE_SCOPE, MORE_GENERIC, NOT_COMPATIBLE, NOT_REDUNDANT, NOT_RELATED, parent, VARARGS_COMPATIBLEModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intintstatic final intstatic final intstatic final intstatic final intstatic Bindingstatic final intstatic final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCodeSnippetScope(int kind, Scope parent) CodeSnippetScope constructor comment.CodeSnippetScope(BlockScope parent) CodeSnippetScope constructor comment.CodeSnippetScope(BlockScope parent, int variableCount) CodeSnippetScope constructor comment. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleancanBeSeenByForCodeSnippet(FieldBinding fieldBinding, TypeBinding receiverType, InvocationSite invocationSite, Scope scope) final booleancanBeSeenByForCodeSnippet(MethodBinding methodBinding, TypeBinding receiverType, InvocationSite invocationSite, Scope scope) final booleancanBeSeenByForCodeSnippet(ReferenceBinding referenceBinding, ReferenceBinding receiverType) findExactMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) findFieldForCodeSnippet(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) findMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext) findMethodForArray(ArrayBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) getBinding(char[][] compoundName, int mask, InvocationSite invocationSite, ReferenceBinding receiverType) getConstructor(ReferenceBinding receiverType, TypeBinding[] argumentTypes, InvocationSite invocationSite) getFieldForCodeSnippet(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) getImplicitMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) Methods inherited from class BlockScope
addAnonymousType, addLocalType, addLocalVariable, addSubscope, adjustCurrentAndSubScopeLocalVariablePositions, adjustLocalVariablePositions, allowBlankFinalFieldAssignment, checkAppropriateMethodAgainstSupers, checkUnclosedCloseables, correlateTrackingVarsIfElse, emulateOuterAccess, findLastRelevantSubScope, findLocalType, findVariable, getBinding, getBinding, getCloseTrackerFor, getEmulationPath, getEmulationPath, hasResourceTrackers, isDuplicateLocalVariable, maxShiftedOffset, needBlankFinalFieldInitializationCheck, problemReporter, propagateInnerEmulation, pruneWrapperTrackingVar, referenceType, registerTrackingVariable, removeTrackingVar, reparentLocals, reportClashingDeclarations, resolvingGuardExpression, scopeIndex, toString, toStringModifier and TypeMethodDescriptionfinal voidaddAnonymousType(TypeDeclaration anonymousType, ReferenceBinding superBinding) final voidaddLocalType(TypeDeclaration localType) final voidaddLocalVariable(LocalVariableBinding binding) voidaddSubscope(Scope childScope) voidvoidadjustLocalVariablePositions(int delta) final booleanAnswer true if the receiver is suitable for assigning final blank fields.voidcheckAppropriateMethodAgainstSupers(char[] selector, MethodBinding compileTimeMethod, TypeBinding[] parameters, InvocationSite site) 15.12.3 (Java 8) "Compile-Time Step 3: Is the Chosen Method Appropriate?"voidcheckUnclosedCloseables(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.voidcorrelateTrackingVarsIfElse(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.voidemulateOuterAccess(LocalVariableBinding outerLocalVariable) protected Scopefinal ReferenceBindingfindLocalType(char[] name) findVariable(char[] variableName) getBinding(char[][] compoundName, int mask, InvocationSite invocationSite, boolean needResolve) final BindinggetBinding(char[][] compoundName, InvocationSite invocationSite) getCloseTrackerFor(LocalVariableBinding localVariable) Retrieve the nearest tracking variable for the given original binding.getEmulationPath(LocalVariableBinding outerLocalVariable) Object[]getEmulationPath(ReferenceBinding targetEnclosingType, boolean onlyExactMatch, boolean denyEnclosingArgInConstructorCall) booleanfinal booleanisDuplicateLocalVariable(char[] name) intfinal booleanReturns true if the context requires to check initialization of final blank fields.See also the contract ofProblemReporter.close().voidpropagateInnerEmulation(ReferenceBinding targetType, boolean isEnclosingInstanceSupplied) voidpruneWrapperTrackingVar(FakedTrackingVariable trackingVariable) Unregister a wrapper resource without affecting its inner.intregisterTrackingVariable(FakedTrackingVariable fakedTrackingVariable) Register a tracking variable and compute its id.voidremoveTrackingVar(FakedTrackingVariable trackingVariable) When are no longer interested in this tracking variable - remove it.voidreparentLocals(boolean reparent) voidreportClashingDeclarations(LocalVariableBinding[] left, LocalVariableBinding[] right) booleaninttoString()toString(int tab) Methods inherited from class Scope
boxing, checkRedundantDefaultNullness, classScope, collectClassesBeingInitialized, compareTypes, compilationUnitScope, compilerOptions, computeCompatibleMethod, connectTypeVariables, convertEliminatingTypeVariables, createArrayType, createArrayType, createTypeVariables, deferBoundCheck, enclosingClassScope, enclosingInstanceScope, enclosingLambdaScope, enclosingMethodScope, enclosingReceiverType, enclosingReferenceContext, enclosingSourceType, enclosingSwitchLabel, enterEarlyConstructionContext, environment, exclude, findDefaultAbstractMethod, findDirectMemberType, findField, findField, findMemberType, findMethod0, findMethodInSuperInterfaces, findPrivilegedHandler, findType, findTypeVariable, getBaseType, getBinding, getCommonReferenceBinding, getConstructor0, getCurrentPackage, getDeclarationModifiers, getExactConstructor, getExactMethod, getField, getImplicitMethod, getJavaIoSerializable, getJavaLangAnnotationAnnotation, getJavaLangAssertionError, getJavaLangBoolean, getJavaLangByte, getJavaLangCharacter, getJavaLangClass, getJavaLangClassDesc, getJavaLangClassNotFoundException, getJavaLangCloneable, getJavaLangDouble, getJavaLangEnum, getJavaLangEnumDesc, getJavaLangError, getJavaLangFloat, getJavaLangIllegalArgumentException, getJavaLangIncompatibleClassChangeError, getJavaLangInteger, getJavaLangInvokeConstantBootstraps, getJavaLangInvokeLambdaMetafactory, getJavaLangInvokeMethodHandle, getJavaLangInvokeMethodHandlesLookup, getJavaLangInvokeSerializedLambda, getJavaLangInvokeStringConcatFactory, getJavaLangInvokeVarHandle, getJavaLangIterable, getJavaLangLong, getJavaLangNoClassDefFoundError, getJavaLangNoSuchFieldError, getJavaLangObject, getJavaLangRecord, getJavaLangReflectField, getJavaLangReflectMethod, getJavaLangRuntimeObjectMethods, getJavaLangRuntimeSwitchBootstraps, getJavaLangShort, getJavaLangString, getJavaLangStringBuffer, getJavaLangStringBuilder, getJavaLangThrowable, getJavaLangVoid, getJavaUtilIterator, getMatchingUninitializedType, getMemberType, getMethod, getOnlyPackage, getPackage, getStaticFactory, getType, getType, getType, getTypeOrPackage, greaterLowerBound, greaterLowerBound, hasDefaultNullnessFor, hasDefaultNullnessForType, hasErasedCandidatesCollisions, include, invocationType, isBoxingCompatibleWith, isDefinedInField, isDefinedInMethod, isDefinedInSameEnclosingType, isDefinedInSameUnit, isDefinedInType, isInsideCase, isInsideDeprecatedCode, isInsideEarlyConstructionContext, isInStaticContext, isInterTypeScope, isLambdaScope, isLambdaSubscope, isSubtypeOfRawType, leaveEarlyConstructionContext, localCheckRedundantDefaultNullness, localNonNullByDefaultValue, lowerUpperBound, methodScope, minimalErasedCandidates, module, mostSpecificClassMethodBinding, mostSpecificInterfaceMethodBinding, mostSpecificMethodBinding, namedMethodScope, nearestEnclosingStaticScope, originalReferenceContext, outerMostClassScope, outerMostMethodScope, parameterCompatibilityLevel, parameterCompatibilityLevel, parameterCompatibilityLevelFromInference, recordNonNullByDefault, referenceCompilationUnit, referenceContext, setParent, substitute, substitute, substitute, tagAsAccessingEnclosingInstanceStateOf, typeAnnotationsResolutionScope, validateNullAnnotationModifier and TypeMethodDescriptionboxing(TypeBinding type) checkRedundantDefaultNullness(int nullBits, int sourceStart) Check whether the given null default is redundant at the given position inside this scope.final ClassScopeThis method captures the status of early construction context at the declaration of a lambda expression.static intcompareTypes(TypeBinding left, TypeBinding right) final CompilationUnitScopefinal CompilerOptionsFinds the most specific compiler optionsprotected final MethodBindingcomputeCompatibleMethod(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite) Internal use only Given a method, returns null if arguments cannot be converted to parameters.protected booleanconnectTypeVariables(TypeParameter[] typeParameters, boolean checkForErasedCandidateCollisions) Connect type variable supertypes, and returns true if no problem was detectedstatic TypeBindingconvertEliminatingTypeVariables(TypeBinding originalType, ReferenceBinding genericType, int rank, Set<TypeBinding> eliminatedVariables) Returns a type where either all variables or specific ones got discarded.createArrayType(TypeBinding type, int dimension) createArrayType(TypeBinding type, int dimension, AnnotationBinding[] annotations) createTypeVariables(TypeParameter[] typeParameters, Binding declaringElement) voiddeferBoundCheck(TypeReference typeRef) final ClassScopefinal MethodScopefinal MethodScopefinal ReferenceBindingReturns the immediately enclosing reference context, starting from current scope parent.final SourceTypeBindingReturns the immediately enclosing case statement (carried by closest blockScope),voidCalled when a ctor with a late explicit constructor call starts processing statements.final LookupEnvironmentvoidexclude(LocalVariableBinding[] bindings) protected MethodBindingfindDefaultAbstractMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding classHierarchyStart, ObjectVector found, MethodBinding[] concreteMatches) findDirectMemberType(char[] typeName, ReferenceBinding enclosingType) findField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve) findField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve, boolean invisibleFieldsOk) findMemberType(char[] typeName, ReferenceBinding enclosingType) findMethod0(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext) protected voidfindMethodInSuperInterfaces(ReferenceBinding receiverType, char[] selector, ObjectVector found, List<TypeBinding> visitedTypes, InvocationSite invocationSite) static final IPrivilegedHandlerfindType(char[] typeName, PackageBinding declarationPackage, PackageBinding invocationPackage) findTypeVariable(char[] name, SourceTypeBinding sourceType) Other scopes can override this methodstatic TypeBindinggetBaseType(char[] name) getBinding(char[] name, int mask, InvocationSite invocationSite, boolean needResolve) getCommonReferenceBinding(char[] typeName) getConstructor0(ReferenceBinding receiverType, TypeBinding[] argumentTypes, InvocationSite invocationSite) final PackageBindingintReturns the modifiers of the innermost enclosing declaration.getExactConstructor(TypeBinding receiverType, InvocationSite invocationSite) getExactMethod(TypeBinding receiverType, char[] selector, InvocationSite invocationSite) getField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) getImplicitMethod(char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) final ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindingfinal ReferenceBindinggetMatchingUninitializedType(TypeBinding targetClass, boolean considerEnclosings) final ReferenceBindinggetMemberType(char[] typeName, ReferenceBinding enclosingType) getMethod(TypeBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) final BindinggetOnlyPackage(char[][] compoundName) final BindinggetPackage(char[][] compoundName) getStaticFactory(ParameterizedTypeBinding allocationType, ReferenceBinding originalEnclosingType, TypeBinding[] argumentTypes, InvocationSite allocationSite) final TypeBindinggetType(char[] name) final TypeBindinggetType(char[][] compoundName, int typeNameLength) final TypeBindinggetType(char[] name, PackageBinding packageBinding) final BindinggetTypeOrPackage(char[][] compoundName) static ReferenceBinding[]greaterLowerBound(ReferenceBinding[] types) static TypeBinding[]greaterLowerBound(TypeBinding[] types, Scope scope, LookupEnvironment environment) booleanhasDefaultNullnessFor(int location, int sourceStart) Answer a defaultNullness defined for the closest enclosing scope, using bits from Binding.NullnessDefaultMASK.booleanhasDefaultNullnessForType(TypeBinding type, int location, int sourceStart) booleanhasErasedCandidatesCollisions(TypeBinding one, TypeBinding two, Map<TypeBinding, Object> invocations, ReferenceBinding type, ASTNode typeRef) voidinclude(LocalVariableBinding[] bindings) For Java scopes, the invocationType is always the same as the enclosingSourceType This distinction is important for AspectJ's inter-type declarations For inter-type declarations, the invocationType is the lexically enclosing type.booleanisBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) final booleanisDefinedInField(FieldBinding field) final booleanisDefinedInMethod(MethodBinding method) final booleanfinal booleanfinal booleanbooleanisInsideCase(CaseStatement caseStatement) Returns true if the scope or one of its parent is associated to a given caseStatement, denoting being part of a given switch case statement.booleanbooleanisInsideEarlyConstructionContext(TypeBinding targetClass, boolean considerEnclosings) Is an instance of targetClass currently being constructed in this scope?booleanbooleanbooleanbooleanbooleanisSubtypeOfRawType(TypeBinding paramType) voidCalled at the end of processing a late explicit constructor call.protected final BindinglocalCheckRedundantDefaultNullness(int nullBits, int position) final intlocalNonNullByDefaultValue(int start) lowerUpperBound(TypeBinding[] types) Returns VoidBinding if types have no intersection (e.g.final MethodScopeprotected TypeBinding[]minimalErasedCandidates(TypeBinding[] types, Map<TypeBinding, Object> allInvocations) Returns the most specific set of types compatible with all given types.module()protected final MethodBindingmostSpecificClassMethodBinding(MethodBinding[] visible, int visibleSize, InvocationSite invocationSite) protected final MethodBindingmostSpecificInterfaceMethodBinding(MethodBinding[] visible, int visibleSize, InvocationSite invocationSite) protected final MethodBindingmostSpecificMethodBinding(MethodBinding[] visible, int visibleSize, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding receiverType) final MethodScopefinal MethodScopeReturns the nearest original reference context, starting from current scope.final ClassScopefinal MethodScopeintparameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments, InvocationSite site) intparameterCompatibilityLevel(TypeBinding arg, TypeBinding param) intparameterCompatibilityLevelFromInference(MethodBinding method, TypeBinding[] arguments, InvocationSite site) booleanrecordNonNullByDefault(Binding target, int value, Annotation annotation, int scopeStart, int scopeEnd) Record a NNBD annotation applying to a given source range within the current scopeReturns the nearest reference context, starting from current scope.voidstatic ReferenceBinding[]substitute(Substitution substitution, ReferenceBinding[] originalTypes) Returns an array of types, where original types got substituted given a substitution.static TypeBindingsubstitute(Substitution substitution, TypeBinding originalType) Returns a type, where original type was substituted using the receiver parameterized type.static TypeBinding[]substitute(Substitution substitution, TypeBinding[] originalTypes) Returns an array of types, where original types got substituted given a substitution.voidtagAsAccessingEnclosingInstanceStateOf(ReferenceBinding enclosingType, boolean typeVariableAccess) static BlockScopebooleanvalidateNullAnnotation(long tagBits, TypeReference typeRef, Annotation[] annotations)
-
Constructor Details
-
CodeSnippetScope
CodeSnippetScope constructor comment.- Parameters:
kind- intparent- org.eclipse.jdt.internal.compiler.lookup.Scope
-
CodeSnippetScope
CodeSnippetScope constructor comment.- Parameters:
parent- org.eclipse.jdt.internal.compiler.lookup.BlockScope
-
CodeSnippetScope
CodeSnippetScope constructor comment.- Parameters:
parent- org.eclipse.jdt.internal.compiler.lookup.BlockScopevariableCount- int
-
-
Method Details
-
canBeSeenByForCodeSnippet
public final boolean canBeSeenByForCodeSnippet(FieldBinding fieldBinding, TypeBinding receiverType, InvocationSite invocationSite, Scope scope) -
canBeSeenByForCodeSnippet
public final boolean canBeSeenByForCodeSnippet(MethodBinding methodBinding, TypeBinding receiverType, InvocationSite invocationSite, Scope scope) -
canBeSeenByForCodeSnippet
public final boolean canBeSeenByForCodeSnippet(ReferenceBinding referenceBinding, ReferenceBinding receiverType) -
findExactMethod
public MethodBinding findExactMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) - Overrides:
findExactMethodin classScope
-
findFieldForCodeSnippet
public FieldBinding findFieldForCodeSnippet(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) -
findMethod
public MethodBinding findMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext) - Overrides:
findMethodin classScope
-
findMethodForArray
public MethodBinding findMethodForArray(ArrayBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) - Overrides:
findMethodForArrayin classScope
-
getBinding
public Binding getBinding(char[][] compoundName, int mask, InvocationSite invocationSite, ReferenceBinding receiverType) -
getConstructor
public MethodBinding getConstructor(ReferenceBinding receiverType, TypeBinding[] argumentTypes, InvocationSite invocationSite) - Overrides:
getConstructorin classScope
-
getFieldForCodeSnippet
public FieldBinding getFieldForCodeSnippet(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite) -
getImplicitMethod
public MethodBinding getImplicitMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite)
-