Package edu.umd.cs.findbugs.classfile.analysis

Examples of edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject


    final static ClassDescriptor ConstantAnnotation = DescriptorFactory.createClassDescriptor(StaticConstant.class);
    final static ClassDescriptor AnalysisContextContainedAnnotation = DescriptorFactory.createClassDescriptor(AnalysisContextContained.class);


    private boolean analysisContextContained(XClass xclass) {
        AnnotatedObject ao = xclass;
        do {
            if (ao.getAnnotation(AnalysisContextContainedAnnotation) != null) {
                return true;
            }
            ao = ao.getContainingScope();

        } while (ao != null);
        return false;

    }
View Full Code Here


     * @param e
     *            ElementType representing kind of AnnotatedObject
     */
    private static void getApplicableScopedApplications(Set<TypeQualifierAnnotation> result, AnnotatedObject o, ElementType e) {
        if (!o.isSynthetic()) {
            AnnotatedObject outer = o.getContainingScope();
            if (outer != null) {
                getApplicableScopedApplications(result, outer, e);
            }
        }
        getDirectApplications(result, o, e);
View Full Code Here

                }

            }
        }
        TypeQualifierAnnotation tqa = computeEffectiveTypeQualifierAnnotation(typeQualifierValue, o);
        final AnnotatedObject o2 = o;
        if (CHECK_EXCLUSIVE && tqa == null && typeQualifierValue.isExclusiveQualifier()) {
            tqa = computeExclusiveQualifier(typeQualifierValue, new ComputeEffectiveTypeQualifierAnnotation() {
                @Override
                public TypeQualifierAnnotation compute(TypeQualifierValue<?> tqv) {
                    return computeEffectiveTypeQualifierAnnotation(tqv, o2);
                }

                @Override
                public String toString() {
                    return o2.toString();
                }
            });
        }

        return tqa;
View Full Code Here

            } catch (CheckedAnalysisException e) {
                AnalysisContext.logError("Problem resolving class for " + xmethod, e);
            }
        }

        AnnotatedObject o = xmethod;
        while (true) {
            if (o == null) {
                return null;
            }

            if (stopAtMethodScope && o instanceof XClass) {
                return null;
            }
            // Check for direct type qualifier annotation
            Set<TypeQualifierAnnotation> applications = new HashSet<TypeQualifierAnnotation>();
            getDirectApplications(applications, o, ElementType.PARAMETER);
            TypeQualifierAnnotation tqa = findMatchingTypeQualifierAnnotation(applications, typeQualifierValue);
            if (tqa != null) {
                // Found matching annotation in outer scope
                assert false : "I think this code is dead; it shouldn't find anything";
            return tqa;
            }
            // Check for default annotation
            tqa = getDefaultAnnotation(o, typeQualifierValue, ElementType.PARAMETER);
            if (tqa != null) {
                if (DEBUG) {
                    System.out.println("Found default of " + tqa + " @ " + o);
                }
                return tqa;
            }
            if (stopAtClassScope && o instanceof XClass) {
                return null;
            }

            o = o.getContainingScope();

        }

    }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.