protected TypeAnnotationWalker restrict(long newMatches, int newPathPtr) { // considers nextIsDefaultLocation as the new atDefaultLocation try { // do we have any change at all? if (this.matches == newMatches && this.pathPtr == newPathPtr && this.atDefaultLocation == this.nextIsDefaultLocation) return this; // are we running out of real type annotations? if (newMatches == 0 || this.typeAnnotations == null || this.typeAnnotations.length == 0) return new NonNullDefaultAwareTypeAnnotationWalker(this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation); // proceed as normal, but pass on our specific fields, too: return new NonNullDefaultAwareTypeAnnotationWalker(this.typeAnnotations, newMatches, newPathPtr, this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation); } finally { this.nextIsDefaultLocation = false; // expire } }
/** Create initial walker with non-empty type annotations. */ public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, int defaultNullness, LookupEnvironment environment) { super(typeAnnotations); this.nonNullAnnotation = getNonNullAnnotation(environment); this.defaultNullness = defaultNullness; this.environment = environment; }
@Override public ITypeAnnotationWalker toField() { // don't set nextIsDefaultLocation, because field-level nullness is handled by BinaryTypeBinding.scanFieldForNullAnnotation if (this.isEmpty) return restrict(this.matches, this.pathPtr); return super.toField(); }
NonNullDefaultAwareTypeAnnotationWalker nonNullDefaultAwareTypeAnnotationWalker = (NonNullDefaultAwareTypeAnnotationWalker) walker; if(nonNullDefaultAwareTypeAnnotationWalker.isEmpty) { return new NonNullDefaultAwareTypeAnnotationWalker(defaultNullness, environment); nonNullAnnotation2 = getNonNullAnnotation(environment); return new NonNullDefaultAwareTypeAnnotationWalker(typeAnnotationWalker.typeAnnotations, typeAnnotationWalker.matches, typeAnnotationWalker.pathPtr, defaultNullness, nonNullAnnotation2, false, false, environment, false); } else { return new NonNullDefaultAwareTypeAnnotationWalker(defaultNullness, environment);
while (wrapper.signature[wrapper.start] != Util.C_PARAM_END) { IBinaryAnnotation[] binaryParameterAnnotations = method.getParameterAnnotations(rank, this.fileName); ITypeAnnotationWalker updatedWalker = NonNullDefaultAwareTypeAnnotationWalker.updateWalkerForParamNonNullDefault(walker, getNullDefaultFrom(binaryParameterAnnotations), this.environment); types.add(this.environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames, updatedWalker.toMethodParameter(rank))); rank++;
@Override public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) { this.nextIsDefaultLocation = (this.defaultNullness & Binding.DefaultLocationTypeParameter) != 0; this.nextIsTypeBound = false; if (this.isEmpty) return restrict(this.matches, this.pathPtr); return super.toTypeParameter(isClassTypeParameter, rank); }
@Override public ITypeAnnotationWalker toWildcardBound() { this.nextIsDefaultLocation = (this.defaultNullness & Binding.DefaultLocationTypeBound) != 0; this.nextIsTypeBound = true; if (this.isEmpty) return restrict(this.matches, this.pathPtr); return super.toWildcardBound(); }
/** Create initial walker with non-empty type annotations. */ public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, int defaultNullness, LookupEnvironment environment) { super(typeAnnotations); this.nonNullAnnotation = getNonNullAnnotation(environment); this.defaultNullness = defaultNullness; }
protected TypeAnnotationWalker restrict(long newMatches, int newPathPtr) { // considers nextIsDefaultLocation as the new atDefaultLocation try { // do we have any change at all? if (this.matches == newMatches && this.pathPtr == newPathPtr && this.atDefaultLocation == this.nextIsDefaultLocation) return this; // are we running out of real type annotations? if (newMatches == 0 || this.typeAnnotations == null || this.typeAnnotations.length == 0) return new NonNullDefaultAwareTypeAnnotationWalker(this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation); // proceed as normal, but pass on our specific fields, too: return new NonNullDefaultAwareTypeAnnotationWalker(this.typeAnnotations, newMatches, newPathPtr, this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation); } finally { this.nextIsDefaultLocation = false; // expire } }
@Override public ITypeAnnotationWalker toNextArrayDimension() { boolean hasNNBDForArrayContents = (this.defaultNullness & Binding.DefaultLocationArrayContents) != 0; if (hasNNBDForArrayContents) { this.nextArrayContentIsNonNull = true; } this.nextIsDefaultLocation = false; this.nextIsTypeBound = false; if (this.isEmpty) return restrict(this.matches, this.pathPtr); return super.toNextArrayDimension(); }
/** Create initial walker with non-empty type annotations. */ public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, int defaultNullness, LookupEnvironment environment) { super(typeAnnotations); this.nonNullAnnotation = getNonNullAnnotation(environment); this.defaultNullness = defaultNullness; this.environment = environment; }
protected TypeAnnotationWalker restrict(long newMatches, int newPathPtr) { // considers nextIsDefaultLocation as the new atDefaultLocation try { // do we have any change at all? if (this.matches == newMatches && this.pathPtr == newPathPtr && this.atDefaultLocation == this.nextIsDefaultLocation) return this; // are we running out of real type annotations? if (newMatches == 0 || this.typeAnnotations == null || this.typeAnnotations.length == 0) return new NonNullDefaultAwareTypeAnnotationWalker(this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation); // proceed as normal, but pass on our specific fields, too: return new NonNullDefaultAwareTypeAnnotationWalker(this.typeAnnotations, newMatches, newPathPtr, this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation); } finally { this.nextIsDefaultLocation = false; // expire } }
@Override public ITypeAnnotationWalker toSupertype(short index, char[] superTypeSignature) { if (this.isEmpty) return restrict(this.matches, this.pathPtr); return super.toSupertype(index, superTypeSignature); }
/** Create initial walker with non-empty type annotations. */ public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, int defaultNullness, LookupEnvironment environment) { super(typeAnnotations); this.nonNullAnnotation = getNonNullAnnotation(environment); this.defaultNullness = defaultNullness; this.environment = environment; this.atDefaultLocation = false; this.atTypeBound = false; this.isEmpty = false; this.currentArrayContentIsNonNull = false; }
protected TypeAnnotationWalker restrict(long newMatches, int newPathPtr) { // considers nextIsDefaultLocation as the new atDefaultLocation try { // do we have any change at all? if (this.matches == newMatches && this.pathPtr == newPathPtr && this.atDefaultLocation == this.nextIsDefaultLocation && this.atTypeBound == this.nextIsTypeBound) return this; // are we running out of real type annotations? if (newMatches == 0 || this.typeAnnotations == null || this.typeAnnotations.length == 0) return new NonNullDefaultAwareTypeAnnotationWalker(this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation, this.nextIsTypeBound, this.environment); // proceed as normal, but pass on our specific fields, too: return new NonNullDefaultAwareTypeAnnotationWalker(this.typeAnnotations, newMatches, newPathPtr, this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation, this.nextIsTypeBound, this.environment); } finally { this.nextIsDefaultLocation = false; // expire this.nextIsTypeBound = false; } }
@Override public ITypeAnnotationWalker toMethodReturn() { // don't set nextIsDefaultLocation, because signature-level nullness is handled by ImplicitNullAnnotationVerifier (triggered per invocation via MessageSend.resolveType() et al) if (this.isEmpty) return restrict(this.matches, this.pathPtr); return super.toMethodReturn(); }
/** Create initial walker with non-empty type annotations. */ public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, int defaultNullness, LookupEnvironment environment) { super(typeAnnotations); this.nonNullAnnotation = getNonNullAnnotation(environment); this.defaultNullness = defaultNullness; }
@Override protected TypeAnnotationWalker restrict(long newMatches, int newPathPtr) { // considers nextIsDefaultLocation as the new atDefaultLocation try { // do we have any change at all? if (this.matches == newMatches && this.pathPtr == newPathPtr && this.atDefaultLocation == this.nextIsDefaultLocation && this.atTypeBound == this.nextIsTypeBound && this.currentArrayContentIsNonNull == this.nextArrayContentIsNonNull) return this; // are we running out of real type annotations? if (newMatches == 0 || this.typeAnnotations == null || this.typeAnnotations.length == 0) return new NonNullDefaultAwareTypeAnnotationWalker(this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation, this.nextIsTypeBound, this.environment, this.nextArrayContentIsNonNull); // proceed as normal, but pass on our specific fields, too: return new NonNullDefaultAwareTypeAnnotationWalker(this.typeAnnotations, newMatches, newPathPtr, this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation, this.nextIsTypeBound, this.environment, this.nextArrayContentIsNonNull); } finally { this.nextIsDefaultLocation = false; // expire this.nextIsTypeBound = false; this.nextArrayContentIsNonNull = this.currentArrayContentIsNonNull; } }
@Override public ITypeAnnotationWalker toTypeBound(short boundIndex) { this.nextIsDefaultLocation = (this.defaultNullness & Binding.DefaultLocationTypeBound) != 0; this.nextIsTypeBound = true; this.nextArrayContentIsNonNull = false; if (this.isEmpty) return restrict(this.matches, this.pathPtr); return super.toTypeBound(boundIndex); }
/** Create initial walker with non-empty type annotations. */ public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, int defaultNullness, LookupEnvironment environment) { super(typeAnnotations); this.nonNullAnnotation = getNonNullAnnotation(environment); this.defaultNullness = defaultNullness; this.environment = environment; this.atDefaultLocation = false; this.atTypeBound = false; this.isEmpty = false; this.currentArrayContentIsNonNull = false; }