java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope
Bekannte direkte Unterklassen:
BlockScope, ClassScope, CompilationUnitScope

public abstract class Scope extends Object
  • Felddetails

  • Konstruktordetails

    • Scope

      protected Scope(int kind, Scope parent)
  • Methodendetails

    • setParent

      public void setParent(Scope parent)
    • compareTypes

      public static int compareTypes(TypeBinding left, TypeBinding right)
    • convertEliminatingTypeVariables

      public static TypeBinding convertEliminatingTypeVariables(TypeBinding originalType, ReferenceBinding genericType, int rank, Set eliminatedVariables)
      Returns a type where either all variables or specific ones got discarded. e.g. List (discarding Ungültige Eingabe: "<"E extends Enum) will return: ListUngültige Eingabe: "<"? extends EnumUngültige Eingabe: "<"?>>
    • getBaseType

      public static TypeBinding getBaseType(char[] name)
    • greaterLowerBound

      public static ReferenceBinding[] greaterLowerBound(ReferenceBinding[] types)
    • greaterLowerBound

      public static TypeBinding[] greaterLowerBound(TypeBinding[] types, Scope scope, LookupEnvironment environment)
    • substitute

      public static ReferenceBinding[] substitute(Substitution substitution, ReferenceBinding[] originalTypes)
      Returns an array of types, where original types got substituted given a substitution. Only allocate an array if anything is different.
    • substitute

      public static TypeBinding substitute(Substitution substitution, TypeBinding originalType)
      Returns a type, where original type was substituted using the receiver parameterized type. In raw mode (see Substitution.isRawSubstitution()), all parameterized types are converted to raw types. Cf. 4.8: "The type of a constructor (8.8), instance method (8.4, 9.4), or non-static field (8.3) M of a raw type C that is not inherited from its superclasses or superinterfaces is the raw type that corresponds to the erasure of its type in the generic declaration corresponding to C."
    • substitute

      public static TypeBinding[] substitute(Substitution substitution, TypeBinding[] originalTypes)
      Returns an array of types, where original types got substituted given a substitution. Only allocate an array if anything is different.
    • boxing

      public TypeBinding boxing(TypeBinding type)
    • classScope

      public final ClassScope classScope()
    • compilationUnitScope

      public final CompilationUnitScope compilationUnitScope()
    • module

      public ModuleBinding module()
    • isLambdaScope

      public boolean isLambdaScope()
    • isLambdaSubscope

      public boolean isLambdaSubscope()
    • compilerOptions

      public final CompilerOptions compilerOptions()
      Finds the most specific compiler options
    • computeCompatibleMethod

      protected final MethodBinding computeCompatibleMethod(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite)
      Internal use only Given a method, returns null if arguments cannot be converted to parameters. Will answer a substituted method in case the method was generic and type inference got triggered; in case the method was originally compatible, then simply answer it back.
    • computeCompatibleMethod

      protected final MethodBinding computeCompatibleMethod(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite, boolean tiebreakingVarargsMethods)
      Internal use only Given a method, returns null if arguments cannot be converted to parameters. Will answer a substituted method in case the method was generic and type inference got triggered; in case the method was originally compatible, then simply answer it back.
    • connectTypeVariables

      protected boolean connectTypeVariables(TypeParameter[] typeParameters, boolean checkForErasedCandidateCollisions)
      Connect type variable supertypes, and returns true if no problem was detected
      Parameter:
      typeParameters -
      checkForErasedCandidateCollisions -
    • createArrayType

      public ArrayBinding createArrayType(TypeBinding type, int dimension)
    • createArrayType

      public ArrayBinding createArrayType(TypeBinding type, int dimension, AnnotationBinding[] annotations)
    • createTypeVariables

      public TypeVariableBinding[] createTypeVariables(TypeParameter[] typeParameters, Binding declaringElement)
    • enclosingClassScope

      public final ClassScope enclosingClassScope()
    • enclosingTopMostClassScope

      public final ClassScope enclosingTopMostClassScope()
    • enclosingMethodScope

      public final MethodScope enclosingMethodScope()
    • lexicallyEnclosingMethodScope

      public final MethodScope lexicallyEnclosingMethodScope()
    • enclosingLambdaScope

      public final MethodScope enclosingLambdaScope()
    • enclosingReceiverType

      public final ReferenceBinding enclosingReceiverType()
    • enclosingReferenceContext

      public ReferenceContext enclosingReferenceContext()
      Returns the immediately enclosing reference context, starting from current scope parent. If starting on a class, it will skip current class. If starting on unitScope, returns null.
    • enclosingSourceType

      public final SourceTypeBinding enclosingSourceType()
    • invocationType

      public SourceTypeBinding invocationType()
      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.
    • environment

      public final LookupEnvironment environment()
    • findDefaultAbstractMethod

      protected MethodBinding findDefaultAbstractMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding classHierarchyStart, ObjectVector found, MethodBinding[] concreteMatches)
    • findDirectMemberType

      public ReferenceBinding findDirectMemberType(char[] typeName, ReferenceBinding enclosingType)
    • findExactMethod

      public MethodBinding findExactMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite)
    • findPrivilegedHandler

      public static final IPrivilegedHandler findPrivilegedHandler(ReferenceBinding type)
    • findField

      public FieldBinding findField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve)
    • findField

      public FieldBinding findField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve, boolean invisibleFieldsOk)
    • findMemberType

      public ReferenceBinding findMemberType(char[] typeName, ReferenceBinding enclosingType)
    • findMethod

      public MethodBinding findMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext)
    • findMethod0

      public MethodBinding findMethod0(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite, boolean inStaticContext)
    • findMethodForArray

      public MethodBinding findMethodForArray(ArrayBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite)
    • findMethodInSuperInterfaces

      protected void findMethodInSuperInterfaces(ReferenceBinding receiverType, char[] selector, ObjectVector found, List<TypeBinding> visitedTypes, InvocationSite invocationSite)
    • findType

      public ReferenceBinding findType(char[] typeName, PackageBinding declarationPackage, PackageBinding invocationPackage)
    • findVariable

      public LocalVariableBinding findVariable(char[] variable, InvocationSite invocationSite)
    • getBinding

      public Binding getBinding(char[] name, int mask, InvocationSite invocationSite, boolean needResolve)
    • getExactMethod

      public MethodBinding getExactMethod(TypeBinding receiverType, char[] selector, InvocationSite invocationSite)
    • getExactConstructor

      public MethodBinding getExactConstructor(TypeBinding receiverType, InvocationSite invocationSite)
    • getConstructor

      public MethodBinding getConstructor(ReferenceBinding receiverType, TypeBinding[] argumentTypes, InvocationSite invocationSite)
    • getConstructor0

      public MethodBinding getConstructor0(ReferenceBinding receiverType, TypeBinding[] argumentTypes, InvocationSite invocationSite)
    • getCurrentPackage

      public final PackageBinding getCurrentPackage()
    • getDeclarationModifiers

      public int getDeclarationModifiers()
      Returns the modifiers of the innermost enclosing declaration.
      Gibt zurück:
      modifiers
    • getField

      public FieldBinding getField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite)
    • getImplicitMethod

      public MethodBinding getImplicitMethod(char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite)
    • getJavaIoSerializable

      public final ReferenceBinding getJavaIoSerializable()
    • getJavaLangAnnotationAnnotation

      public final ReferenceBinding getJavaLangAnnotationAnnotation()
    • getJavaLangAssertionError

      public final ReferenceBinding getJavaLangAssertionError()
    • getJavaLangBoolean

      public final ReferenceBinding getJavaLangBoolean()
    • getJavaLangByte

      public final ReferenceBinding getJavaLangByte()
    • getJavaLangCharacter

      public final ReferenceBinding getJavaLangCharacter()
    • getJavaLangClass

      public final ReferenceBinding getJavaLangClass()
    • getJavaLangCloneable

      public final ReferenceBinding getJavaLangCloneable()
    • getJavaLangClassNotFoundException

      public final ReferenceBinding getJavaLangClassNotFoundException()
    • getJavaLangDouble

      public final ReferenceBinding getJavaLangDouble()
    • getJavaLangFloat

      public final ReferenceBinding getJavaLangFloat()
    • getJavaLangIncompatibleClassChangeError

      public final ReferenceBinding getJavaLangIncompatibleClassChangeError()
    • getJavaLangNoClassDefFoundError

      public final ReferenceBinding getJavaLangNoClassDefFoundError()
    • getJavaLangNoSuchFieldError

      public final ReferenceBinding getJavaLangNoSuchFieldError()
    • getJavaLangEnum

      public final ReferenceBinding getJavaLangEnum()
    • getJavaLangError

      public final ReferenceBinding getJavaLangError()
    • getJavaLangReflectField

      public final ReferenceBinding getJavaLangReflectField()
    • getJavaLangReflectMethod

      public final ReferenceBinding getJavaLangReflectMethod()
    • getJavaLangRuntimeObjectMethods

      public final ReferenceBinding getJavaLangRuntimeObjectMethods()
    • getJavaLangRuntimeSwitchBootstraps

      public final ReferenceBinding getJavaLangRuntimeSwitchBootstraps()
    • getJavaLangInvokeConstantBootstraps

      public final ReferenceBinding getJavaLangInvokeConstantBootstraps()
    • getJavaLangEnumDesc

      public final ReferenceBinding getJavaLangEnumDesc()
    • getJavaLangClassDesc

      public final ReferenceBinding getJavaLangClassDesc()
    • getJavaLangInvokeStringConcatFactory

      public final ReferenceBinding getJavaLangInvokeStringConcatFactory()
    • getJavaLangInvokeLambdaMetafactory

      public final ReferenceBinding getJavaLangInvokeLambdaMetafactory()
    • getJavaLangInvokeSerializedLambda

      public final ReferenceBinding getJavaLangInvokeSerializedLambda()
    • getJavaLangInvokeMethodHandlesLookup

      public final ReferenceBinding getJavaLangInvokeMethodHandlesLookup()
    • getJavaLangInvokeMethodHandle

      public final ReferenceBinding getJavaLangInvokeMethodHandle()
    • getJavaLangInvokeVarHandle

      public final ReferenceBinding getJavaLangInvokeVarHandle()
    • getJavaLangInteger

      public final ReferenceBinding getJavaLangInteger()
    • getJavaLangIterable

      public final ReferenceBinding getJavaLangIterable()
    • getJavaLangLong

      public final ReferenceBinding getJavaLangLong()
    • getJavaLangObject

      public final ReferenceBinding getJavaLangObject()
    • getJavaLangRecord

      public final ReferenceBinding getJavaLangRecord()
    • getJavaLangShort

      public final ReferenceBinding getJavaLangShort()
    • getJavaLangString

      public final ReferenceBinding getJavaLangString()
    • getJavaLangStringBuffer

      public final ReferenceBinding getJavaLangStringBuffer()
    • getJavaLangStringBuilder

      public final ReferenceBinding getJavaLangStringBuilder()
    • getJavaLangThrowable

      public final ReferenceBinding getJavaLangThrowable()
    • getJavaLangVoid

      public final ReferenceBinding getJavaLangVoid()
    • getJavaLangIllegalArgumentException

      public final ReferenceBinding getJavaLangIllegalArgumentException()
    • getJavaUtilIterator

      public final ReferenceBinding getJavaUtilIterator()
    • getMemberType

      public final ReferenceBinding getMemberType(char[] typeName, ReferenceBinding enclosingType)
    • getMethod

      public MethodBinding getMethod(TypeBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite)
    • getPackage

      public final Binding getPackage(char[][] compoundName)
    • getOnlyPackage

      public final Binding getOnlyPackage(char[][] compoundName)
    • getType

      public final TypeBinding getType(char[] name)
    • getType

      public final TypeBinding getType(char[] name, PackageBinding packageBinding)
    • getType

      public final TypeBinding getType(char[][] compoundName, int typeNameLength)
    • getTypeOrPackage

      public final Binding getTypeOrPackage(char[][] compoundName)
    • hasErasedCandidatesCollisions

      public boolean hasErasedCandidatesCollisions(TypeBinding one, TypeBinding two, Map invocations, ReferenceBinding type, ASTNode typeRef)
    • innermostSwitchCase

      public CaseStatement innermostSwitchCase()
      Returns the immediately enclosing switchCase statement (carried by closest blockScope),
    • isAcceptableMethod

      protected boolean isAcceptableMethod(MethodBinding one, MethodBinding two)
    • isBoxingCompatibleWith

      public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType)
    • isDefinedInField

      public final boolean isDefinedInField(FieldBinding field)
    • isDefinedInMethod

      public final boolean isDefinedInMethod(MethodBinding method)
    • isDefinedInSameUnit

      public final boolean isDefinedInSameUnit(ReferenceBinding type)
    • isDefinedInType

      public final boolean isDefinedInType(ReferenceBinding type)
    • isInsideCase

      public boolean isInsideCase(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.
    • isInsideDeprecatedCode

      public boolean isInsideDeprecatedCode()
    • isSubtypeOfRawType

      public boolean isSubtypeOfRawType(TypeBinding paramType)
    • lowerUpperBound

      public TypeBinding lowerUpperBound(TypeBinding[] types)
      Returns VoidBinding if types have no intersection (e.g. 2 unrelated interfaces), or null if no common supertype (e.g. List and List), or the intersection type if possible
    • methodScope

      public final MethodScope methodScope()
    • namedMethodScope

      public final MethodScope namedMethodScope()
    • minimalErasedCandidates

      protected TypeBinding[] minimalErasedCandidates(TypeBinding[] types, Map allInvocations)
      Returns the most specific set of types compatible with all given types. (i.e. most specific common super types) If no types is given, will return an empty array. If not compatible reference type is found, returns null. In other cases, will return an array of minimal erased types, where some nulls may appear (and must simply be ignored).
    • mostSpecificClassMethodBinding

      protected final MethodBinding mostSpecificClassMethodBinding(MethodBinding[] visible, int visibleSize, InvocationSite invocationSite)
    • mostSpecificInterfaceMethodBinding

      protected final MethodBinding mostSpecificInterfaceMethodBinding(MethodBinding[] visible, int visibleSize, InvocationSite invocationSite)
    • mostSpecificMethodBinding

      protected final MethodBinding mostSpecificMethodBinding(MethodBinding[] visible, int visibleSize, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding receiverType)
    • outerMostClassScope

      public final ClassScope outerMostClassScope()
    • outerMostMethodScope

      public final MethodScope outerMostMethodScope()
    • parameterCompatibilityLevel

      public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments, InvocationSite site)
    • parameterCompatibilityLevel

      public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments)
    • parameterCompatibilityLevel

      public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments, boolean tiebreakingVarargsMethods)
    • parameterCompatibilityLevel

      public int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param)
    • problemReporter

      public abstract ProblemReporter problemReporter()
      See also the contract of ProblemReporter.close().
    • referenceCompilationUnit

      public final CompilationUnitDeclaration referenceCompilationUnit()
    • referenceContext

      public ReferenceContext referenceContext()
      Returns the nearest reference context, starting from current scope. If starting on a class, it will return current class. If starting on unitScope, returns unit.
    • originalReferenceContext

      public ReferenceContext originalReferenceContext()
      Returns the nearest original reference context, starting from current scope. If starting on a class, it will return current class. If starting on unitScope, returns unit.
    • deferBoundCheck

      public void deferBoundCheck(TypeReference typeRef)
    • getStaticFactory

      public MethodBinding getStaticFactory(ParameterizedTypeBinding allocationType, ReferenceBinding originalEnclosingType, TypeBinding[] argumentTypes, InvocationSite allocationSite)
    • validateNullAnnotation

      public boolean validateNullAnnotation(long tagBits, TypeReference typeRef, Annotation[] annotations)
    • recordNonNullByDefault

      public boolean recordNonNullByDefault(Binding target, int value, Annotation annotation, int scopeStart, int scopeEnd)
      Record a NNBD annotation applying to a given source range within the current scope
      Parameter:
      target - the annotated element
      value - bitset describing the default nullness (see Binding.NullnessDefaultMASK)
      annotation - the NNBD annotation
      scopeStart - start of the source range affected by the default
      scopeEnd - end of the source range affected by the default
      Gibt zurück:
      true if the annotation was newly recorded, false if a corresponding entry already existed.
    • checkRedundantDefaultNullness

      public Binding checkRedundantDefaultNullness(int nullBits, int sourceStart)
      Check whether the given null default is redundant at the given position inside this scope.
      Parameter:
      nullBits - locally defined nullness default, see Binding.NullnessDefaultMASK
      sourceStart -
      Gibt zurück:
      enclosing binding that already has a matching NonNullByDefault annotation, or the special binding NOT_REDUNDANT, indicating that a different enclosing nullness default was found, or null to indicate that no enclosing nullness default was found.
    • hasDefaultNullnessFor

      public boolean hasDefaultNullnessFor(int location, int sourceStart)
      Answer a defaultNullness defined for the closest enclosing scope, using bits from Binding.NullnessDefaultMASK.
    • hasDefaultNullnessForType

      public boolean hasDefaultNullnessForType(TypeBinding type, int location, int sourceStart)
    • localNonNullByDefaultValue

      public final int localNonNullByDefaultValue(int start)
    • localCheckRedundantDefaultNullness

      protected final Binding localCheckRedundantDefaultNullness(int nullBits, int position)
    • typeAnnotationsResolutionScope

      public static BlockScope typeAnnotationsResolutionScope(Scope scope)
    • tagAsAccessingEnclosingInstanceStateOf

      public void tagAsAccessingEnclosingInstanceStateOf(ReferenceBinding enclosingType, boolean typeVariableAccess)
    • getCommonReferenceBinding

      public Supplier<ReferenceBinding> getCommonReferenceBinding(char[] typeName)
    • findTypeVariable

      public TypeVariableBinding findTypeVariable(char[] name, SourceTypeBinding sourceType)
      Other scopes can override this method
    • isInterTypeScope

      public boolean isInterTypeScope()