Search in sources :

Example 1 with AnnotationContext

use of org.eclipse.jdt.internal.compiler.codegen.AnnotationContext in project bazel-jdt-java-toolchain by salesforce.

the class ClassFile method completeRuntimeTypeAnnotations.

private int completeRuntimeTypeAnnotations(int attributesNumber, ASTNode node, Predicate<ASTNode> condition, Supplier<List<AnnotationContext>> supplier) {
    int invisibleTypeAnnotationsCounter = 0;
    int visibleTypeAnnotationsCounter = 0;
    if (condition.test(node)) {
        List<AnnotationContext> allTypeAnnotationContexts = supplier.get();
        if (allTypeAnnotationContexts.size() > 0) {
            AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[allTypeAnnotationContexts.size()];
            allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
            for (int j = 0, max2 = allTypeAnnotationContextsArray.length; j < max2; j++) {
                AnnotationContext annotationContext = allTypeAnnotationContextsArray[j];
                if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
                    invisibleTypeAnnotationsCounter++;
                } else {
                    visibleTypeAnnotationsCounter++;
                }
            }
            attributesNumber += generateRuntimeTypeAnnotations(allTypeAnnotationContextsArray, visibleTypeAnnotationsCounter, invisibleTypeAnnotationsCounter);
        }
    }
    return attributesNumber;
}
Also used : AnnotationContext(org.eclipse.jdt.internal.compiler.codegen.AnnotationContext)

Example 2 with AnnotationContext

use of org.eclipse.jdt.internal.compiler.codegen.AnnotationContext in project bazel-jdt-java-toolchain by salesforce.

the class ClassFile method addComponentAttributes.

private int addComponentAttributes(RecordComponentBinding recordComponentBinding, int componetAttributeOffset) {
    // See JVMS 14 Table 4.7-C - Record Preview for allowed attributes
    int attributesNumber = 0;
    // add signature attribute
    char[] genericSignature = recordComponentBinding.genericSignature();
    if (genericSignature != null) {
        attributesNumber += generateSignatureAttribute(genericSignature);
    }
    RecordComponent recordComponent = recordComponentBinding.sourceRecordComponent();
    if (recordComponent != null) {
        Annotation[] annotations = recordComponent.annotations;
        if (annotations != null) {
            attributesNumber += generateRuntimeAnnotations(annotations, TagBits.AnnotationForRecordComponent);
        }
        if ((this.produceAttributes & ClassFileConstants.ATTR_TYPE_ANNOTATION) != 0) {
            List<AnnotationContext> allTypeAnnotationContexts = new ArrayList<>();
            if (annotations != null && (recordComponent.bits & ASTNode.HasTypeAnnotations) != 0) {
                recordComponent.getAllAnnotationContexts(AnnotationTargetTypeConstants.FIELD, allTypeAnnotationContexts);
            }
            TypeReference recordComponentType = recordComponent.type;
            if (recordComponentType != null && ((recordComponentType.bits & ASTNode.HasTypeAnnotations) != 0)) {
                recordComponentType.getAllAnnotationContexts(AnnotationTargetTypeConstants.RECORD_COMPONENT, allTypeAnnotationContexts);
            }
            int size = allTypeAnnotationContexts.size();
            attributesNumber = completeRuntimeTypeAnnotations(attributesNumber, null, (node) -> size > 0, () -> allTypeAnnotationContexts);
        }
    }
    if ((recordComponentBinding.tagBits & TagBits.HasMissingType) != 0) {
        this.missingTypes = recordComponentBinding.type.collectMissingTypes(this.missingTypes);
    }
    return attributesNumber;
}
Also used : TypeAnnotationCodeStream(org.eclipse.jdt.internal.compiler.codegen.TypeAnnotationCodeStream) Arrays(java.util.Arrays) QualifiedNameReference(org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference) OpensStatement(org.eclipse.jdt.internal.compiler.ast.OpensStatement) ClassLiteralAccess(org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess) Receiver(org.eclipse.jdt.internal.compiler.ast.Receiver) LocalVariableBinding(org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding) ProblemSeverities(org.eclipse.jdt.internal.compiler.problem.ProblemSeverities) FieldBinding(org.eclipse.jdt.internal.compiler.lookup.FieldBinding) ModuleBinding(org.eclipse.jdt.internal.compiler.lookup.ModuleBinding) AnnotationMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) MethodScope(org.eclipse.jdt.internal.compiler.lookup.MethodScope) PolymorphicMethodBinding(org.eclipse.jdt.internal.compiler.lookup.PolymorphicMethodBinding) MemberValuePair(org.eclipse.jdt.internal.compiler.ast.MemberValuePair) ShouldNotImplement(org.eclipse.jdt.internal.compiler.problem.ShouldNotImplement) Expression(org.eclipse.jdt.internal.compiler.ast.Expression) TagBits(org.eclipse.jdt.internal.compiler.lookup.TagBits) Map(java.util.Map) TypeBinding(org.eclipse.jdt.internal.compiler.lookup.TypeBinding) VerificationTypeInfo(org.eclipse.jdt.internal.compiler.codegen.VerificationTypeInfo) FieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration) Messages(org.eclipse.jdt.internal.compiler.util.Messages) MethodBinding(org.eclipse.jdt.internal.compiler.lookup.MethodBinding) Argument(org.eclipse.jdt.internal.compiler.ast.Argument) Predicate(java.util.function.Predicate) ProblemReasons(org.eclipse.jdt.internal.compiler.lookup.ProblemReasons) CategorizedProblem(org.eclipse.jdt.core.compiler.CategorizedProblem) SyntheticMethodBinding(org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding) Set(java.util.Set) RecordComponent(org.eclipse.jdt.internal.compiler.ast.RecordComponent) TypeReference(org.eclipse.jdt.internal.compiler.ast.TypeReference) Collectors(java.util.stream.Collectors) CaseStatement(org.eclipse.jdt.internal.compiler.ast.CaseStatement) SingleMemberAnnotation(org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation) NormalAnnotation(org.eclipse.jdt.internal.compiler.ast.NormalAnnotation) TypeParameter(org.eclipse.jdt.internal.compiler.ast.TypeParameter) ArrayBinding(org.eclipse.jdt.internal.compiler.lookup.ArrayBinding) List(java.util.List) Constant(org.eclipse.jdt.internal.compiler.impl.Constant) TypeIds(org.eclipse.jdt.internal.compiler.lookup.TypeIds) Util(org.eclipse.jdt.internal.compiler.util.Util) SingleNameReference(org.eclipse.jdt.internal.compiler.ast.SingleNameReference) Annotation(org.eclipse.jdt.internal.compiler.ast.Annotation) IProblem(org.eclipse.jdt.core.compiler.IProblem) TypeDeclaration(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) CompilerOptions(org.eclipse.jdt.internal.compiler.impl.CompilerOptions) AnnotationContext(org.eclipse.jdt.internal.compiler.codegen.AnnotationContext) CompilationUnitDeclaration(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration) ClassFileConstants(org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants) AnnotationTargetTypeConstants(org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants) StringLiteral(org.eclipse.jdt.internal.compiler.ast.StringLiteral) SourceTypeBinding(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding) LambdaExpression(org.eclipse.jdt.internal.compiler.ast.LambdaExpression) HashMap(java.util.HashMap) ASTNode(org.eclipse.jdt.internal.compiler.ast.ASTNode) RequiresStatement(org.eclipse.jdt.internal.compiler.ast.RequiresStatement) Opcodes(org.eclipse.jdt.internal.compiler.codegen.Opcodes) AbortType(org.eclipse.jdt.internal.compiler.problem.AbortType) SyntheticArgumentBinding(org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) StackMapFrame(org.eclipse.jdt.internal.compiler.codegen.StackMapFrame) Binding(org.eclipse.jdt.internal.compiler.lookup.Binding) ExceptionLabel(org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel) FunctionalExpression(org.eclipse.jdt.internal.compiler.ast.FunctionalExpression) ReferenceExpression(org.eclipse.jdt.internal.compiler.ast.ReferenceExpression) AttributeNamesConstants(org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants) MethodDeclaration(org.eclipse.jdt.internal.compiler.ast.MethodDeclaration) SwitchStatement(org.eclipse.jdt.internal.compiler.ast.SwitchStatement) ExceptionMarker(org.eclipse.jdt.internal.compiler.codegen.StackMapFrameCodeStream.ExceptionMarker) LookupEnvironment(org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment) TypeVariableBinding(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) Scope(org.eclipse.jdt.internal.compiler.lookup.Scope) Iterator(java.util.Iterator) ArrayInitializer(org.eclipse.jdt.internal.compiler.ast.ArrayInitializer) ReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) ModuleDeclaration(org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration) CodeStream(org.eclipse.jdt.internal.compiler.codegen.CodeStream) LocalTypeBinding(org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding) ProblemReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding) LocalDeclaration(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) CharOperation(org.eclipse.jdt.core.compiler.CharOperation) StackMapFrameCodeStream(org.eclipse.jdt.internal.compiler.codegen.StackMapFrameCodeStream) ExportsStatement(org.eclipse.jdt.internal.compiler.ast.ExportsStatement) TypeConstants(org.eclipse.jdt.internal.compiler.lookup.TypeConstants) AbortMethod(org.eclipse.jdt.internal.compiler.problem.AbortMethod) StringConstant(org.eclipse.jdt.internal.compiler.impl.StringConstant) AbstractMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration) Comparator(java.util.Comparator) Collections(java.util.Collections) ConstantPool(org.eclipse.jdt.internal.compiler.codegen.ConstantPool) RecordComponentBinding(org.eclipse.jdt.internal.compiler.lookup.RecordComponentBinding) ArrayList(java.util.ArrayList) TypeReference(org.eclipse.jdt.internal.compiler.ast.TypeReference) AnnotationContext(org.eclipse.jdt.internal.compiler.codegen.AnnotationContext) SingleMemberAnnotation(org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation) NormalAnnotation(org.eclipse.jdt.internal.compiler.ast.NormalAnnotation) Annotation(org.eclipse.jdt.internal.compiler.ast.Annotation) RecordComponent(org.eclipse.jdt.internal.compiler.ast.RecordComponent)

Example 3 with AnnotationContext

use of org.eclipse.jdt.internal.compiler.codegen.AnnotationContext in project bazel-jdt-java-toolchain by salesforce.

the class ClassFile method generateTypeAnnotationAttributeForTypeDeclaration.

private int generateTypeAnnotationAttributeForTypeDeclaration() {
    TypeDeclaration typeDeclaration = this.referenceBinding.scope.referenceContext;
    if ((typeDeclaration.bits & ASTNode.HasTypeAnnotations) == 0) {
        return 0;
    }
    int attributesNumber = 0;
    TypeReference superclass = typeDeclaration.superclass;
    List<AnnotationContext> allTypeAnnotationContexts = new ArrayList<>();
    if (superclass != null && (superclass.bits & ASTNode.HasTypeAnnotations) != 0) {
        superclass.getAllAnnotationContexts(AnnotationTargetTypeConstants.CLASS_EXTENDS, -1, allTypeAnnotationContexts);
    }
    TypeReference[] superInterfaces = typeDeclaration.superInterfaces;
    if (superInterfaces != null) {
        for (int i = 0; i < superInterfaces.length; i++) {
            TypeReference superInterface = superInterfaces[i];
            if ((superInterface.bits & ASTNode.HasTypeAnnotations) == 0) {
                continue;
            }
            superInterface.getAllAnnotationContexts(AnnotationTargetTypeConstants.CLASS_EXTENDS, i, allTypeAnnotationContexts);
        }
    }
    // TODO: permittedTypes codegen
    TypeParameter[] typeParameters = typeDeclaration.typeParameters;
    if (typeParameters != null) {
        for (int i = 0, max = typeParameters.length; i < max; i++) {
            TypeParameter typeParameter = typeParameters[i];
            if ((typeParameter.bits & ASTNode.HasTypeAnnotations) != 0) {
                typeParameter.getAllAnnotationContexts(AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER, i, allTypeAnnotationContexts);
            }
        }
    }
    int size = allTypeAnnotationContexts.size();
    attributesNumber = completeRuntimeTypeAnnotations(attributesNumber, null, (node) -> size > 0, () -> allTypeAnnotationContexts);
    return attributesNumber;
}
Also used : TypeAnnotationCodeStream(org.eclipse.jdt.internal.compiler.codegen.TypeAnnotationCodeStream) Arrays(java.util.Arrays) QualifiedNameReference(org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference) OpensStatement(org.eclipse.jdt.internal.compiler.ast.OpensStatement) ClassLiteralAccess(org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess) Receiver(org.eclipse.jdt.internal.compiler.ast.Receiver) LocalVariableBinding(org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding) ProblemSeverities(org.eclipse.jdt.internal.compiler.problem.ProblemSeverities) FieldBinding(org.eclipse.jdt.internal.compiler.lookup.FieldBinding) ModuleBinding(org.eclipse.jdt.internal.compiler.lookup.ModuleBinding) AnnotationMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) MethodScope(org.eclipse.jdt.internal.compiler.lookup.MethodScope) PolymorphicMethodBinding(org.eclipse.jdt.internal.compiler.lookup.PolymorphicMethodBinding) MemberValuePair(org.eclipse.jdt.internal.compiler.ast.MemberValuePair) ShouldNotImplement(org.eclipse.jdt.internal.compiler.problem.ShouldNotImplement) Expression(org.eclipse.jdt.internal.compiler.ast.Expression) TagBits(org.eclipse.jdt.internal.compiler.lookup.TagBits) Map(java.util.Map) TypeBinding(org.eclipse.jdt.internal.compiler.lookup.TypeBinding) VerificationTypeInfo(org.eclipse.jdt.internal.compiler.codegen.VerificationTypeInfo) FieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration) Messages(org.eclipse.jdt.internal.compiler.util.Messages) MethodBinding(org.eclipse.jdt.internal.compiler.lookup.MethodBinding) Argument(org.eclipse.jdt.internal.compiler.ast.Argument) Predicate(java.util.function.Predicate) ProblemReasons(org.eclipse.jdt.internal.compiler.lookup.ProblemReasons) CategorizedProblem(org.eclipse.jdt.core.compiler.CategorizedProblem) SyntheticMethodBinding(org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding) Set(java.util.Set) RecordComponent(org.eclipse.jdt.internal.compiler.ast.RecordComponent) TypeReference(org.eclipse.jdt.internal.compiler.ast.TypeReference) Collectors(java.util.stream.Collectors) CaseStatement(org.eclipse.jdt.internal.compiler.ast.CaseStatement) SingleMemberAnnotation(org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation) NormalAnnotation(org.eclipse.jdt.internal.compiler.ast.NormalAnnotation) TypeParameter(org.eclipse.jdt.internal.compiler.ast.TypeParameter) ArrayBinding(org.eclipse.jdt.internal.compiler.lookup.ArrayBinding) List(java.util.List) Constant(org.eclipse.jdt.internal.compiler.impl.Constant) TypeIds(org.eclipse.jdt.internal.compiler.lookup.TypeIds) Util(org.eclipse.jdt.internal.compiler.util.Util) SingleNameReference(org.eclipse.jdt.internal.compiler.ast.SingleNameReference) Annotation(org.eclipse.jdt.internal.compiler.ast.Annotation) IProblem(org.eclipse.jdt.core.compiler.IProblem) TypeDeclaration(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) CompilerOptions(org.eclipse.jdt.internal.compiler.impl.CompilerOptions) AnnotationContext(org.eclipse.jdt.internal.compiler.codegen.AnnotationContext) CompilationUnitDeclaration(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration) ClassFileConstants(org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants) AnnotationTargetTypeConstants(org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants) StringLiteral(org.eclipse.jdt.internal.compiler.ast.StringLiteral) SourceTypeBinding(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding) LambdaExpression(org.eclipse.jdt.internal.compiler.ast.LambdaExpression) HashMap(java.util.HashMap) ASTNode(org.eclipse.jdt.internal.compiler.ast.ASTNode) RequiresStatement(org.eclipse.jdt.internal.compiler.ast.RequiresStatement) Opcodes(org.eclipse.jdt.internal.compiler.codegen.Opcodes) AbortType(org.eclipse.jdt.internal.compiler.problem.AbortType) SyntheticArgumentBinding(org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) StackMapFrame(org.eclipse.jdt.internal.compiler.codegen.StackMapFrame) Binding(org.eclipse.jdt.internal.compiler.lookup.Binding) ExceptionLabel(org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel) FunctionalExpression(org.eclipse.jdt.internal.compiler.ast.FunctionalExpression) ReferenceExpression(org.eclipse.jdt.internal.compiler.ast.ReferenceExpression) AttributeNamesConstants(org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants) MethodDeclaration(org.eclipse.jdt.internal.compiler.ast.MethodDeclaration) SwitchStatement(org.eclipse.jdt.internal.compiler.ast.SwitchStatement) ExceptionMarker(org.eclipse.jdt.internal.compiler.codegen.StackMapFrameCodeStream.ExceptionMarker) LookupEnvironment(org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment) TypeVariableBinding(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) Scope(org.eclipse.jdt.internal.compiler.lookup.Scope) Iterator(java.util.Iterator) ArrayInitializer(org.eclipse.jdt.internal.compiler.ast.ArrayInitializer) ReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) ModuleDeclaration(org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration) CodeStream(org.eclipse.jdt.internal.compiler.codegen.CodeStream) LocalTypeBinding(org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding) ProblemReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding) LocalDeclaration(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) CharOperation(org.eclipse.jdt.core.compiler.CharOperation) StackMapFrameCodeStream(org.eclipse.jdt.internal.compiler.codegen.StackMapFrameCodeStream) ExportsStatement(org.eclipse.jdt.internal.compiler.ast.ExportsStatement) TypeConstants(org.eclipse.jdt.internal.compiler.lookup.TypeConstants) AbortMethod(org.eclipse.jdt.internal.compiler.problem.AbortMethod) StringConstant(org.eclipse.jdt.internal.compiler.impl.StringConstant) AbstractMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration) Comparator(java.util.Comparator) Collections(java.util.Collections) ConstantPool(org.eclipse.jdt.internal.compiler.codegen.ConstantPool) RecordComponentBinding(org.eclipse.jdt.internal.compiler.lookup.RecordComponentBinding) TypeParameter(org.eclipse.jdt.internal.compiler.ast.TypeParameter) ArrayList(java.util.ArrayList) TypeReference(org.eclipse.jdt.internal.compiler.ast.TypeReference) AnnotationContext(org.eclipse.jdt.internal.compiler.codegen.AnnotationContext) TypeDeclaration(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration)

Example 4 with AnnotationContext

use of org.eclipse.jdt.internal.compiler.codegen.AnnotationContext in project bazel-jdt-java-toolchain by salesforce.

the class ClassFile method completeMethodInfo.

/**
 * INTERNAL USE-ONLY
 * Complete the creation of a method info by setting up the number of attributes at the right offset.
 *
 * @param methodAttributeOffset <CODE>int</CODE>
 * @param attributesNumber <CODE>int</CODE>
 */
public void completeMethodInfo(MethodBinding binding, int methodAttributeOffset, int attributesNumber) {
    if ((this.produceAttributes & ClassFileConstants.ATTR_TYPE_ANNOTATION) != 0) {
        List<AnnotationContext> allTypeAnnotationContexts = new ArrayList<>();
        AbstractMethodDeclaration methodDeclaration = binding.sourceMethod();
        if (methodDeclaration != null) {
            if ((methodDeclaration.bits & ASTNode.HasTypeAnnotations) != 0) {
                Argument[] arguments = methodDeclaration.arguments;
                if (arguments != null) {
                    completeArgumentAnnotationInfo(arguments, allTypeAnnotationContexts);
                }
                Receiver receiver = methodDeclaration.receiver;
                if (receiver != null && (receiver.type.bits & ASTNode.HasTypeAnnotations) != 0) {
                    receiver.type.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RECEIVER, allTypeAnnotationContexts);
                }
            }
            Annotation[] annotations = methodDeclaration.annotations;
            if (annotations != null && !methodDeclaration.isClinit() && (methodDeclaration.isConstructor() || binding.returnType.id != T_void)) {
                methodDeclaration.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RETURN, allTypeAnnotationContexts);
            }
            if (!methodDeclaration.isConstructor() && !methodDeclaration.isClinit() && binding.returnType.id != T_void) {
                MethodDeclaration declaration = (MethodDeclaration) methodDeclaration;
                TypeReference typeReference = declaration.returnType;
                if ((typeReference.bits & ASTNode.HasTypeAnnotations) != 0) {
                    typeReference.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RETURN, allTypeAnnotationContexts);
                }
            }
            TypeReference[] thrownExceptions = methodDeclaration.thrownExceptions;
            if (thrownExceptions != null) {
                for (int i = 0, max = thrownExceptions.length; i < max; i++) {
                    TypeReference thrownException = thrownExceptions[i];
                    thrownException.getAllAnnotationContexts(AnnotationTargetTypeConstants.THROWS, i, allTypeAnnotationContexts);
                }
            }
            TypeParameter[] typeParameters = methodDeclaration.typeParameters();
            if (typeParameters != null) {
                for (int i = 0, max = typeParameters.length; i < max; i++) {
                    TypeParameter typeParameter = typeParameters[i];
                    if ((typeParameter.bits & ASTNode.HasTypeAnnotations) != 0) {
                        typeParameter.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER, i, allTypeAnnotationContexts);
                    }
                }
            }
        } else if (binding.sourceLambda() != null) {
            // SyntheticMethodBinding, purpose : LambdaMethod.
            LambdaExpression lambda = binding.sourceLambda();
            if ((lambda.bits & ASTNode.HasTypeAnnotations) != 0) {
                if (lambda.arguments != null)
                    completeArgumentAnnotationInfo(lambda.arguments, allTypeAnnotationContexts);
            }
        }
        int size = allTypeAnnotationContexts.size();
        attributesNumber = completeRuntimeTypeAnnotations(attributesNumber, null, (node) -> size > 0, () -> allTypeAnnotationContexts);
    }
    if ((this.produceAttributes & ClassFileConstants.ATTR_METHOD_PARAMETERS) != 0 || binding.isConstructor() && binding.declaringClass.isRecord()) {
        attributesNumber += generateMethodParameters(binding);
    }
    // update the number of attributes
    this.contents[methodAttributeOffset++] = (byte) (attributesNumber >> 8);
    this.contents[methodAttributeOffset] = (byte) attributesNumber;
}
Also used : TypeAnnotationCodeStream(org.eclipse.jdt.internal.compiler.codegen.TypeAnnotationCodeStream) Arrays(java.util.Arrays) QualifiedNameReference(org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference) OpensStatement(org.eclipse.jdt.internal.compiler.ast.OpensStatement) ClassLiteralAccess(org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess) Receiver(org.eclipse.jdt.internal.compiler.ast.Receiver) LocalVariableBinding(org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding) ProblemSeverities(org.eclipse.jdt.internal.compiler.problem.ProblemSeverities) FieldBinding(org.eclipse.jdt.internal.compiler.lookup.FieldBinding) ModuleBinding(org.eclipse.jdt.internal.compiler.lookup.ModuleBinding) AnnotationMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) MethodScope(org.eclipse.jdt.internal.compiler.lookup.MethodScope) PolymorphicMethodBinding(org.eclipse.jdt.internal.compiler.lookup.PolymorphicMethodBinding) MemberValuePair(org.eclipse.jdt.internal.compiler.ast.MemberValuePair) ShouldNotImplement(org.eclipse.jdt.internal.compiler.problem.ShouldNotImplement) Expression(org.eclipse.jdt.internal.compiler.ast.Expression) TagBits(org.eclipse.jdt.internal.compiler.lookup.TagBits) Map(java.util.Map) TypeBinding(org.eclipse.jdt.internal.compiler.lookup.TypeBinding) VerificationTypeInfo(org.eclipse.jdt.internal.compiler.codegen.VerificationTypeInfo) FieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration) Messages(org.eclipse.jdt.internal.compiler.util.Messages) MethodBinding(org.eclipse.jdt.internal.compiler.lookup.MethodBinding) Argument(org.eclipse.jdt.internal.compiler.ast.Argument) Predicate(java.util.function.Predicate) ProblemReasons(org.eclipse.jdt.internal.compiler.lookup.ProblemReasons) CategorizedProblem(org.eclipse.jdt.core.compiler.CategorizedProblem) SyntheticMethodBinding(org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding) Set(java.util.Set) RecordComponent(org.eclipse.jdt.internal.compiler.ast.RecordComponent) TypeReference(org.eclipse.jdt.internal.compiler.ast.TypeReference) Collectors(java.util.stream.Collectors) CaseStatement(org.eclipse.jdt.internal.compiler.ast.CaseStatement) SingleMemberAnnotation(org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation) NormalAnnotation(org.eclipse.jdt.internal.compiler.ast.NormalAnnotation) TypeParameter(org.eclipse.jdt.internal.compiler.ast.TypeParameter) ArrayBinding(org.eclipse.jdt.internal.compiler.lookup.ArrayBinding) List(java.util.List) Constant(org.eclipse.jdt.internal.compiler.impl.Constant) TypeIds(org.eclipse.jdt.internal.compiler.lookup.TypeIds) Util(org.eclipse.jdt.internal.compiler.util.Util) SingleNameReference(org.eclipse.jdt.internal.compiler.ast.SingleNameReference) Annotation(org.eclipse.jdt.internal.compiler.ast.Annotation) IProblem(org.eclipse.jdt.core.compiler.IProblem) TypeDeclaration(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) CompilerOptions(org.eclipse.jdt.internal.compiler.impl.CompilerOptions) AnnotationContext(org.eclipse.jdt.internal.compiler.codegen.AnnotationContext) CompilationUnitDeclaration(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration) ClassFileConstants(org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants) AnnotationTargetTypeConstants(org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants) StringLiteral(org.eclipse.jdt.internal.compiler.ast.StringLiteral) SourceTypeBinding(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding) LambdaExpression(org.eclipse.jdt.internal.compiler.ast.LambdaExpression) HashMap(java.util.HashMap) ASTNode(org.eclipse.jdt.internal.compiler.ast.ASTNode) RequiresStatement(org.eclipse.jdt.internal.compiler.ast.RequiresStatement) Opcodes(org.eclipse.jdt.internal.compiler.codegen.Opcodes) AbortType(org.eclipse.jdt.internal.compiler.problem.AbortType) SyntheticArgumentBinding(org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) StackMapFrame(org.eclipse.jdt.internal.compiler.codegen.StackMapFrame) Binding(org.eclipse.jdt.internal.compiler.lookup.Binding) ExceptionLabel(org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel) FunctionalExpression(org.eclipse.jdt.internal.compiler.ast.FunctionalExpression) ReferenceExpression(org.eclipse.jdt.internal.compiler.ast.ReferenceExpression) AttributeNamesConstants(org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants) MethodDeclaration(org.eclipse.jdt.internal.compiler.ast.MethodDeclaration) SwitchStatement(org.eclipse.jdt.internal.compiler.ast.SwitchStatement) ExceptionMarker(org.eclipse.jdt.internal.compiler.codegen.StackMapFrameCodeStream.ExceptionMarker) LookupEnvironment(org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment) TypeVariableBinding(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) Scope(org.eclipse.jdt.internal.compiler.lookup.Scope) Iterator(java.util.Iterator) ArrayInitializer(org.eclipse.jdt.internal.compiler.ast.ArrayInitializer) ReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) ModuleDeclaration(org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration) CodeStream(org.eclipse.jdt.internal.compiler.codegen.CodeStream) LocalTypeBinding(org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding) ProblemReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding) LocalDeclaration(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) CharOperation(org.eclipse.jdt.core.compiler.CharOperation) StackMapFrameCodeStream(org.eclipse.jdt.internal.compiler.codegen.StackMapFrameCodeStream) ExportsStatement(org.eclipse.jdt.internal.compiler.ast.ExportsStatement) TypeConstants(org.eclipse.jdt.internal.compiler.lookup.TypeConstants) AbortMethod(org.eclipse.jdt.internal.compiler.problem.AbortMethod) StringConstant(org.eclipse.jdt.internal.compiler.impl.StringConstant) AbstractMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration) Comparator(java.util.Comparator) Collections(java.util.Collections) ConstantPool(org.eclipse.jdt.internal.compiler.codegen.ConstantPool) RecordComponentBinding(org.eclipse.jdt.internal.compiler.lookup.RecordComponentBinding) TypeParameter(org.eclipse.jdt.internal.compiler.ast.TypeParameter) Argument(org.eclipse.jdt.internal.compiler.ast.Argument) AnnotationMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) MethodDeclaration(org.eclipse.jdt.internal.compiler.ast.MethodDeclaration) AbstractMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration) ArrayList(java.util.ArrayList) Receiver(org.eclipse.jdt.internal.compiler.ast.Receiver) AnnotationContext(org.eclipse.jdt.internal.compiler.codegen.AnnotationContext) SingleMemberAnnotation(org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation) NormalAnnotation(org.eclipse.jdt.internal.compiler.ast.NormalAnnotation) Annotation(org.eclipse.jdt.internal.compiler.ast.Annotation) TypeReference(org.eclipse.jdt.internal.compiler.ast.TypeReference) AbstractMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration) LambdaExpression(org.eclipse.jdt.internal.compiler.ast.LambdaExpression)

Example 5 with AnnotationContext

use of org.eclipse.jdt.internal.compiler.codegen.AnnotationContext in project bazel-jdt-java-toolchain by salesforce.

the class ClassFile method generateMethodInfoAttributes.

/**
 * INTERNAL USE-ONLY
 * That method generates the attributes of a code attribute.
 * They could be:
 * - an exception attribute for each try/catch found inside the method
 * - a deprecated attribute
 * - a synthetic attribute for synthetic access methods
 *
 * It returns the number of attributes created for the code attribute.
 *
 * @param methodBinding org.eclipse.jdt.internal.compiler.lookup.MethodBinding
 * @return <CODE>int</CODE>
 */
public int generateMethodInfoAttributes(MethodBinding methodBinding) {
    // leave two bytes for the attribute_number
    this.contentsOffset += 2;
    if (this.contentsOffset + 2 >= this.contents.length) {
        resizeContents(2);
    }
    // now we can handle all the attribute for that method info:
    // it could be:
    // - a CodeAttribute
    // - a ExceptionAttribute
    // - a DeprecatedAttribute
    // - a SyntheticAttribute
    // Exception attribute
    ReferenceBinding[] thrownsExceptions;
    int attributesNumber = 0;
    if ((thrownsExceptions = methodBinding.thrownExceptions) != Binding.NO_EXCEPTIONS) {
        // The method has a throw clause. So we need to add an exception attribute
        // check that there is enough space to write all the bytes for the exception attribute
        attributesNumber += generateExceptionsAttribute(thrownsExceptions);
    }
    if (methodBinding.isDeprecated()) {
        // Deprecated attribute
        attributesNumber += generateDeprecatedAttribute();
    }
    if (this.targetJDK < ClassFileConstants.JDK1_5) {
        if (methodBinding.isSynthetic()) {
            attributesNumber += generateSyntheticAttribute();
        }
        if (methodBinding.isVarargs()) {
            attributesNumber += generateVarargsAttribute();
        }
    }
    // add signature attribute
    char[] genericSignature = methodBinding.genericSignature();
    if (genericSignature != null) {
        attributesNumber += generateSignatureAttribute(genericSignature);
    }
    if (this.targetJDK >= ClassFileConstants.JDK1_4) {
        AbstractMethodDeclaration methodDeclaration = methodBinding.sourceMethod();
        if (methodBinding instanceof SyntheticMethodBinding) {
            SyntheticMethodBinding syntheticMethod = (SyntheticMethodBinding) methodBinding;
            if (syntheticMethod.purpose == SyntheticMethodBinding.SuperMethodAccess && CharOperation.equals(syntheticMethod.selector, syntheticMethod.targetMethod.selector))
                methodDeclaration = ((SyntheticMethodBinding) methodBinding).targetMethod.sourceMethod();
            if (syntheticMethod.recordComponentBinding != null) {
                assert methodDeclaration == null;
                long rcMask = TagBits.AnnotationForMethod | TagBits.AnnotationForTypeUse;
                // record component (field) accessor method
                ReferenceBinding declaringClass = methodBinding.declaringClass;
                RecordComponent comp = getRecordComponent(declaringClass, methodBinding.selector);
                if (comp != null) {
                    Annotation[] annotations = ASTNode.getRelevantAnnotations(comp.annotations, rcMask, null);
                    if (annotations != null) {
                        assert !methodBinding.isConstructor();
                        attributesNumber += generateRuntimeAnnotations(annotations, TagBits.AnnotationForMethod);
                    }
                    if ((this.produceAttributes & ClassFileConstants.ATTR_TYPE_ANNOTATION) != 0) {
                        List<AnnotationContext> allTypeAnnotationContexts = new ArrayList<>();
                        if (annotations != null && (comp.bits & ASTNode.HasTypeAnnotations) != 0) {
                            comp.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RETURN, allTypeAnnotationContexts);
                        }
                        TypeReference compType = comp.type;
                        if (compType != null && ((compType.bits & ASTNode.HasTypeAnnotations) != 0)) {
                            compType.getAllAnnotationContexts(AnnotationTargetTypeConstants.METHOD_RETURN, allTypeAnnotationContexts);
                        }
                        int size = allTypeAnnotationContexts.size();
                        attributesNumber = completeRuntimeTypeAnnotations(attributesNumber, null, (node) -> size > 0, () -> allTypeAnnotationContexts);
                    }
                }
            }
        }
        if (methodDeclaration != null) {
            Annotation[] annotations = methodDeclaration.annotations;
            if (annotations != null) {
                attributesNumber += generateRuntimeAnnotations(annotations, methodBinding.isConstructor() ? TagBits.AnnotationForConstructor : TagBits.AnnotationForMethod);
            }
            if ((methodBinding.tagBits & TagBits.HasParameterAnnotations) != 0) {
                Argument[] arguments = methodDeclaration.arguments;
                if (arguments != null) {
                    propagateRecordComponentArguments(methodDeclaration);
                    attributesNumber += generateRuntimeAnnotationsForParameters(arguments);
                }
            }
        } else {
            LambdaExpression lambda = methodBinding.sourceLambda();
            if (lambda != null) {
                if ((methodBinding.tagBits & TagBits.HasParameterAnnotations) != 0) {
                    Argument[] arguments = lambda.arguments();
                    if (arguments != null) {
                        int parameterCount = methodBinding.parameters.length;
                        int argumentCount = arguments.length;
                        if (parameterCount > argumentCount) {
                            // synthetics prefixed
                            int redShift = parameterCount - argumentCount;
                            System.arraycopy(arguments, 0, arguments = new Argument[parameterCount], redShift, argumentCount);
                            for (int i = 0; i < redShift; i++) arguments[i] = new Argument(CharOperation.NO_CHAR, 0, null, 0);
                        }
                        attributesNumber += generateRuntimeAnnotationsForParameters(arguments);
                    }
                }
            }
        }
    }
    if ((methodBinding.tagBits & TagBits.HasMissingType) != 0) {
        this.missingTypes = methodBinding.collectMissingTypes(this.missingTypes);
    }
    return attributesNumber;
}
Also used : TypeAnnotationCodeStream(org.eclipse.jdt.internal.compiler.codegen.TypeAnnotationCodeStream) Arrays(java.util.Arrays) QualifiedNameReference(org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference) OpensStatement(org.eclipse.jdt.internal.compiler.ast.OpensStatement) ClassLiteralAccess(org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess) Receiver(org.eclipse.jdt.internal.compiler.ast.Receiver) LocalVariableBinding(org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding) ProblemSeverities(org.eclipse.jdt.internal.compiler.problem.ProblemSeverities) FieldBinding(org.eclipse.jdt.internal.compiler.lookup.FieldBinding) ModuleBinding(org.eclipse.jdt.internal.compiler.lookup.ModuleBinding) AnnotationMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) MethodScope(org.eclipse.jdt.internal.compiler.lookup.MethodScope) PolymorphicMethodBinding(org.eclipse.jdt.internal.compiler.lookup.PolymorphicMethodBinding) MemberValuePair(org.eclipse.jdt.internal.compiler.ast.MemberValuePair) ShouldNotImplement(org.eclipse.jdt.internal.compiler.problem.ShouldNotImplement) Expression(org.eclipse.jdt.internal.compiler.ast.Expression) TagBits(org.eclipse.jdt.internal.compiler.lookup.TagBits) Map(java.util.Map) TypeBinding(org.eclipse.jdt.internal.compiler.lookup.TypeBinding) VerificationTypeInfo(org.eclipse.jdt.internal.compiler.codegen.VerificationTypeInfo) FieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration) Messages(org.eclipse.jdt.internal.compiler.util.Messages) MethodBinding(org.eclipse.jdt.internal.compiler.lookup.MethodBinding) Argument(org.eclipse.jdt.internal.compiler.ast.Argument) Predicate(java.util.function.Predicate) ProblemReasons(org.eclipse.jdt.internal.compiler.lookup.ProblemReasons) CategorizedProblem(org.eclipse.jdt.core.compiler.CategorizedProblem) SyntheticMethodBinding(org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding) Set(java.util.Set) RecordComponent(org.eclipse.jdt.internal.compiler.ast.RecordComponent) TypeReference(org.eclipse.jdt.internal.compiler.ast.TypeReference) Collectors(java.util.stream.Collectors) CaseStatement(org.eclipse.jdt.internal.compiler.ast.CaseStatement) SingleMemberAnnotation(org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation) NormalAnnotation(org.eclipse.jdt.internal.compiler.ast.NormalAnnotation) TypeParameter(org.eclipse.jdt.internal.compiler.ast.TypeParameter) ArrayBinding(org.eclipse.jdt.internal.compiler.lookup.ArrayBinding) List(java.util.List) Constant(org.eclipse.jdt.internal.compiler.impl.Constant) TypeIds(org.eclipse.jdt.internal.compiler.lookup.TypeIds) Util(org.eclipse.jdt.internal.compiler.util.Util) SingleNameReference(org.eclipse.jdt.internal.compiler.ast.SingleNameReference) Annotation(org.eclipse.jdt.internal.compiler.ast.Annotation) IProblem(org.eclipse.jdt.core.compiler.IProblem) TypeDeclaration(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) CompilerOptions(org.eclipse.jdt.internal.compiler.impl.CompilerOptions) AnnotationContext(org.eclipse.jdt.internal.compiler.codegen.AnnotationContext) CompilationUnitDeclaration(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration) ClassFileConstants(org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants) AnnotationTargetTypeConstants(org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants) StringLiteral(org.eclipse.jdt.internal.compiler.ast.StringLiteral) SourceTypeBinding(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding) LambdaExpression(org.eclipse.jdt.internal.compiler.ast.LambdaExpression) HashMap(java.util.HashMap) ASTNode(org.eclipse.jdt.internal.compiler.ast.ASTNode) RequiresStatement(org.eclipse.jdt.internal.compiler.ast.RequiresStatement) Opcodes(org.eclipse.jdt.internal.compiler.codegen.Opcodes) AbortType(org.eclipse.jdt.internal.compiler.problem.AbortType) SyntheticArgumentBinding(org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) StackMapFrame(org.eclipse.jdt.internal.compiler.codegen.StackMapFrame) Binding(org.eclipse.jdt.internal.compiler.lookup.Binding) ExceptionLabel(org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel) FunctionalExpression(org.eclipse.jdt.internal.compiler.ast.FunctionalExpression) ReferenceExpression(org.eclipse.jdt.internal.compiler.ast.ReferenceExpression) AttributeNamesConstants(org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants) MethodDeclaration(org.eclipse.jdt.internal.compiler.ast.MethodDeclaration) SwitchStatement(org.eclipse.jdt.internal.compiler.ast.SwitchStatement) ExceptionMarker(org.eclipse.jdt.internal.compiler.codegen.StackMapFrameCodeStream.ExceptionMarker) LookupEnvironment(org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment) TypeVariableBinding(org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding) Scope(org.eclipse.jdt.internal.compiler.lookup.Scope) Iterator(java.util.Iterator) ArrayInitializer(org.eclipse.jdt.internal.compiler.ast.ArrayInitializer) ReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) ModuleDeclaration(org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration) CodeStream(org.eclipse.jdt.internal.compiler.codegen.CodeStream) LocalTypeBinding(org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding) ProblemReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding) LocalDeclaration(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) CharOperation(org.eclipse.jdt.core.compiler.CharOperation) StackMapFrameCodeStream(org.eclipse.jdt.internal.compiler.codegen.StackMapFrameCodeStream) ExportsStatement(org.eclipse.jdt.internal.compiler.ast.ExportsStatement) TypeConstants(org.eclipse.jdt.internal.compiler.lookup.TypeConstants) AbortMethod(org.eclipse.jdt.internal.compiler.problem.AbortMethod) StringConstant(org.eclipse.jdt.internal.compiler.impl.StringConstant) AbstractMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration) Comparator(java.util.Comparator) Collections(java.util.Collections) ConstantPool(org.eclipse.jdt.internal.compiler.codegen.ConstantPool) RecordComponentBinding(org.eclipse.jdt.internal.compiler.lookup.RecordComponentBinding) Argument(org.eclipse.jdt.internal.compiler.ast.Argument) ArrayList(java.util.ArrayList) ReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) ProblemReferenceBinding(org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding) AnnotationContext(org.eclipse.jdt.internal.compiler.codegen.AnnotationContext) SingleMemberAnnotation(org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation) NormalAnnotation(org.eclipse.jdt.internal.compiler.ast.NormalAnnotation) Annotation(org.eclipse.jdt.internal.compiler.ast.Annotation) RecordComponent(org.eclipse.jdt.internal.compiler.ast.RecordComponent) SyntheticMethodBinding(org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding) TypeReference(org.eclipse.jdt.internal.compiler.ast.TypeReference) AbstractMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration) LambdaExpression(org.eclipse.jdt.internal.compiler.ast.LambdaExpression)

Aggregations

ArrayList (java.util.ArrayList)6 Arrays (java.util.Arrays)6 Collections (java.util.Collections)6 Comparator (java.util.Comparator)6 HashMap (java.util.HashMap)6 HashSet (java.util.HashSet)6 Iterator (java.util.Iterator)6 List (java.util.List)6 Map (java.util.Map)6 Set (java.util.Set)6 Predicate (java.util.function.Predicate)6 Supplier (java.util.function.Supplier)6 Collectors (java.util.stream.Collectors)6 CategorizedProblem (org.eclipse.jdt.core.compiler.CategorizedProblem)6 CharOperation (org.eclipse.jdt.core.compiler.CharOperation)6 IProblem (org.eclipse.jdt.core.compiler.IProblem)6 ASTNode (org.eclipse.jdt.internal.compiler.ast.ASTNode)6 AbstractMethodDeclaration (org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration)6 Annotation (org.eclipse.jdt.internal.compiler.ast.Annotation)6 AnnotationMethodDeclaration (org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration)6