projects
/
IRC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
the last piece for the inheritance checking...
[IRC.git]
/
Robust
/
src
/
Analysis
/
SSJava
/
HierarchyGraph.java
diff --git
a/Robust/src/Analysis/SSJava/HierarchyGraph.java
b/Robust/src/Analysis/SSJava/HierarchyGraph.java
index 09519c837f5ce09afe3938e6e99ecf596a725edc..e701c3ed04ce81bac51dd4a4126dba609ae22071 100644
(file)
--- a/
Robust/src/Analysis/SSJava/HierarchyGraph.java
+++ b/
Robust/src/Analysis/SSJava/HierarchyGraph.java
@@
-298,21
+298,16
@@
public class HierarchyGraph {
}
}
- public void simplifyHierarchyGraph() {
+ public void simplifyHierarchyGraph(
LocationInference infer
) {
removeRedundantEdges();
removeRedundantEdges();
- combineRedundantNodes(false);
+ combineRedundantNodes(false
, infer
);
}
}
- public void simplifySkeletonCombinationHierarchyGraph() {
- removeRedundantEdges();
- combineRedundantNodes(true);
- }
-
- public void combineRedundantNodes(boolean onlyCombinationNodes) {
+ public void combineRedundantNodes(boolean onlyCombinationNodes, LocationInference infer) {
// Combine field/parameter nodes who have the same set of incoming/outgoing edges.
boolean isUpdated = false;
do {
// Combine field/parameter nodes who have the same set of incoming/outgoing edges.
boolean isUpdated = false;
do {
- isUpdated = combineTwoRedundatnNodes(onlyCombinationNodes);
+ isUpdated = combineTwoRedundatnNodes(onlyCombinationNodes
, infer
);
} while (isUpdated);
}
} while (isUpdated);
}
@@
-330,7
+325,7
@@
public class HierarchyGraph {
return mapHNodeToOutgoingSet.get(node);
}
return mapHNodeToOutgoingSet.get(node);
}
- private boolean combineTwoRedundatnNodes(boolean onlyCombinationNodes) {
+ private boolean combineTwoRedundatnNodes(boolean onlyCombinationNodes
, LocationInference infer
) {
for (Iterator iterator = nodeSet.iterator(); iterator.hasNext();) {
HNode node1 = (HNode) iterator.next();
for (Iterator iterator = nodeSet.iterator(); iterator.hasNext();) {
HNode node1 = (HNode) iterator.next();
@@
-363,9
+358,16
@@
public class HierarchyGraph {
&& outgoingNodeSet1.equals(outgoingNodeSet2)) {
// need to merge node1 and node2
&& outgoingNodeSet1.equals(outgoingNodeSet2)) {
// need to merge node1 and node2
+ // ///////////////
+ // merge two nodes only if every hierarchy graph in the inheritance hierarchy
+ // that includes both nodes allows the merging of them...
Set<HNode> mergeSet = new HashSet<HNode>();
mergeSet.add(node1);
mergeSet.add(node2);
Set<HNode> mergeSet = new HashSet<HNode>();
mergeSet.add(node1);
mergeSet.add(node2);
+ infer.isValidMergeInheritanceCheck(desc, mergeSet);
+
+ // ///////////////
+
mergeNodes(mergeSet, onlyCombinationNodes);
return true;
}
mergeNodes(mergeSet, onlyCombinationNodes);
return true;
}