Package edu.umd.cs.findbugs.filter

Examples of edu.umd.cs.findbugs.filter.BugMatcher



    private static Matcher makeMatcher(Sortables s, BugInstance bug) {
        switch (s) {
        case BUGCODE:
            return new BugMatcher(s.getFrom(bug), null, null);
        case CATEGORY:
            return new BugMatcher(null, null, s.getFrom(bug));
        case CLASS:
            return new ClassMatcher(s.getFrom(bug));
        case DESIGNATION:
            return new DesignationMatcher(s.getFrom(bug));

        case FIRSTVERSION:
            return new FirstVersionMatcher(s.getFrom(bug), RelationalOp.EQ);
        case LASTVERSION:
            return new LastVersionMatcher(s.getFrom(bug), RelationalOp.EQ);
        case PACKAGE:
            String p = Sortables.CLASS.getFrom(bug);
            int lastDot = p.lastIndexOf('.');
            if (lastDot > 0) {
                p = p.substring(0, lastDot);
            }
            return new ClassMatcher("~" + p + "\\.[^.]+");
        case PRIORITY:
            return new PriorityMatcher(Integer.toString(bug.getPriority()));

        case TYPE:
            return new BugMatcher(null, s.getFrom(bug), null);

        case BUG_RANK:
            return new RankMatcher(s.getFrom(bug));

        case DIVIDER:
View Full Code Here


        String value = sv.value;
        switch (s) {
        case BUG_RANK:
            return new RankMatcher(value);
        case BUGCODE:
            return new BugMatcher(value, null, null);
        case CATEGORY:
            return new BugMatcher(null, null, value);
        case CLASS:
            return new ClassMatcher(value);
        case DESIGNATION:
            return new DesignationMatcher(value);

        case FIRSTVERSION:
            return new FirstVersionMatcher(value, RelationalOp.EQ);
        case LASTVERSION:
            return new LastVersionMatcher(value, RelationalOp.EQ);
        case PACKAGE:
            return new ClassMatcher("~" + value + "\\.[^.]+");
        case PRIORITY:
            return new PriorityMatcher(value);
        case PROJECT:
            throw new NotImplementedYetException("Matchers for Projects not supported yet");

        case TYPE:
            return new BugMatcher(null, value, null);

        case DIVIDER:
        default:
            throw new NotImplementedYetException("No matcher for " + s);
View Full Code Here

            System.out.println(elementStack + " " + qName + " " + matcherStack);
        }
        String disabled = getOptionalAttribute(attributes, "disabled");
        nextMatchedIsDisabled = "true".equals(disabled);
        if (qName.equals("Bug")) {
            addMatcher(new BugMatcher(getOptionalAttribute(attributes, "code"), getOptionalAttribute(attributes, "pattern"),
                    getOptionalAttribute(attributes, "category")));
        } else if (qName.equals("Class")) {
            addMatcher(new ClassMatcher(getRequiredAttribute(attributes, "name", qName)));
        } else if (qName.equals("FirstVersion")) {
            addMatcher(new FirstVersionMatcher(getRequiredAttribute(attributes, "value", qName), getRequiredAttribute(attributes,
                    "relOp", qName)));
        } else if (qName.equals("LastVersion")) {
            addMatcher(new LastVersionMatcher(getRequiredAttribute(attributes, "value", qName), getRequiredAttribute(attributes,
                    "relOp", qName)));
        } else if (qName.equals("Designation")) {
            addMatcher(new DesignationMatcher(getRequiredAttribute(attributes, "designation", qName)));
        } else if (qName.equals("BugCode")) {
            addMatcher(new BugMatcher(getRequiredAttribute(attributes, "name", qName), "", ""));
        } else if (qName.equals("Local")) {
            addMatcher(new LocalMatcher(getRequiredAttribute(attributes, "name", qName)));
        } else if (qName.equals("BugPattern")) {
            addMatcher(new BugMatcher("", getRequiredAttribute(attributes, "name", qName), ""));
        } else if (qName.equals("Priority")) {
            addMatcher(new PriorityMatcher(getRequiredAttribute(attributes, "value", qName)));
        } else if (qName.equals("Confidence")) {
            addMatcher(new ConfidenceMatcher(getRequiredAttribute(attributes, "value", qName)));
        } else if (qName.equals("Rank")) {
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.filter.BugMatcher

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.