diff --git a/src/org/ntlab/deltaViewer/CollaborationObjectCallGraph.java b/src/org/ntlab/deltaViewer/CollaborationObjectCallGraph.java index ff118a1..64379ee 100644 --- a/src/org/ntlab/deltaViewer/CollaborationObjectCallGraph.java +++ b/src/org/ntlab/deltaViewer/CollaborationObjectCallGraph.java @@ -175,15 +175,25 @@ String srcClassName = ref.getSrcClassName(); String srcObjId = ref.getSrcObjectId(); boolean isFirstRef = true; - for (int j = 0; j < collectionReferences.size(); j++) { - if (collectionReferences.indexOf(ref) != j) { - Reference compareRef = collectionReferences.get(j); - if (srcClassName.equals(compareRef.getDstClassName()) - && srcObjId.equals(compareRef.getDstObjectId())) { - isFirstRef = false; - break; + int idx = 0; + int cnt = 0; + // Count "$" in srcClassName and don't shrink References too much(JHotDrawTransform). + while(true) { + idx = srcClassName.indexOf("$", idx) + 1; + if (idx == 0) break; + cnt++; + } + if (cnt != 1) { + for (int j = 0; j < collectionReferences.size(); j++) { + if (collectionReferences.indexOf(ref) != j) { + Reference compareRef = collectionReferences.get(j); + if (srcClassName.equals(compareRef.getDstClassName()) + && srcObjId.equals(compareRef.getDstObjectId())) { + isFirstRef = false; + break; + } } - } + } } if (isFirstRef) { List collectionChain = new ArrayList<>();