if (hNode.isCombinationNode()) {
Set<HNode> combineSkeletonNodeSet =
hierarchyGraph.getCombineSetByCombinationNode(hNode);
+
aboveSet.addAll(hierarchyGraph
.getFirstNodeOfCombinationNodeChainSet(combineSkeletonNodeSet));
SCNode = scGraph.getCombinationNode(combineSkeletonNodeSet);
SCNode = aboveSet.iterator().next();
}
- numNonSharedNodes = hierarchyGraph.countNonSharedNode(hNode, aboveSet);
+ // update above set w.r.t the hierarchy graph with SC nodes
+ // because the skeleton nodes in the origianl hierarchy graph may merged to a new node
+ Set<HNode> endSet = new HashSet<HNode>();
+ for (Iterator iterator2 = aboveSet.iterator(); iterator2.hasNext();) {
+ HNode aboveNode = (HNode) iterator2.next();
+ endSet.add(scGraph.getCurrentHNode(aboveNode));
+ }
+ numNonSharedNodes = hierarchyGraph.countNonSharedNode(hNode, endSet);
- System.out.println(" node=" + hNode + " above=" + aboveSet + " distance="
+ System.out.println(" node=" + hNode + " above=" + endSet + " distance="
+ numNonSharedNodes + " SCNode=" + SCNode);
}
private String recur_getNewLocation(SSJavaLattice<String> lattice, String cur,
Set<String> endSet, int dist, boolean isShared) {
+ System.out.println("H");
Set<String> connectedSet = lattice.get(cur);
if (connectedSet == null) {
connectedSet = new HashSet<String>();
addMapDescToSimpleLattice(desc, simpleLattice);
+ if (desc instanceof ClassDescriptor) {
+ writeInferredLatticeDotFile((ClassDescriptor) desc, null, simpleLattice, "_SC");
+ } else {
+ MethodDescriptor md = (MethodDescriptor) desc;
+ writeInferredLatticeDotFile(md.getClassDesc(), md, simpleLattice, "_SC");
+ }
+
HierarchyGraph simpleHierarchyGraph = getSimpleHierarchyGraph(desc);
+
// System.out.println("\n## insertIntermediateNodesToStraightLine:"
// + simpleHierarchyGraph.getName());
SSJavaLattice<String> lattice =
}
public boolean put(T key, T value) {
-
- if(isGreaterThan(key, value)){
+
+ if (isComparable(key, value) && isGreaterThan(key, value)) {
// this relation already exists
return false;
}
-
+
Set<T> s;
Set<T> topNeighbor = table.get(top);
}
// if value is already connected with top, it is no longer to be
- if(!key.equals(top)){
- topNeighbor.remove(value);
+ if (!key.equals(top)) {
+ topNeighbor.remove(value);
}
-
// if key is already connected with bottom,, it is no longer to be
if (!value.equals(getBottomItem())) {