1 19 20 package edu.umd.cs.findbugs.ba.type; 21 22 import org.apache.bcel.generic.ObjectType; 23 24 39 public class ThrownException { 40 private ObjectType type; 41 private boolean explicit; 42 43 49 public ThrownException(ObjectType type, boolean explicit) { 50 this.type = type; 51 this.explicit = explicit; 52 } 53 54 57 public ThrownException duplicate() { 58 return new ThrownException(type, explicit); 59 } 60 61 64 public ObjectType getType() { 65 return type; 66 } 67 68 71 public boolean isExplicit() { 72 return explicit; 73 } 74 75 78 public void setExplicit(boolean explicit) { 79 this.explicit = explicit; 80 } 81 82 @Override 83 public int hashCode() { 84 return type.hashCode(); 85 } 86 87 @Override 88 public boolean equals(Object o) { 89 if (o == null) return false; 90 if (o.getClass() != this.getClass()) return false; 91 92 ThrownException other = (ThrownException) o; 93 return this.type.equals(other.type) && this.explicit == other.explicit; 94 } 95 } 96 97 | Popular Tags |