Package edu.umd.cs.findbugs.ba

Examples of edu.umd.cs.findbugs.ba.JCIPAnnotationDatabase


        } else if (annotationClass.startsWith(JSR305_CONCURRENT_ANNOTATIONS)) {
            annotationClass = annotationClass.substring(JSR305_CONCURRENT_ANNOTATIONS.length());
        } else {
            return;
        }
        JCIPAnnotationDatabase annotationDatabase = AnalysisContext.currentAnalysisContext()
                .getJCIPAnnotationDatabase();
        ElementValue value = map.get("value");
        ClassMember member;
        if (visitingField()) {
            member = XFactory.createXField(this);
        } else if (visitingMethod()) {
            member = XFactory.createXMethod(this);
        } else {
            annotationDatabase.addEntryForClass(getDottedClassName(), annotationClass, value);
            return;
        }
        annotationDatabase.addEntryForClassMember(member, annotationClass, value);
    }
View Full Code Here


        this.bugReporter = bugReporter;
    }

    @Override
    public void visitJavaClass(JavaClass obj) {
        JCIPAnnotationDatabase jcipAnotationDatabase = AnalysisContext.currentAnalysisContext().getJCIPAnnotationDatabase();
        if (jcipAnotationDatabase.hasClassAnnotation(obj.getClassName().replace('/', '.'), "Immutable")) {
            super.visitJavaClass(obj);
        }
    }
View Full Code Here

    @Override
    public void report() {
        if(statMap.isEmpty()){
            return;
        }
        JCIPAnnotationDatabase jcipAnotationDatabase = AnalysisContext.currentAnalysisContext().getJCIPAnnotationDatabase();
        for (XField xfield : statMap.keySet()) {
            FieldStats stats = statMap.get(xfield);
            if (!stats.isInteresting()) {
                continue;
            }
            boolean notThreadSafe = jcipAnotationDatabase.hasClassAnnotation(xfield.getClassName(), "NotThreadSafe");
            if (notThreadSafe) {
                continue;
            }
            ElementValue guardedByValue = jcipAnotationDatabase.getFieldAnnotation(xfield, "GuardedBy");
            boolean guardedByThis;
            if(guardedByValue != null){
                guardedByThis = guardedByValue.stringifyValue().equals("this");
            } else {
                guardedByThis = false;
            }
            boolean threadSafe = jcipAnotationDatabase.hasClassAnnotation(xfield.getClassName(), "ThreadSafe");

            WarningPropertySet<InconsistentSyncWarningProperty> propertySet = new WarningPropertySet<InconsistentSyncWarningProperty>();

            int numReadUnlocked = stats.getNumAccesses(READ_UNLOCKED);
            int numWriteUnlocked = stats.getNumAccesses(WRITE_UNLOCKED);
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ba.JCIPAnnotationDatabase

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.