org.aspectj.org.eclipse.jdt.internal.compiler.lookup
Class MethodScope

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope
      extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope
          extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope

public class MethodScope
extends BlockScope

Specific block scope used for methods, constructors or clinits, representing its outermost blockscope. Note also that such a scope will be provided to enclose field initializers subscopes as well.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope
Scope.Substitutor
 
Field Summary
 int analysisIndex
           
 long[] definiteInits
           
 long[][] extraDefiniteInits
           
 SyntheticArgumentBinding[] extraSyntheticArguments
           
 boolean hasMissingSwitchDefault
           
 FieldBinding initializedField
           
 boolean isConstructorCall
           
 boolean isPropagatingInnerClassEmulation
           
 boolean isStatic
           
 int lastIndex
           
 int lastVisibleFieldID
           
 ReferenceContext referenceContext
           
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope
EmulationPathToImplicitThis, enclosingCase, finallyInfo, insideTypeAnnotation, localIndex, locals, maxOffset, NoEnclosingInstanceInConstructorCall, NoEnclosingInstanceInStaticContext, offset, shiftScopes, startIndex, subscopeCount, subscopes
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope
APPLICABILITY, AUTOBOX_COMPATIBLE, BLOCK_SCOPE, CLASS_SCOPE, COMPATIBLE, COMPILATION_UNIT_SCOPE, EQUAL_OR_MORE_SPECIFIC, FULL_INFERENCE, INVOCATION_TYPE, kind, METHOD_SCOPE, MORE_GENERIC, NOT_COMPATIBLE, NOT_RELATED, parent, VARARGS_COMPATIBLE
 
Constructor Summary
MethodScope(Scope parent, ReferenceContext context, boolean isStatic)
           
MethodScope(Scope parent, ReferenceContext context, boolean isStatic, int lastVisibleFieldID)
           
 
Method Summary
 void checkUnusedParameters(MethodBinding method)
           
 void computeLocalVariablePositions(int initOffset, CodeStream codeStream)
          Compute variable positions in scopes given an initial position offset ignoring unused local variables.
 FieldBinding findField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve)
          Overridden to detect the error case inside an explicit constructor call: class X { int i; X myX; X(X x) { this(i, myX.i, x.i); // same for super calls...
 boolean hasDefaultNullnessFor(int location)
          Answer a defaultNullness defined for the closest enclosing scope, using bits from Binding.NullnessDefaultMASK.
 boolean isInsideConstructor()
           
 boolean isInsideInitializer()
           
 boolean isInsideInitializerOrConstructor()
           
 boolean isLambdaScope()
           
 ProblemReporter problemReporter()
          Answer the problem reporter to use for raising new problems.
 int recordInitializationStates(FlowInfo flowInfo)
           
 AbstractMethodDeclaration referenceMethod()
          Answer the reference method of this scope, or null if initialization scope or lambda scope.
 MethodBinding referenceMethodBinding()
          Answers the binding of the reference method or reference lambda expression.
 TypeDeclaration referenceType()
          Answer the reference type of this scope.
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope
addAnonymousType, addLocalType, addLocalVariable, addSubscope, allowBlankFinalFieldAssignment, checkAppropriateMethodAgainstSupers, checkUnclosedCloseables, correlateTrackingVarsIfElse, emulateOuterAccess, findLocalType, findLocalVariableDeclarations, findVariable, getBinding, getBinding, getEmulationPath, getEmulationPath, isDuplicateLocalVariable, maxShiftedOffset, needBlankFinalFieldInitializationCheck, propagateInnerEmulation, pruneWrapperTrackingVar, registerTrackingVariable, removeTrackingVar, scopeIndex, toString, toString
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope
boxing, classScope, compareTypes, compilationUnitScope, compilerOptions, computeCompatibleMethod, computeCompatibleMethod, connectTypeVariables, convertEliminatingTypeVariables, createArrayType, createArrayType, createTypeVariables, deferBoundCheck, deferCheck, enclosingClassScope, enclosingLambdaScope, enclosingMethodScope, enclosingReceiverType, enclosingReferenceContext, enclosingSourceType, environment, findDefaultAbstractMethod, findDirectMemberType, findExactMethod, findField, findMemberType, findMethod, findMethod0, findMethodForArray, findMethodInSuperInterfaces, findPrivilegedHandler, findType, findTypeVariable, getBaseType, getBinding, getConstructor, getConstructor0, getCurrentPackage, getDeclarationModifiers, getExactConstructor, getExactMethod, getField, getImplicitMethod, getJavaIoSerializable, getJavaLangAnnotationAnnotation, getJavaLangAssertionError, getJavaLangClass, getJavaLangCloneable, getJavaLangEnum, getJavaLangIllegalArgumentException, getJavaLangInvokeLambdaMetafactory, getJavaLangInvokeMethodHandlesLookup, getJavaLangInvokeSerializedLambda, getJavaLangIterable, getJavaLangObject, getJavaLangString, getJavaLangThrowable, getJavaUtilIterator, getMemberType, getMethod, getOnlyPackage, getPackage, getStaticFactory, getType, getType, getType, getTypeOrPackage, greaterLowerBound, greaterLowerBound, hasErasedCandidatesCollisions, inferInvocationType, innermostSwitchCase, invocationType, isAcceptableMethod, isBoxingCompatibleWith, isDefinedInField, isDefinedInMethod, isDefinedInSameUnit, isDefinedInType, isInsideCase, isInsideDeprecatedCode, isLambdaSubscope, isPossibleSubtypeOfRawType, lowerUpperBound, methodScope, minimalErasedCandidates, mostSpecificClassMethodBinding, mostSpecificInterfaceMethodBinding, mostSpecificMethodBinding, namedMethodScope, originalReferenceContext, outerMostClassScope, outerMostMethodScope, parameterCompatibilityLevel, parameterCompatibilityLevel, parameterCompatibilityLevel, referenceCompilationUnit, referenceContext, substitute, substitute, substitute, tagAsAccessingEnclosingInstanceStateOf, typeAnnotationsResolutionScope, validateNullAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

referenceContext

public ReferenceContext referenceContext

isStatic

public boolean isStatic

isConstructorCall

public boolean isConstructorCall

initializedField

public FieldBinding initializedField

lastVisibleFieldID

public int lastVisibleFieldID

analysisIndex

public int analysisIndex

isPropagatingInnerClassEmulation

public boolean isPropagatingInnerClassEmulation

lastIndex

public int lastIndex

definiteInits

public long[] definiteInits

extraDefiniteInits

public long[][] extraDefiniteInits

extraSyntheticArguments

public SyntheticArgumentBinding[] extraSyntheticArguments

hasMissingSwitchDefault

public boolean hasMissingSwitchDefault
Constructor Detail

MethodScope

public MethodScope(Scope parent,
                   ReferenceContext context,
                   boolean isStatic)

MethodScope

public MethodScope(Scope parent,
                   ReferenceContext context,
                   boolean isStatic,
                   int lastVisibleFieldID)
Method Detail

checkUnusedParameters

public void checkUnusedParameters(MethodBinding method)

computeLocalVariablePositions

public void computeLocalVariablePositions(int initOffset,
                                          CodeStream codeStream)
Compute variable positions in scopes given an initial position offset ignoring unused local variables. Deal with arguments here, locals and subscopes are processed in BlockScope method


findField

public FieldBinding findField(TypeBinding receiverType,
                              char[] fieldName,
                              InvocationSite invocationSite,
                              boolean needResolve)
Overridden to detect the error case inside an explicit constructor call: class X { int i; X myX; X(X x) { this(i, myX.i, x.i); // same for super calls... only the first 2 field accesses are errors } }

Overrides:
findField in class Scope

isInsideConstructor

public boolean isInsideConstructor()

isInsideInitializer

public boolean isInsideInitializer()

isLambdaScope

public boolean isLambdaScope()
Overrides:
isLambdaScope in class Scope

isInsideInitializerOrConstructor

public boolean isInsideInitializerOrConstructor()

problemReporter

public ProblemReporter problemReporter()
Answer the problem reporter to use for raising new problems. Note that as a side-effect, this updates the current reference context (unit, type or method) in case the problem handler decides it is necessary to abort.

Overrides:
problemReporter in class BlockScope

recordInitializationStates

public final int recordInitializationStates(FlowInfo flowInfo)

referenceMethod

public AbstractMethodDeclaration referenceMethod()
Answer the reference method of this scope, or null if initialization scope or lambda scope.


referenceMethodBinding

public MethodBinding referenceMethodBinding()
Answers the binding of the reference method or reference lambda expression.


referenceType

public TypeDeclaration referenceType()
Answer the reference type of this scope. It is the nearest enclosing type of this scope.

Overrides:
referenceType in class BlockScope

hasDefaultNullnessFor

public boolean hasDefaultNullnessFor(int location)
Description copied from class: Scope
Answer a defaultNullness defined for the closest enclosing scope, using bits from Binding.NullnessDefaultMASK.

Overrides:
hasDefaultNullnessFor in class BlockScope