@Override public boolean hasDefaultNullnessFor(int location) { SourceTypeBinding binding = this.referenceContext.binding; if (binding != null) { int nullDefault = binding.getNullDefault(); if (nullDefault != 0) return (nullDefault & location) != 0; } return this.parent.hasDefaultNullnessFor(location); }
@Override public boolean hasDefaultNullnessFor(int location) { SourceTypeBinding binding = this.referenceContext.binding; if (binding != null) { int nullDefault = binding.getNullDefault(); if (nullDefault != 0) return (nullDefault & location) != 0; } return this.parent.hasDefaultNullnessFor(location); }
@Override public boolean hasDefaultNullnessFor(int location) { SourceTypeBinding binding = this.referenceContext.binding; if (binding != null) { int nullDefault = binding.getNullDefault(); if (nullDefault != 0) return (nullDefault & location) != 0; } return this.parent.hasDefaultNullnessFor(location); }
@Override public boolean hasDefaultNullnessFor(int location) { SourceTypeBinding binding = this.referenceContext.binding; if (binding != null) { int nullDefault = binding.getNullDefault(); if (nullDefault != 0) return (nullDefault & location) != 0; } return this.parent.hasDefaultNullnessFor(location); }
@Override public boolean hasDefaultNullnessFor(int location) { SourceTypeBinding binding = this.referenceContext.binding; if (binding != null) { int nullDefault = binding.getNullDefault(); if (nullDefault != 0) return (nullDefault & location) != 0; } return this.parent.hasDefaultNullnessFor(location); }
@Override public boolean hasDefaultNullnessFor(int location) { SourceTypeBinding binding = this.referenceContext.binding; if (binding != null) { int nullDefault = binding.getNullDefault(); if (nullDefault != 0) return (nullDefault & location) != 0; } return this.parent.hasDefaultNullnessFor(location); }
@Override public boolean hasDefaultNullnessFor(int location, int sourceStart) { int nonNullByDefaultValue = localNonNullByDefaultValue(sourceStart); if (nonNullByDefaultValue != 0) { return (nonNullByDefaultValue & location) != 0; } SourceTypeBinding binding = this.referenceContext.binding; if (binding != null) { int nullDefault = binding.getNullDefault(); if (nullDefault != 0) { return (nullDefault & location) != 0; } } return this.parent.hasDefaultNullnessFor(location, sourceStart); }
@Override public /* @Nullable */ Binding checkRedundantDefaultNullness(int nullBits, int sourceStart) { Binding target = localCheckRedundantDefaultNullness(nullBits, sourceStart); if (target != null) { return target; } SourceTypeBinding binding = this.referenceContext.binding; if (binding != null) { int nullDefault = binding.getNullDefault(); if (nullDefault != 0) { return (nullDefault == nullBits) ? binding : null; } } return this.parent.checkRedundantDefaultNullness(nullBits, sourceStart); }
protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long nullBits, boolean isJdk18) { if (!isPrototype()) throw new IllegalStateException(); int thisDefault = getNullDefault(); if (thisDefault != NO_NULL_DEFAULT) { boolean isRedundant = isJdk18 ? thisDefault == nullBits : (nullBits & TagBits.AnnotationNonNullByDefault) != 0; if (isRedundant) { this.scope.problemReporter().nullDefaultAnnotationIsRedundant(location, annotations, this); } return false; // different default means inner default is not redundant -> we're done } return true; }
protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long nullBits, boolean useNullTypeAnnotations) { if (!isPrototype()) throw new IllegalStateException(); int thisDefault = getNullDefault(); if (thisDefault != NO_NULL_DEFAULT) { boolean isRedundant = useNullTypeAnnotations ? thisDefault == nullBits : (nullBits & TagBits.AnnotationNonNullByDefault) != 0; if (isRedundant) { this.scope.problemReporter().nullDefaultAnnotationIsRedundant(location, annotations, this); } return false; // different default means inner default is not redundant -> we're done } return true; }
protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long nullBits, boolean useNullTypeAnnotations) { if (!isPrototype()) throw new IllegalStateException(); int thisDefault = getNullDefault(); if (thisDefault != NO_NULL_DEFAULT) { boolean isRedundant = useNullTypeAnnotations ? thisDefault == nullBits : (nullBits & TagBits.AnnotationNonNullByDefault) != 0; if (isRedundant) { this.scope.problemReporter().nullDefaultAnnotationIsRedundant(location, annotations, this); } return false; // different default means inner default is not redundant -> we're done } return true; }
protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long nullBits, boolean isJdk18) { if (!isPrototype()) throw new IllegalStateException(); int thisDefault = getNullDefault(); if (thisDefault != NO_NULL_DEFAULT) { boolean isRedundant = isJdk18 ? thisDefault == nullBits : (nullBits & TagBits.AnnotationNonNullByDefault) != 0; if (isRedundant) { this.scope.problemReporter().nullDefaultAnnotationIsRedundant(location, annotations, this); } return false; // different default means inner default is not redundant -> we're done } return true; }
protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long nullBits, boolean isJdk18) { if (!isPrototype()) throw new IllegalStateException(); int thisDefault = getNullDefault(); if (thisDefault != NO_NULL_DEFAULT) { boolean isRedundant = isJdk18 ? thisDefault == nullBits : (nullBits & TagBits.AnnotationNonNullByDefault) != 0; if (isRedundant) { this.scope.problemReporter().nullDefaultAnnotationIsRedundant(location, annotations, this); } return false; // different default means inner default is not redundant -> we're done } return true; }
protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long nullBits, boolean useNullTypeAnnotations) { if (!isPrototype()) throw new IllegalStateException(); int thisDefault = getNullDefault(); if (thisDefault != NO_NULL_DEFAULT) { boolean isRedundant = useNullTypeAnnotations ? thisDefault == nullBits : (nullBits & TagBits.AnnotationNonNullByDefault) != 0; if (isRedundant) { this.scope.problemReporter().nullDefaultAnnotationIsRedundant(location, annotations, this); } return false; // different default means inner default is not redundant -> we're done } return true; }
protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long nullBits, boolean useNullTypeAnnotations) { if (!isPrototype()) throw new IllegalStateException(); int thisDefault = getNullDefault(); if (thisDefault != NO_NULL_DEFAULT) { boolean isRedundant = useNullTypeAnnotations ? thisDefault == nullBits : (nullBits & TagBits.AnnotationNonNullByDefault) != 0; if (isRedundant) { this.scope.problemReporter().nullDefaultAnnotationIsRedundant(location, annotations, this); } return false; // different default means inner default is not redundant -> we're done } return true; }
int getNullDefault() { if (!isPrototype()) { return this.prototype.getNullDefault(); } // ensure nullness defaults are initialized at all enclosing levels: switch (this.nullnessDefaultInitialized) { case 0: getAnnotationTagBits(); // initialize //$FALL-THROUGH$ case 1: getPackage().isViewedAsDeprecated(); // initialize annotations this.nullnessDefaultInitialized = 2; } return this.defaultNullness; }
int getNullDefault() { if (!isPrototype()) { return this.prototype.getNullDefault(); } // ensure nullness defaults are initialized at all enclosing levels: switch (this.nullnessDefaultInitialized) { case 0: getAnnotationTagBits(); // initialize //$FALL-THROUGH$ case 1: getPackage().isViewedAsDeprecated(); // initialize annotations this.nullnessDefaultInitialized = 2; } return this.defaultNullness; }
private void createArgumentBindings(MethodBinding method, CompilerOptions compilerOptions) { if (!isPrototype()) throw new IllegalStateException(); if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) getNullDefault(); // ensure initialized AbstractMethodDeclaration methodDecl = method.sourceMethod(); if (methodDecl != null) { // while creating argument bindings we also collect explicit null annotations: if (method.parameters != Binding.NO_PARAMETERS) methodDecl.createArgumentBindings(); // add implicit annotations (inherited(?) & default): if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) { new ImplicitNullAnnotationVerifier(this.scope.environment()).checkImplicitNullAnnotations(method, methodDecl, true, this.scope); } } }
private void createArgumentBindings(MethodBinding method, CompilerOptions compilerOptions) { if (!isPrototype()) throw new IllegalStateException(); if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) getNullDefault(); // ensure initialized AbstractMethodDeclaration methodDecl = method.sourceMethod(); if (methodDecl != null) { // while creating argument bindings we also collect explicit null annotations: if (method.parameters != Binding.NO_PARAMETERS) methodDecl.createArgumentBindings(); // add implicit annotations (inherited(?) & default): if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) { new ImplicitNullAnnotationVerifier(this.scope.environment()).checkImplicitNullAnnotations(method, methodDecl, true, this.scope); } } }
private void createArgumentBindings(MethodBinding method, CompilerOptions compilerOptions) { if (!isPrototype()) throw new IllegalStateException(); if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) getNullDefault(); // ensure initialized AbstractMethodDeclaration methodDecl = method.sourceMethod(); if (methodDecl != null) { // while creating argument bindings we also collect explicit null annotations: if (method.parameters != Binding.NO_PARAMETERS) methodDecl.createArgumentBindings(); // add implicit annotations (inherited(?) & default): if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) { new ImplicitNullAnnotationVerifier(this.scope.environment()).checkImplicitNullAnnotations(method, methodDecl, true, this.scope); } } }