@Override public boolean equals(Object obj) { // TODO: make SetTypes of size 1 equal PointTypes. // need a factory facade for this. // TODO: canonicalize?? How to improve this? if (obj == this) { return true; } if (obj instanceof SetType) { if (hashCode() != obj.hashCode()) { return false; } else { SetType other = (SetType) obj; return (types.equals(other.types)); } } else { return false; } }
public TypeAbstraction getTypeForNewInstance(int bcIndex, IClassHierarchy cha) { if (cha == null) { throw new IllegalArgumentException("null cha"); } Set<TypeReference> S = map.get(Integer.valueOf(bcIndex)); if (S == null) { return null; } else { PointType[] p = new PointType[S.size()]; Iterator<TypeReference> it = S.iterator(); for (int i = 0; i < p.length; i++) { TypeReference T = it.next(); IClass klass = cha.lookupClass(T); assert klass != null : "null type for " + T; p[i] = new PointType(klass); } return new SetType(p); } }
public TypeAbstraction getTypeForNewInstance(int bcIndex, IClassHierarchy cha) { if (cha == null) { throw new IllegalArgumentException("null cha"); } Set<TypeReference> S = map.get(Integer.valueOf(bcIndex)); if (S == null) { return null; } else { PointType[] p = new PointType[S.size()]; Iterator<TypeReference> it = S.iterator(); for (int i = 0; i < p.length; i++) { TypeReference T = it.next(); IClass klass = cha.lookupClass(T); assert klass != null : "null type for " + T; p[i] = new PointType(klass); } return new SetType(p); } }
@Override public boolean equals(Object obj) { // TODO: make SetTypes of size 1 equal PointTypes. // need a factory facade for this. // TODO: canonicalize?? How to improve this? if (obj == this) { return true; } if (obj instanceof SetType) { if (hashCode() != obj.hashCode()) { return false; } else { SetType other = (SetType) obj; return (types.equals(other.types)); } } else { return false; } }