1 2 package edu.umd.cs.findbugs; 3 4 public class MethodWarningSuppressor extends ClassWarningSuppressor { 5 6 MethodAnnotation method; 7 8 9 public MethodWarningSuppressor(String bugPattern, ClassAnnotation clazz, MethodAnnotation method) { 10 super(bugPattern, clazz); 11 this.method = method; 12 } 13 @Override 14 public boolean match(BugInstance bugInstance) { 15 16 if (!super.match(bugInstance)) return false; 17 18 MethodAnnotation bugMethod = bugInstance.getPrimaryMethod(); 19 if (bugMethod != null && 20 !method.equals(bugMethod)) return false; 21 if (DEBUG) 22 System.out.println("Suppressing " + bugInstance); 23 return true; 24 } 25 } 26 27 | Popular Tags |