@Override public Abstraction clone() { Abstraction abs = new Abstraction(accessPath, this); abs.predecessor = this; abs.neighbors = null; abs.currentStmt = null; abs.correspondingCallSite = null; abs.propagationPathLength = propagationPathLength + 1; assert abs.equals(this); return abs; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; AbstractionAtSink other = (AbstractionAtSink) obj; if (abstraction == null) { if (other.abstraction != null) return false; } else if (!abstraction.equals(other.abstraction)) return false; if (sinkDefinition == null) { if (other.sinkDefinition != null) return false; } else if (!sinkDefinition.equals(other.sinkDefinition)) return false; if (sinkStmt == null) { if (other.sinkStmt != null) return false; } else if (!sinkStmt.equals(other.sinkStmt)) return false; return true; }
@Override public boolean equals(Abstraction abs1, Abstraction abs2) { if (abs1 == abs2) return true; if (abs1 == null || abs2 == null || abs1.getClass() != abs2.getClass()) return false; // If we have already computed hash codes, we can use them for // comparison int hashCode1 = abs1.neighborHashCode; int hashCode2 = abs2.neighborHashCode; if (hashCode1 != 0 && hashCode2 != 0 && hashCode1 != hashCode2) return false; if (abs1.accessPath == null) { if (abs2.accessPath != null) return false; } else if (!abs1.accessPath.equals(abs2.accessPath)) return false; if (abs1.predecessor == null) { if (abs2.predecessor != null) return false; } else if (!abs1.predecessor.equals(abs2.predecessor)) return false; if (abs1.currentStmt == null) { if (abs2.currentStmt != null) return false; } else if (!abs1.currentStmt.equals(abs2.currentStmt)) return false; return abs1.localEquals(abs2); }
/** * Adds the given abstraction and statement to the result map * * @param abs * The abstraction to be collected * @param stmt * The statement at which the abstraction was collected */ protected void addResult(Abstraction abs, Stmt stmt) { // Add the abstraction to the map. If we already have an equal // abstraction, we must add the current one as a neighbor. if (!this.result.put(abs, stmt)) { for (Abstraction abs2 : result.keySet()) { if (abs.equals(abs2)) { abs2.addNeighbor(abs); break; } } } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; AbstractionCacheKey other = (AbstractionCacheKey) obj; if (!abs.equals(other.abs)) return false; if (abs.getPredecessor() != other.abs.getPredecessor()) return false; if (abs.getCurrentStmt() != other.abs.getCurrentStmt()) return false; if (abs.getCorrespondingCallSite() != other.abs.getCorrespondingCallSite()) return false; return true; }
for (Abstraction abs : res) { if (!abs.equals(source)) {