diff --git a/src/org/ntlab/deltaViewer/CollaborationViewer.java b/src/org/ntlab/deltaViewer/CollaborationViewer.java index 10fc087..4a4c64d 100644 --- a/src/org/ntlab/deltaViewer/CollaborationViewer.java +++ b/src/org/ntlab/deltaViewer/CollaborationViewer.java @@ -414,7 +414,7 @@ } for (Alias alias: aliasCollector.getAliasList()) { if (alias.getAliasType() == Alias.AliasType.THIS) { - if (!objectToVertexMap.containsKey(alias.getObjectId())) { + if (!objectToVertexMap.containsKey(alias.getObjectId()) && alias.getMethodExecution().isStatic()) { // When both of the calling and called method are static. String thisObjId = alias.getObjectId(); String thisClassName = alias.getMethodExecution().getThisClassName(); @@ -496,9 +496,9 @@ fieldName = nextAliasObjId; } } - if(statement != null && statement instanceof FieldAccess - && curAliasObjId.equals(((FieldAccess)statement).getContainerObjId())) { // Contains alias type of nextAlias is FIELD. + if (statement != null && statement instanceof FieldAccess) { FieldAccess fieldAccess = (FieldAccess)statement; + String containerId = fieldAccess.getContainerObjId(); if (fieldAccess.getFieldName() != null) { String fieldNames[] = formatFieldName(fieldAccess.getFieldName()); srcClassName = fieldNames[0]; @@ -507,6 +507,13 @@ srcClassName = fieldAccess.getContainerClassName(); fieldName = nextAliasObjId; } + if (containerId.matches("0")) { + containerId = "0:" + srcClassName; + } + if (!curAliasObjId.equals(containerId)) { // Contains alias type of nextAlias is FIELD. + srcClassName = null; + fieldName = null; + } } } System.out.println(TAG + ": srcClassName=" + srcClassName + "(curObjectId=" + curAliasObjId + ") -- fieldName=" + fieldName + " --> " + "(nextObjectId" + nextAliasObjId + ")");