}
// pre: !argumentTypeElided()
// try to merge null annotations from descriptor into binding, complaining about any incompatibilities found
private void mergeParameterNullAnnotations(BlockScope currentScope) {
LookupEnvironment env = currentScope.environment();
TypeBinding[] ourParameters = this.binding.parameters;
TypeBinding[] descParameters = this.descriptor.parameters;
int len = Math.min(ourParameters.length, descParameters.length);
for (int i = 0; i < len; i++) {
long ourTagBits = ourParameters[i].tagBits & TagBits.AnnotationNullMASK;
long descTagBits = descParameters[i].tagBits & TagBits.AnnotationNullMASK;
if (ourTagBits == 0L) {
if (descTagBits != 0L && !ourParameters[i].isBaseType()) {
AnnotationBinding [] annotations = descParameters[i].getTypeAnnotations();
for (int j = 0, length = annotations.length; j < length; j++) {
AnnotationBinding annotation = annotations[j];
if (annotation != null) {
switch (annotation.getAnnotationType().id) {
case TypeIds.T_ConfiguredAnnotationNullable :
case TypeIds.T_ConfiguredAnnotationNonNull :
ourParameters[i] = env.createAnnotatedType(ourParameters[i], new AnnotationBinding [] { annotation });
break;
}
}
}
}
} else if (ourTagBits != descTagBits) {
if (ourTagBits == TagBits.AnnotationNonNull) { // requested @NonNull not provided
char[][] inheritedAnnotationName = null;
if (descTagBits == TagBits.AnnotationNullable)
inheritedAnnotationName = env.getNullableAnnotationName();
currentScope.problemReporter().illegalRedefinitionToNonNullParameter(this.arguments[i], this.descriptor.declaringClass, inheritedAnnotationName);
}
}
}
}