org_aspectj_ajde_core_tests_ShowWeaveMessagesTest_java
org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment
private boolean doDeclareAnnotations(DeclareAnnotation decA, SourceTypeBinding sourceType, boolean reportProblems) {
        ReferenceType rt;
        ResolvedType rtx = this.factory.fromEclipse(sourceType);
        if (!decA.matches(rtx)) {
            return false;
        }
        if (!rtx.isExposedToWeaver()) {
            return false;
        }
        ContextToken tok = CompilationAndWeavingContext.enteringPhase(12, sourceType.sourceName);
        UnresolvedType aspectType = decA.getAspect();
        if (aspectType instanceof ReferenceType && ((rt = (ReferenceType)aspectType).isParameterizedType() || rt.isRawType())) {
            aspectType = rt.getGenericType();
        }
        TypeBinding tb = this.factory.makeTypeBinding(aspectType);
        SourceTypeBinding stb = (SourceTypeBinding)tb;
        Annotation[] toAdd = null;
        long abits = 0L;
        AbstractMethodDeclaration methodDecl = null;
        if (stb instanceof BinaryTypeBinding) {
            toAdd = this.retrieveAnnotationFromBinaryTypeBinding(decA, stb);
            if (toAdd != null && toAdd.length > 0 && toAdd[0].resolvedType != null) {
                abits = toAdd[0].resolvedType.getAnnotationTagBits();
            }
        } else if (stb != null) {
            ReferenceBinding rb;
            char[] declareSelector = decA.getAnnotationMethod().toCharArray();
            String declaringAspectName = decA.getDeclaringType().getRawName();
            for (rb = stb; rb != null && !new String(CharOperation.concatWith(rb.compoundName, '.')).equals(declaringAspectName); rb = ((ReferenceBinding)rb).superclass()) {
            }
            MethodBinding[] mbs = ((ReferenceBinding)rb).getMethods(declareSelector);
            ReferenceBinding declaringBinding = mbs[0].declaringClass;
            if (declaringBinding instanceof ParameterizedTypeBinding) {
                declaringBinding = ((ParameterizedTypeBinding)declaringBinding).type;
            }
            if (declaringBinding instanceof BinaryTypeBinding) {
                toAdd = this.retrieveAnnotationFromBinaryTypeBinding(decA, declaringBinding);
                if (toAdd != null && toAdd.length > 0 && toAdd[0].resolvedType != null) {
                    abits = toAdd[0].resolvedType.getAnnotationTagBits();
                }
            } else {
                abits = mbs[0].getAnnotationTagBits();
                TypeDeclaration typeDecl = ((SourceTypeBinding)declaringBinding).scope.referenceContext;
                methodDecl = typeDecl.declarationOf(mbs[0]);
                toAdd = methodDecl.annotations;
                toAdd[0] = AjLookupEnvironment.createAnnotationCopy(toAdd[0]);
                if (toAdd[0].resolvedType != null) {
                    abits = toAdd[0].resolvedType.getAnnotationTagBits();
                }
            }
        }
        if (toAdd == null || toAdd[0] == null || toAdd[0].type == null) {
            CompilationAndWeavingContext.leavingPhase(tok);
            return false;
        }
        if (sourceType instanceof BinaryTypeBinding) {
            ResolvedType theTargetType = this.factory.fromEclipse(sourceType);
            TypeBinding theAnnotationType = toAdd[0].resolvedType;
            if (theAnnotationType == null) {
                return false;
            }
            String sig = new String(theAnnotationType.signature());
            UnresolvedType bcelAnnotationType = UnresolvedType.forSignature(sig);
            String name = bcelAnnotationType.getName();
            if (theTargetType.hasAnnotation(bcelAnnotationType)) {
                CompilationAndWeavingContext.leavingPhase(tok);
                return false;
            }
            boolean giveupnow = false;
            if ((abits & 0x20600FF840000000L) != 0L) {
                if (this.isAnnotationTargettingSomethingOtherThanAnnotationOrNormal(abits)) {
                    giveupnow = true;
                } else if (sourceType.isAnnotationType() && (abits & 0x40000000000L) == 0L || !sourceType.isAnnotationType() && (abits & 0x1000000000L) == 0L) {
                    if (reportProblems && decA.isExactPattern()) {
                        this.factory.showMessage(IMessage.ERROR, WeaverMessages.format("incorrectTargetForDeclareAnnotation", rtx.getName(), toAdd[0].type, this.stringifyTargets(abits)), decA.getSourceLocation(), null);
                    }
                    giveupnow = true;
                }
            }
            if (giveupnow) {
                CompilationAndWeavingContext.leavingPhase(tok);
                return false;
            }
            theTargetType.addAnnotation(new BcelAnnotation((AnnotationGen)new FakeAnnotation(name, sig, (abits & 0x300000000000L) != 0L), this.factory.getWorld()));
            CompilationAndWeavingContext.leavingPhase(tok);
            return true;
        }
        Annotation[] currentAnnotations = sourceType.scope.referenceContext.annotations;
        if (currentAnnotations != null) {
            for (Annotation annotation : currentAnnotations) {
                String b;
                String a = CharOperation.toString(annotation.type.getTypeName());
                if (!a.equals(b = CharOperation.toString(toAdd[0].type.getTypeName()))) continue;
                CompilationAndWeavingContext.leavingPhase(tok);
                return false;
            }
        }
        if ((abits & 0x20600FF840000000L) != 0L) {
            if ((abits & 0x41000000000L) == 0L) {
                CompilationAndWeavingContext.leavingPhase(tok);
                return false;
            }
            if (sourceType.isAnnotationType() && (abits & 0x40000000000L) == 0L || !sourceType.isAnnotationType() && (abits & 0x1000000000L) == 0L) {
                if (reportProblems && decA.isExactPattern()) {
                    this.factory.showMessage(IMessage.ERROR, WeaverMessages.format("incorrectTargetForDeclareAnnotation", rtx.getName(), toAdd[0].type, this.stringifyTargets(abits)), decA.getSourceLocation(), null);
                }
                CompilationAndWeavingContext.leavingPhase(tok);
                return false;
            }
        }
        sourceType.scope.referenceContext.rememberAnnotations();
        Annotation[] abefore = sourceType.scope.referenceContext.annotations;
        Annotation[] newset = new Annotation[toAdd.length + (abefore == null ? 0 : abefore.length)];
        System.arraycopy(toAdd, 0, newset, 0, toAdd.length);
        if (abefore != null) {
            System.arraycopy(abefore, 0, newset, toAdd.length, abefore.length);
        }
        sourceType.scope.referenceContext.annotations = newset;
        if ((sourceType.tagBits & 0x200000000L) != 0L) {
            sourceType.tagBits -= 0x200000000L;
        }
        CompilationAndWeavingContext.leavingPhase(tok);
        if (this.factory.pushinCollector != null) {
            this.factory.pushinCollector.tagAsMunged(sourceType, new CommonPrinter(methodDecl == null ? null : methodDecl.scope).printAnnotation(toAdd[0]).toString());
        }
        return true;
    }
 -> java.lang.String.startsWith(java.lang.String): boolean -> java.lang.String.contains(java.lang.CharSequence): boolean -> java.lang.String.charAt(int): char -> java.lang.String.charAt(int): char -> java.lang.String.length(): int -> java.lang.String.indexOf(int): int -> java.util.Map.get(java.lang.Object): java.lang.Object -> java.lang.String.equals(java.lang.Object): boolean -> java.lang.ThreadLocal.get(): java.lang.Object -> java.util.Stack.push(java.lang.Object): java.lang.Object -> java.util.Map.get(java.lang.Object): java.lang.Object -> java.lang.String.hashCode(): int -> java.util.List.get(int): java.lang.Object -> java.lang.String.toCharArray(): char[] -> java.lang.String.charAt(int): char -> java.lang.String.length(): int -> java.lang.String.substring(int,int): java.lang.String -> java.lang.String.replace(char,char): java.lang.String -> java.lang.System.arraycopy(java.lang.Object,int,java.lang.Object,int,int): void -> java.lang.String.equals(java.lang.Object): boolean -> java.lang.Math.min(int,int): int -> java.lang.Math.min(int,int): int -> java.lang.Math.min(int,int): int -> java.lang.System.arraycopy(java.lang.Object,int,java.lang.Object,int,int): void -> java.lang.System.arraycopy(java.lang.Object,int,java.lang.Object,int,int): void -> java.lang.ThreadLocal.get(): java.lang.Object -> java.util.Stack.isEmpty(): boolean -> java.util.Stack.pop(): java.lang.Object
 [CALL] [CALL] [CALL] [EXIT] [CALL] [CALL] [CALL] [EXIT] [CALL] [EXIT] [EXIT] [CALL] [CALL] [EXIT] [EXIT] [CALL] [EXIT] [CALL] -> java.lang.String.startsWith(java.lang.String): boolean -> java.lang.String.contains(java.lang.CharSequence): boolean -> java.lang.String.charAt(int): char [CALL] -> java.lang.String.charAt(int): char -> java.lang.String.length(): int -> java.lang.String.indexOf(int): int [CALL] [EXIT] [EXIT] [EXIT] [EXIT] [CALL] [CALL] [CALL] [EXIT] [CALL] [EXIT] [CALL] [CALL] [EXIT] -> java.util.Map.get(java.lang.Object): java.lang.Object [EXIT] [EXIT] [EXIT] [EXIT] [CALL] [CALL] [CALL] [CALL] -> java.lang.String.equals(java.lang.Object): boolean [EXIT] [CALL] [EXIT] [CALL] [EXIT] [CALL] [EXIT] [EXIT] [EXIT] [CALL] [EXIT] [CALL] [EXIT] [CALL] [CALL] [EXIT] [EXIT] [CALL] [CALL] [EXIT] [CALL] [EXIT] [EXIT] [EXIT] [CALL] [CALL] [EXIT] [CALL] [EXIT] [EXIT] [CALL] [CALL] -> java.lang.ThreadLocal.get(): java.lang.Object [EXIT] [CALL] [CALL] [EXIT] [EXIT] [CALL] [EXIT] -> java.util.Stack.push(java.lang.Object): java.lang.Object [EXIT] [CALL] [EXIT] [CALL] [EXIT] [CALL] [EXIT] [CALL] [CALL] [EXIT] [CALL] [CALL] [EXIT] [EXIT] [CALL] [EXIT] -> java.util.Map.get(java.lang.Object): java.lang.Object [CALL] -> java.lang.String.hashCode(): int [EXIT] [EXIT] [CALL] -> java.util.List.get(int): java.lang.Object [EXIT] -> java.lang.String.toCharArray(): char[] [CALL] [EXIT] [CALL] [CALL] -> java.lang.String.charAt(int): char -> java.lang.String.length(): int -> java.lang.String.substring(int,int): java.lang.String -> java.lang.String.replace(char,char): java.lang.String [EXIT] [EXIT] [CALL] -> java.lang.System.arraycopy(java.lang.Object,int,java.lang.Object,int,int): void [EXIT] -> java.lang.String.equals(java.lang.Object): boolean [CALL] [CALL] [CALL] [EXIT] [CALL] [CALL] -> java.lang.Math.min(int,int): int [EXIT] [CALL] -> java.lang.Math.min(int,int): int [EXIT] [CALL] -> java.lang.Math.min(int,int): int [EXIT] [EXIT] -> java.lang.System.arraycopy(java.lang.Object,int,java.lang.Object,int,int): void [EXIT] [EXIT] [CALL] [CALL] [EXIT] [EXIT] [CALL] [EXIT] [CALL] [CALL] [CALL] [CALL] [CALL] [EXIT] [EXIT] [EXIT] [EXIT] [CALL] [EXIT] [EXIT] [CALL] [CALL] [EXIT] [EXIT] [CALL] [EXIT] -> java.lang.System.arraycopy(java.lang.Object,int,java.lang.Object,int,int): void [CALL] [CALL] -> java.lang.ThreadLocal.get(): java.lang.Object [EXIT] -> java.util.Stack.isEmpty(): boolean -> java.util.Stack.pop(): java.lang.Object [EXIT] [EXIT]