1 19 20 package edu.umd.cs.findbugs.gui2; 21 22 import java.lang.reflect.InvocationTargetException ; 23 import java.lang.reflect.Method ; 24 25 import edu.umd.cs.findbugs.BugInstance; 26 import edu.umd.cs.findbugs.gui2.BugAspects.StringPair; 27 28 29 33 34 36 public class BugLeafNode { 37 38 private BugInstance bug; 39 40 BugLeafNode(BugInstance b) 41 { 42 bug=b; 43 } 44 45 public BugInstance getBug() 46 { 47 return bug; 48 } 49 50 public String toString() 51 { 52 53 54 return bug.getMessageWithoutPrefix(); 55 } 56 57 public boolean matches(StringPair keyValuePair) { 58 78 return keyValuePair.key.getFrom(bug).equals(keyValuePair.value); 79 } 80 81 public boolean equals(Object o) 82 { 83 if (!(o instanceof BugLeafNode)) 84 return false; 85 else 86 return bug==(((BugLeafNode)o).getBug()); 87 } 88 89 90 public int hashCode() 91 { 92 return bug.hashCode(); 93 } 94 95 public boolean matches(BugAspects aspects) { 96 if(aspects.size() == 0) 97 return true; 98 for(BugAspects.StringPair strPair : aspects){ 99 if(!matches(strPair)) 100 return false; 101 } 102 103 return true; 104 } 105 } 106 107 108 | Popular Tags |