package org.eclipse.jdt.internal.compiler.lookup;
import java.util.stream.Stream;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
import org.eclipse.jdt.internal.compiler.ast.ReferenceExpression;
import org.eclipse.jdt.internal.compiler.ast.SwitchStatement;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
public class SyntheticMethodBinding extends MethodBinding {
public FieldBinding targetReadField;
public FieldBinding targetWriteField;
public MethodBinding targetMethod;
public TypeBinding targetEnumType;
public LambdaExpression lambda;
public SwitchStatement switchStatement;
public ReferenceExpression serializableMethodRef;
public int purpose;
public int startIndex;
public int endIndex;
public final static int FieldReadAccess = 1;
public final static int FieldWriteAccess = 2;
public final static int SuperFieldReadAccess = 3;
public final static int SuperFieldWriteAccess = 4;
public final static int MethodAccess = 5;
public final static int ConstructorAccess = 6;
public final static int SuperMethodAccess = 7;
public final static int BridgeMethod = 8;
public final static int EnumValues = 9;
public final static int EnumValueOf = 10;
public final static int SwitchTable = 11;
public final static int TooManyEnumsConstants = 12;
public static final int LambdaMethod = 13;
public final static int ArrayConstructor = 14;
public static final int ArrayClone = 15;
public static final int FactoryMethod = 16;
public static final int DeserializeLambda = 17;
public static final int SerializableMethodReference = 18;
public int sourceStart = 0;
public int index;
public int fakePaddedParameters = 0;
public SyntheticMethodBinding(FieldBinding targetField, boolean isReadAccess, boolean isSuperAccess, ReferenceBinding declaringClass) {
this.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
SourceTypeBinding declaringSourceType = (SourceTypeBinding) declaringClass;
SyntheticMethodBinding[] knownAccessMethods = declaringSourceType.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
this.selector = CharOperation.concat(TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX, String.valueOf(methodId).toCharArray());
if (isReadAccess) {
this.returnType = targetField.type;
if (targetField.isStatic()) {
this.parameters = Binding.NO_PARAMETERS;
} else {
this.parameters = new TypeBinding[1];
this.parameters[0] = declaringSourceType;
}
this.targetReadField = targetField;
this.purpose = isSuperAccess ? SyntheticMethodBinding.SuperFieldReadAccess : SyntheticMethodBinding.FieldReadAccess;
} else {
this.returnType = TypeBinding.VOID;
if (targetField.isStatic()) {
this.parameters = new TypeBinding[1];
this.parameters[0] = targetField.type;
} else {
this.parameters = new TypeBinding[2];
this.parameters[0] = declaringSourceType;
this.parameters[1] = targetField.type;
}
this.targetWriteField = targetField;
this.purpose = isSuperAccess ? SyntheticMethodBinding.SuperFieldWriteAccess : SyntheticMethodBinding.FieldWriteAccess;
}
this.thrownExceptions = Binding.NO_EXCEPTIONS;
this.declaringClass = declaringSourceType;
boolean needRename;
do {
check : {
needRename = false;
long range;
MethodBinding[] methods = declaringSourceType.methods();
if ((range = ReferenceBinding.binarySearch(this.selector, methods)) >= 0) {
int paramCount = this.parameters.length;
nextMethod: for (int imethod = (int)range, end = (int)(range >> 32); imethod <= end; imethod++) {
MethodBinding method = methods[imethod];
if (method.parameters.length == paramCount) {
TypeBinding[] toMatch = method.parameters;
for (int i = 0; i < paramCount; i++) {
if (TypeBinding.notEquals(toMatch[i], this.parameters[i])) {
continue nextMethod;
}
}
needRename = true;
break check;
}
}
}
if (knownAccessMethods != null) {
for (int i = 0, length = knownAccessMethods.length; i < length; i++) {
if (knownAccessMethods[i] == null) continue;
if (CharOperation.equals(this.selector, knownAccessMethods[i].selector) && areParametersEqual(methods[i])) {
needRename = true;
break check;
}
}
}
}
if (needRename) {
setSelector(CharOperation.concat(TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX, String.valueOf(++methodId).toCharArray()));
}
} while (needRename);
FieldDeclaration[] fieldDecls = declaringSourceType.scope.referenceContext.fields;
if (fieldDecls != null) {
for (int i = 0, max = fieldDecls.length; i < max; i++) {
if (fieldDecls[i].binding == targetField) {
this.sourceStart = fieldDecls[i].sourceStart;
return;
}
}
}
this.sourceStart = declaringSourceType.scope.referenceContext.sourceStart;
}
public SyntheticMethodBinding(FieldBinding targetField, ReferenceBinding declaringClass, TypeBinding enumBinding, char[] selector, SwitchStatement switchStatement) {
this.modifiers = (declaringClass.isInterface() ? ClassFileConstants.AccPublic : ClassFileConstants.AccDefault) | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
SourceTypeBinding declaringSourceType = (SourceTypeBinding) declaringClass;
SyntheticMethodBinding[] knownAccessMethods = declaringSourceType.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
this.selector = selector;
this.returnType = declaringSourceType.scope.createArrayType(TypeBinding.INT, 1);
this.parameters = Binding.NO_PARAMETERS;
this.targetReadField = targetField;
this.targetEnumType = enumBinding;
this.purpose = SyntheticMethodBinding.SwitchTable;
this.thrownExceptions = Binding.NO_EXCEPTIONS;
this.declaringClass = declaringSourceType;
this.switchStatement = switchStatement;
if (declaringSourceType.isStrictfp()) {
this.modifiers |= ClassFileConstants.AccStrictfp;
}
boolean needRename;
do {
check : {
needRename = false;
long range;
MethodBinding[] methods = declaringSourceType.methods();
if ((range = ReferenceBinding.binarySearch(this.selector, methods)) >= 0) {
int paramCount = this.parameters.length;
nextMethod: for (int imethod = (int)range, end = (int)(range >> 32); imethod <= end; imethod++) {
MethodBinding method = methods[imethod];
if (method.parameters.length == paramCount) {
TypeBinding[] toMatch = method.parameters;
for (int i = 0; i < paramCount; i++) {
if (TypeBinding.notEquals(toMatch[i], this.parameters[i])) {
continue nextMethod;
}
}
needRename = true;
break check;
}
}
}
if (knownAccessMethods != null) {
for (int i = 0, length = knownAccessMethods.length; i < length; i++) {
if (knownAccessMethods[i] == null) continue;
if (CharOperation.equals(this.selector, knownAccessMethods[i].selector) && areParametersEqual(methods[i])) {
needRename = true;
break check;
}
}
}
}
if (needRename) {
setSelector(CharOperation.concat(selector, String.valueOf(++methodId).toCharArray()));
}
} while (needRename);
this.sourceStart = declaringSourceType.scope.referenceContext.sourceStart;
}
public SyntheticMethodBinding(MethodBinding targetMethod, boolean isSuperAccess, ReferenceBinding declaringClass) {
if (targetMethod.isConstructor()) {
initializeConstructorAccessor(targetMethod);
} else {
initializeMethodAccessor(targetMethod, isSuperAccess, declaringClass);
}
}
public SyntheticMethodBinding(MethodBinding overridenMethodToBridge, MethodBinding targetMethod, SourceTypeBinding declaringClass) {
this.declaringClass = declaringClass;
this.selector = overridenMethodToBridge.selector;
this.modifiers = (targetMethod.modifiers | ClassFileConstants.AccBridge | ClassFileConstants.AccSynthetic) & ~(ClassFileConstants.AccSynchronized | ClassFileConstants.AccAbstract | ClassFileConstants.AccNative | ClassFileConstants.AccFinal | ExtraCompilerModifiers.AccGenericSignature);
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
this.returnType = overridenMethodToBridge.returnType;
this.parameters = overridenMethodToBridge.parameters;
this.thrownExceptions = overridenMethodToBridge.thrownExceptions;
this.targetMethod = targetMethod;
this.purpose = SyntheticMethodBinding.BridgeMethod;
SyntheticMethodBinding[] knownAccessMethods = declaringClass.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
}
public SyntheticMethodBinding(SourceTypeBinding declaringEnum, char[] selector) {
this.declaringClass = declaringEnum;
this.selector = selector;
this.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
LookupEnvironment environment = declaringEnum.scope.environment();
this.thrownExceptions = Binding.NO_EXCEPTIONS;
if (selector == TypeConstants.VALUES) {
this.returnType = environment.createArrayType(environment.convertToParameterizedType(declaringEnum), 1);
this.parameters = Binding.NO_PARAMETERS;
this.purpose = SyntheticMethodBinding.EnumValues;
} else if (selector == TypeConstants.VALUEOF) {
this.returnType = environment.convertToParameterizedType(declaringEnum);
this.parameters = new TypeBinding[]{ declaringEnum.scope.getJavaLangString() };
this.purpose = SyntheticMethodBinding.EnumValueOf;
}
SyntheticMethodBinding[] knownAccessMethods = ((SourceTypeBinding)this.declaringClass).syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
if (declaringEnum.isStrictfp()) {
this.modifiers |= ClassFileConstants.AccStrictfp;
}
}
public SyntheticMethodBinding(SourceTypeBinding declaringClass) {
this.declaringClass = declaringClass;
this.selector = TypeConstants.DESERIALIZE_LAMBDA;
this.modifiers = ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
this.thrownExceptions = Binding.NO_EXCEPTIONS;
this.returnType = declaringClass.scope.getJavaLangObject();
this.parameters = new TypeBinding[]{declaringClass.scope.getJavaLangInvokeSerializedLambda()};
this.purpose = SyntheticMethodBinding.DeserializeLambda;
SyntheticMethodBinding[] knownAccessMethods = declaringClass.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
}
public SyntheticMethodBinding(SourceTypeBinding declaringEnum, int startIndex, int endIndex) {
this.declaringClass = declaringEnum;
SyntheticMethodBinding[] knownAccessMethods = declaringEnum.syntheticMethods();
this.index = knownAccessMethods == null ? 0 : knownAccessMethods.length;
StringBuffer buffer = new StringBuffer();
buffer.append(TypeConstants.SYNTHETIC_ENUM_CONSTANT_INITIALIZATION_METHOD_PREFIX).append(this.index);
this.selector = String.valueOf(buffer).toCharArray();
this.modifiers = ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
this.purpose = SyntheticMethodBinding.TooManyEnumsConstants;
this.thrownExceptions = Binding.NO_EXCEPTIONS;
this.returnType = TypeBinding.VOID;
this.parameters = Binding.NO_PARAMETERS;
this.startIndex = startIndex;
this.endIndex = endIndex;
}
public SyntheticMethodBinding(MethodBinding overridenMethodToBridge, SourceTypeBinding declaringClass) {
this.declaringClass = declaringClass;
this.selector = overridenMethodToBridge.selector;
this.modifiers = (overridenMethodToBridge.modifiers | ClassFileConstants.AccBridge | ClassFileConstants.AccSynthetic) & ~(ClassFileConstants.AccSynchronized | ClassFileConstants.AccAbstract | ClassFileConstants.AccNative | ClassFileConstants.AccFinal | ExtraCompilerModifiers.AccGenericSignature);
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
this.returnType = overridenMethodToBridge.returnType;
this.parameters = overridenMethodToBridge.parameters;
this.thrownExceptions = overridenMethodToBridge.thrownExceptions;
this.targetMethod = overridenMethodToBridge;
this.purpose = SyntheticMethodBinding.SuperMethodAccess;
SyntheticMethodBinding[] knownAccessMethods = declaringClass.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
}
public SyntheticMethodBinding(int purpose, ArrayBinding arrayType, char [] selector, SourceTypeBinding declaringClass) {
this.declaringClass = declaringClass;
this.selector = selector;
this.modifiers = ClassFileConstants.AccSynthetic | ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
this.returnType = arrayType;
LookupEnvironment environment = declaringClass.environment;
if (environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) {
if (environment.usesNullTypeAnnotations())
this.returnType = environment.createAnnotatedType(this.returnType, new AnnotationBinding[]{ environment.getNonNullAnnotation() });
else
this.tagBits |= TagBits.AnnotationNonNull;
}
this.parameters = new TypeBinding[] { purpose == SyntheticMethodBinding.ArrayConstructor ? TypeBinding.INT : (TypeBinding) arrayType};
this.thrownExceptions = Binding.NO_EXCEPTIONS;
this.purpose = purpose;
SyntheticMethodBinding[] knownAccessMethods = declaringClass.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
}
public SyntheticMethodBinding(LambdaExpression lambda, char [] lambdaName, SourceTypeBinding declaringClass) {
this.lambda = lambda;
this.declaringClass = declaringClass;
this.selector = lambdaName;
this.modifiers = lambda.binding.modifiers;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved) | (lambda.binding.tagBits & TagBits.HasParameterAnnotations);
this.returnType = lambda.binding.returnType;
this.parameters = lambda.binding.parameters;
TypeVariableBinding[] vars = Stream.of(this.parameters).filter(param -> param.isTypeVariable()).toArray(TypeVariableBinding[]::new);
if (vars != null && vars.length > 0)
this.typeVariables = vars;
this.thrownExceptions = lambda.binding.thrownExceptions;
this.purpose = SyntheticMethodBinding.LambdaMethod;
SyntheticMethodBinding[] knownAccessMethods = declaringClass.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
}
public SyntheticMethodBinding(ReferenceExpression ref, SourceTypeBinding declaringClass) {
this.serializableMethodRef = ref;
this.declaringClass = declaringClass;
this.selector = ref.binding.selector;
this.modifiers = ref.binding.modifiers;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved) | (ref.binding.tagBits & TagBits.HasParameterAnnotations);
this.returnType = ref.binding.returnType;
this.parameters = ref.binding.parameters;
this.thrownExceptions = ref.binding.thrownExceptions;
this.purpose = SyntheticMethodBinding.SerializableMethodReference;
SyntheticMethodBinding[] knownAccessMethods = declaringClass.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
}
public SyntheticMethodBinding(MethodBinding privateConstructor, MethodBinding publicConstructor, char[] selector, TypeBinding[] enclosingInstances, SourceTypeBinding declaringClass) {
this.declaringClass = declaringClass;
this.selector = selector;
this.modifiers = ClassFileConstants.AccSynthetic | ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
this.returnType = publicConstructor.declaringClass;
int realParametersLength = privateConstructor.parameters.length;
int enclosingInstancesLength = enclosingInstances.length;
int parametersLength = enclosingInstancesLength + realParametersLength;
this.parameters = new TypeBinding[parametersLength];
System.arraycopy(enclosingInstances, 0, this.parameters, 0, enclosingInstancesLength);
System.arraycopy(privateConstructor.parameters, 0, this.parameters, enclosingInstancesLength, realParametersLength);
this.fakePaddedParameters = publicConstructor.parameters.length - realParametersLength;
this.thrownExceptions = publicConstructor.thrownExceptions;
this.purpose = SyntheticMethodBinding.FactoryMethod;
this.targetMethod = publicConstructor;
SyntheticMethodBinding[] knownAccessMethods = declaringClass.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
}
public void initializeConstructorAccessor(MethodBinding accessedConstructor) {
this.targetMethod = accessedConstructor;
this.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccSynthetic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
SourceTypeBinding sourceType = (SourceTypeBinding) accessedConstructor.declaringClass;
SyntheticMethodBinding[] knownSyntheticMethods = sourceType.syntheticMethods();
this.index = knownSyntheticMethods == null ? 0 : knownSyntheticMethods.length;
this.selector = accessedConstructor.selector;
this.returnType = accessedConstructor.returnType;
this.purpose = SyntheticMethodBinding.ConstructorAccess;
final int parametersLength = accessedConstructor.parameters.length;
this.parameters = new TypeBinding[parametersLength + 1];
System.arraycopy(
accessedConstructor.parameters,
0,
this.parameters,
0,
parametersLength);
this.parameters[parametersLength] =
accessedConstructor.declaringClass;
this.thrownExceptions = accessedConstructor.thrownExceptions;
this.declaringClass = sourceType;
boolean needRename;
do {
check : {
needRename = false;
MethodBinding[] methods = sourceType.methods();
for (int i = 0, length = methods.length; i < length; i++) {
if (CharOperation.equals(this.selector, methods[i].selector) && areParameterErasuresEqual(methods[i])) {
needRename = true;
break check;
}
}
if (knownSyntheticMethods != null) {
for (int i = 0, length = knownSyntheticMethods.length; i < length; i++) {
if (knownSyntheticMethods[i] == null)
continue;
if (CharOperation.equals(this.selector, knownSyntheticMethods[i].selector) && areParameterErasuresEqual(knownSyntheticMethods[i])) {
needRename = true;
break check;
}
}
}
}
if (needRename) {
int length = this.parameters.length;
System.arraycopy(
this.parameters,
0,
this.parameters = new TypeBinding[length + 1],
0,
length);
this.parameters[length] = this.declaringClass;
}
} while (needRename);
AbstractMethodDeclaration[] methodDecls =
sourceType.scope.referenceContext.methods;
if (methodDecls != null) {
for (int i = 0, length = methodDecls.length; i < length; i++) {
if (methodDecls[i].binding == accessedConstructor) {
this.sourceStart = methodDecls[i].sourceStart;
return;
}
}
}
}
public void initializeMethodAccessor(MethodBinding accessedMethod, boolean isSuperAccess, ReferenceBinding receiverType) {
this.targetMethod = accessedMethod;
if (isSuperAccess && receiverType.isInterface() && !accessedMethod.isStatic())
this.modifiers = ClassFileConstants.AccPrivate | ClassFileConstants.AccSynthetic;
else {
if (receiverType.isInterface())
this.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic;
else
this.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic;
}
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
SourceTypeBinding declaringSourceType = (SourceTypeBinding) receiverType;
SyntheticMethodBinding[] knownAccessMethods = declaringSourceType.syntheticMethods();
int methodId = knownAccessMethods == null ? 0 : knownAccessMethods.length;
this.index = methodId;
this.selector = CharOperation.concat(TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX, String.valueOf(methodId).toCharArray());
this.returnType = accessedMethod.returnType;
this.purpose = isSuperAccess ? SyntheticMethodBinding.SuperMethodAccess : SyntheticMethodBinding.MethodAccess;
if (accessedMethod.isStatic() || (isSuperAccess && receiverType.isInterface())) {
this.parameters = accessedMethod.parameters;
} else {
this.parameters = new TypeBinding[accessedMethod.parameters.length + 1];
this.parameters[0] = declaringSourceType;
System.arraycopy(accessedMethod.parameters, 0, this.parameters, 1, accessedMethod.parameters.length);
}
this.thrownExceptions = accessedMethod.thrownExceptions;
this.declaringClass = declaringSourceType;
boolean needRename;
do {
check : {
needRename = false;
MethodBinding[] methods = declaringSourceType.methods();
for (int i = 0, length = methods.length; i < length; i++) {
if (CharOperation.equals(this.selector, methods[i].selector) && areParameterErasuresEqual(methods[i])) {
needRename = true;
break check;
}
}
if (knownAccessMethods != null) {
for (int i = 0, length = knownAccessMethods.length; i < length; i++) {
if (knownAccessMethods[i] == null) continue;
if (CharOperation.equals(this.selector, knownAccessMethods[i].selector) && areParameterErasuresEqual(knownAccessMethods[i])) {
needRename = true;
break check;
}
}
}
}
if (needRename) {
setSelector(CharOperation.concat(TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX, String.valueOf(++methodId).toCharArray()));
}
} while (needRename);
AbstractMethodDeclaration[] methodDecls = declaringSourceType.scope.referenceContext.methods;
if (methodDecls != null) {
for (int i = 0, length = methodDecls.length; i < length; i++) {
if (methodDecls[i].binding == accessedMethod) {
this.sourceStart = methodDecls[i].sourceStart;
return;
}
}
}
}
protected boolean isConstructorRelated() {
return this.purpose == SyntheticMethodBinding.ConstructorAccess;
}
@Override
public LambdaExpression sourceLambda() {
return this.lambda;
}
public void markNonNull(LookupEnvironment environment) {
markNonNull(this, this.purpose, environment);
}
static void markNonNull(MethodBinding method, int purpose, LookupEnvironment environment) {
switch (purpose) {
case EnumValues:
if (environment.usesNullTypeAnnotations()) {
TypeBinding elementType = ((ArrayBinding)method.returnType).leafComponentType();
AnnotationBinding nonNullAnnotation = environment.getNonNullAnnotation();
elementType = environment.createAnnotatedType(elementType, new AnnotationBinding[]{ environment.getNonNullAnnotation() });
method.returnType = environment.createArrayType(elementType, 1, new AnnotationBinding[]{ nonNullAnnotation, null });
} else {
method.tagBits |= TagBits.AnnotationNonNull;
}
return;
case EnumValueOf:
if (environment.usesNullTypeAnnotations()) {
method.returnType = environment.createAnnotatedType(method.returnType, new AnnotationBinding[]{ environment.getNonNullAnnotation() });
} else {
method.tagBits |= TagBits.AnnotationNonNull;
}
return;
}
}
}