@@ -0,0 +1,2118 @@
+/*%0A * FindBugs - Find Bugs in Java programs%0A * Copyright (C) 2006, University of Maryland%0A * %0A * This library is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU Lesser General Public%0A * License as published by the Free Software Foundation; either%0A * version 2.1 of the License, or (at your option) any later version.%0A * %0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A * %0A * You should have received a copy of the GNU Lesser General Public%0A * License along with this library; if not, write to the Free Software%0A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA%0A */%0A%0Apackage edu.umd.cs.findbugs.gui2;%0A%0Aimport java.util.Collection;%0A%0Aimport edu.umd.cs.findbugs.BugInstance;%0Aimport edu.umd.cs.findbugs.filter.AndMatcher;%0Aimport edu.umd.cs.findbugs.filter.BugMatcher;%0Aimport edu.umd.cs.findbugs.filter.ClassMatcher;%0Aimport edu.umd.cs.findbugs.filter.Matcher;%0A%0A/**%0A * @author pugh%0A */%0Apublic class FilterFactory %7B%0A%09%0A%09public static AndMatcher makeMatcher(Collection%3CSortables%3E sortables, BugInstance bug) %7B%0A%09%09AndMatcher matcher = new AndMatcher();%0A%09%09for(Sortables s : sortables) %0A%09%09%09matcher.addChild(makeMatcher(s, bug));%0A%09%09return matcher;%0A%09%7D%0A%0A%09/**%0A     * @param s%0A     * @param bug%0A     * @return%0A     */%0A    private static Matcher makeMatcher(Sortables s, BugInstance bug) %7B%0A    %09switch(s) %7B%0A    %09case BUGCODE:%0A    %09%09return new BugMatcher(s.getFrom(bug), null, null);%0A    %09case CATEGORY:%0A    %09%09return new BugMatcher(null, null, s.getFrom(bug));%0A    %09case CLASS:%0A    %09%09return new ClassMatcher(s.getFrom(bug));%0A    %09case DESIGNATION:%0A    %09case FIRSTVERSION:%0A    %09case LASTVERSION:%0A    %09case PACKAGE:%0A    %09case PRIORITY:%0A    %09%09 throw new UnsupportedOperationException();%0A    %09case TYPE:%0A    %09%09return new BugMatcher(null, s.getFrom(bug), null);%0A    %09%09%0A    %09case DIVIDER:%0A%09%09default:%0A    %09%09throw new IllegalArgumentException();%0A%0A    %09%09%09 %0A    %09%7D%0A%09  %0A    %7D%0A%0A%7D%0A

Add filter factory