public class MethodScope extends BlockScope
Scope.Substitutor| Modifier and Type | Field and Description |
|---|---|
int |
analysisIndex |
long[] |
definiteInits |
long[][] |
extraDefiniteInits |
SyntheticArgumentBinding[] |
extraSyntheticArguments |
boolean |
hasMissingSwitchDefault |
FieldBinding |
initializedField |
boolean |
isConstructorCall |
boolean |
isPropagatingInnerClassEmulation |
boolean |
isStatic |
int |
lastIndex |
int |
lastVisibleFieldID |
ReferenceContext |
referenceContext |
blockStatement, EmulationPathToImplicitThis, enclosingCase, finallyInfo, insideTypeAnnotation, localIndex, locals, maxOffset, NoEnclosingInstanceInConstructorCall, NoEnclosingInstanceInStaticContext, offset, shiftScopes, startIndex, subscopeCount, subscopesAUTOBOX_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| Constructor and Description |
|---|
MethodScope(Scope parent,
ReferenceContext context,
boolean isStatic) |
MethodScope(Scope parent,
ReferenceContext context,
boolean isStatic,
int lastVisibleFieldID) |
| Modifier and Type | Method and Description |
|---|---|
Binding |
checkRedundantDefaultNullness(int nullBits,
int sourceStart)
Check whether the given null default is redundant at the given position inside this scope.
|
void |
checkUnusedParameters(MethodBinding method) |
void |
computeLocalVariablePositions(int initOffset,
CodeStream codeStream)
Compute variable positions in scopes given an initial position offset
ignoring unused local variables.
|
void |
detectAPILeaks(ASTNode typeNode,
TypeBinding type) |
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,
int sourceStart)
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.
|
boolean |
shouldCheckAPILeaks(ReferenceBinding declaringClass,
boolean memberIsPublic) |
addAnonymousType, addLocalType, addLocalVariable, addSubscope, adjustCurrentAndSubScopeLocalVariablePositions, adjustLocalVariablePositions, allowBlankFinalFieldAssignment, checkAppropriateMethodAgainstSupers, checkUnclosedCloseables, correlateTrackingVarsIfElse, emulateOuterAccess, findLocalType, findLocalVariableDeclarations, findVariable, getBinding, getBinding, getEmulationPath, getEmulationPath, hasResourceTrackers, isDuplicateLocalVariable, maxShiftedOffset, needBlankFinalFieldInitializationCheck, propagateInnerEmulation, pruneWrapperTrackingVar, registerTrackingVariable, removeTrackingVar, scopeIndex, toString, toStringboxing, 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, 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, hasErasedCandidatesCollisions, innermostSwitchCase, invocationType, isAcceptableMethod, isBoxingCompatibleWith, isDefinedInField, isDefinedInMethod, isDefinedInSameUnit, isDefinedInType, isInsideCase, isInsideDeprecatedCode, isInterTypeScope, 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 ReferenceContext referenceContext
public boolean isStatic
public boolean isConstructorCall
public FieldBinding initializedField
public int lastVisibleFieldID
public int analysisIndex
public boolean isPropagatingInnerClassEmulation
public int lastIndex
public long[] definiteInits
public long[][] extraDefiniteInits
public SyntheticArgumentBinding[] extraSyntheticArguments
public boolean hasMissingSwitchDefault
public MethodScope(Scope parent, ReferenceContext context, boolean isStatic)
public MethodScope(Scope parent, ReferenceContext context, boolean isStatic, int lastVisibleFieldID)
public void checkUnusedParameters(MethodBinding method)
public void computeLocalVariablePositions(int initOffset,
CodeStream codeStream)
public FieldBinding findField(TypeBinding receiverType, char[] fieldName, InvocationSite invocationSite, boolean needResolve)
public boolean isInsideConstructor()
public boolean isInsideInitializer()
public boolean isLambdaScope()
isLambdaScope in class Scopepublic boolean isInsideInitializerOrConstructor()
public ProblemReporter problemReporter()
problemReporter in class BlockScopepublic final int recordInitializationStates(FlowInfo flowInfo)
public AbstractMethodDeclaration referenceMethod()
public MethodBinding referenceMethodBinding()
public TypeDeclaration referenceType()
referenceType in class BlockScopepublic boolean hasDefaultNullnessFor(int location,
int sourceStart)
ScopehasDefaultNullnessFor in class Scopepublic Binding checkRedundantDefaultNullness(int nullBits, int sourceStart)
ScopecheckRedundantDefaultNullness in class ScopenullBits - locally defined nullness default, see Binding.NullnessDefaultMASKScope.NOT_REDUNDANT, indicating that a different enclosing nullness default was found,
or null to indicate that no enclosing nullness default was found.public boolean shouldCheckAPILeaks(ReferenceBinding declaringClass, boolean memberIsPublic)
public void detectAPILeaks(ASTNode typeNode, TypeBinding type)