@Override public boolean addNeighbor(Abstraction originalAbstraction) { // We should not register ourselves as a neighbor if (originalAbstraction == this) return false; // We should not add identical nodes as neighbors if (this.predecessor == originalAbstraction.predecessor && this.currentStmt == originalAbstraction.currentStmt && this.predecessor == originalAbstraction.predecessor) return false; synchronized (this) { if (neighbors == null) neighbors = new TCustomHashSet<Abstraction>(NeighborHashingStrategy.INSTANCE); else if (InfoflowConfiguration.getMergeNeighbors()) { // Check if we already have an identical neighbor for (Abstraction nb : neighbors) { if (nb == originalAbstraction) return false; if (originalAbstraction.predecessor == nb.predecessor && originalAbstraction.currentStmt == nb.currentStmt && originalAbstraction.correspondingCallSite == nb.correspondingCallSite) { return false; } } } return this.neighbors.add(originalAbstraction); } }
public static TCustomHashSet<Decomposition> newDecompositionSet() { return new TCustomHashSet<>(new HashWithoutScore()); }