Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.ClassAnnotation


        this.fileName = new NameMatch(fileName);
    }

    @Override
    public boolean match(BugInstance bugInstance) {
        ClassAnnotation primaryClassAnnotation = bugInstance.getPrimaryClass();
        if(primaryClassAnnotation == null){
            return false;
        }
        String bugFileName = primaryClassAnnotation.getSourceFileName();
        if(bugFileName == null || bugFileName.isEmpty()){
            return false;
        }
        boolean result = fileName.match(bugFileName);
        if (DEBUG) {
View Full Code Here


        this.className = new NameMatch(className);
    }

    @Override
    public boolean match(BugInstance bugInstance) {
        ClassAnnotation primaryClassAnnotation = bugInstance.getPrimaryClass();
        String bugClassName = primaryClassAnnotation.getClassName();
        boolean result = className.match(bugClassName);
        if (DEBUG) {
            System.out.println("Matching " + bugClassName + " with " + className + ", result = " + result);
        }
        return result;
View Full Code Here

        assertFalse(sm.match(bug));

        bug.addClass("bla", null);
        assertFalse(sm.match(bug));

        ClassAnnotation primaryClass = bug.getPrimaryClass();
        primaryClass.setSourceLines(SourceLineAnnotation.createUnknown("bla", ""));
        assertFalse(sm.match(bug));

        // set right source file
        primaryClass.setSourceLines(SourceLineAnnotation.createUnknown("bla", fileName));

        // exact match
        assertTrue(sm.match(bug));

        // regexp first part
View Full Code Here

    }

    private static void reportNoResourceFound(BugInstance bug) {
        String className = null;
        String packageName = null;
        ClassAnnotation primaryClass = bug.getPrimaryClass();
        if (primaryClass != null) {
            className = primaryClass.getClassName();
            packageName = primaryClass.getPackageName();
        }
        if (Reporter.DEBUG) {
            System.out.println("NOT found resource for a BUG in BUG in class: " //$NON-NLS-1$
                    + packageName + "." //$NON-NLS-1$
                    + className + ": \n\t" //$NON-NLS-1$
View Full Code Here

                        }
                        JavaUI.openInEditor(type, true, true);
                        return;

                    } else if (theAnnotation instanceof ClassAnnotation) {
                        ClassAnnotation fa = (ClassAnnotation) theAnnotation;
                        String className = fa.getClassName();
                        IJavaProject project = getIProject();
                        IType type = project.findType(className);
                        if (type == null) {
                            break findLocation;
                        }
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.ClassAnnotation

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.