/*
 * FindBugs - Find bugs in Java programs
 * Copyright (C) 2005, University of Maryland
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package edu.umd.cs.findbugs.filter;

import edu.umd.cs.findbugs.BugInstance;

/**
 * Matcher class to check whether or not BugInstances have
 * a particular bug pattern type.
 * 
 * @author David Hovemeyer
 */
public class BugPatternMatcher implements Matcher {
	private String bugPatternType;
	
	/**
	 * Constructor.
	 * 
	 * @param bugPatternType the type of bug pattern to check for 
	 */
	public BugPatternMatcher(String bugPatternType) {
		this.bugPatternType = bugPatternType;
	}

	public boolean match(BugInstance bugInstance) {
		return bugInstance.getType().equals(bugPatternType);
	}
}

@@ -866,16 +866,99 @@
 ilter;%0A%0A
+import java.util.HashSet;%0Aimport java.util.Set;%0Aimport java.util.StringTokenizer;%0A%0A
 import e
@@ -1055,16 +1055,23 @@
  have%0A *
+ one of
  a parti
@@ -1076,16 +1076,23 @@
 ticular 
+set of 
 bug patt
@@ -1099,16 +1099,17 @@
 ern type
+s
 .%0A * %0A *
@@ -1198,22 +1198,27 @@
 private 
+Set%3C
 String
+%3E
  bugPatt
@@ -1220,20 +1220,19 @@
 gPattern
-Type
+Set
 ;%0A%09%0A%09/**
@@ -1283,17 +1283,30 @@
 Type
- the type
+s comma-separated list
  of 
@@ -1383,16 +1383,17 @@
 ternType
+s
 ) %7B%0A%09%09th
@@ -1409,30 +1409,181 @@
 tern
-Type = bugPatternType;
+Set = new HashSet%3CString%3E();%0A%09%09StringTokenizer tok = new StringTokenizer(bugPatternTypes, %22, %5Ct%22);%0A%09%09while (tok.hasMoreTokens()) %7B%0A%09%09%09bugPatternSet.add(tok.nextToken());%0A%09%09%7D
 %0A%09%7D%0A
@@ -1648,48 +1648,49 @@
  bug
-Instance.getType().equals(bugPatternType
+PatternSet.contains(bugInstance.getType()
 );%0A%09

Allow a list of bug pattern types to be specified.