diff --git a/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/ArgStructuralEquality.java b/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/ArgStructuralEquality.java index 4f7585db03..ab6821cca0 100644 --- a/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/ArgStructuralEquality.java +++ b/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/ArgStructuralEquality.java @@ -40,24 +40,24 @@ public final class ArgStructuralEquality { private static final Map hashCodeCache = new LinkedHashMap<>(); - private ArgStructuralEquality(){ + private ArgStructuralEquality() { } public static boolean equals(final ArgNode n1, final ArgNode n2) { // if one node has a parent but the other one does not, nodes are not equal - if(n1.inEdge.isPresent() != n2.inEdge.isPresent()) { + if (n1.inEdge.isPresent() != n2.inEdge.isPresent()) { return false; } // if in edge is not same, nodes are not equal - if(n1.inEdge.isPresent() && !equals(n1.inEdge.get(), n2.inEdge.get())) { + if (n1.inEdge.isPresent() && !equals(n1.inEdge.get(), n2.inEdge.get())) { return false; } // if wrapped state is not same, nodes are not equal - if(!n1.getState().equals(n2.getState())) { + if (!n1.getState().equals(n2.getState())) { return false; } @@ -68,12 +68,12 @@ public static boolean equals(final ArgEdge e1 final ArgEdge e2) { // if source node is not same, edges are not equal - if(!equals(e1.getSource(), e2.getSource())) { + if (!equals(e1.getSource(), e2.getSource())) { return false; } // if wrapped action is not same, edges are not equal - if(!e1.getAction().equals(e2.getAction())) { + if (!e1.getAction().equals(e2.getAction())) { return false; } @@ -87,14 +87,14 @@ public static boolean equals(final ARG a1, Set> leaves2 = a2.getNodes().filter(ArgNode::isLeaf).collect(Collectors.toUnmodifiableSet()); // if the two ARGs contain a different number of leaf nodes, they are not equal - if(leaves1.size() != leaves2.size()) { + if (leaves1.size() != leaves2.size()) { return false; } leaves1loop: for (ArgNode n1 : leaves1) { for (ArgNode n2 : leaves2) { - if(equals(n1, n2)) { + if (equals(n1, n2)) { continue leaves1loop; } } @@ -112,10 +112,10 @@ public static boolean equals(final ArgTrace t public static int hashCode(final ArgNode n) { - if(!hashCodeCache.containsKey(n)) { + if (!hashCodeCache.containsKey(n)) { int hashcode = 0; - if(n.inEdge.isPresent()) { + if (n.inEdge.isPresent()) { hashcode += hashCode(n.inEdge.get()); } @@ -126,7 +126,7 @@ public static int hashCode(final ArgNode n) { } public static int hashCode(final ArgEdge e) { - if(!hashCodeCache.containsKey(e)) { + if (!hashCodeCache.containsKey(e)) { int hashcode = 0; hashcode += hashCode(e.getSource()); @@ -151,7 +151,7 @@ public static int hashCode(final ARG a) { } public static int hashCode(final ArgTrace t) { - if(!hashCodeCache.containsKey(t)) { + if (!hashCodeCache.containsKey(t)) { int hashcode = hashCode(t.node(t.length())); hashCodeCache.put(t, hashcode); }