diff --git a/src/org/ntlab/deltaExtractor/DeltaExtractor.java b/src/org/ntlab/deltaExtractor/DeltaExtractor.java index 36291dd..794b9a4 100644 --- a/src/org/ntlab/deltaExtractor/DeltaExtractor.java +++ b/src/org/ntlab/deltaExtractor/DeltaExtractor.java @@ -336,6 +336,15 @@ } else { aliasCollector.addAlias(new DeltaAlias(Alias.AliasType.RECEIVER, 0, objList.get(retIndex), tracePoint.duplicate(), false)); } + } else if (objList.get(retIndex) == null) { + // static �Ăяo���������ꍇ + removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜�� + isTrackingThis = true; // �Ăяo�����T���O�ɕ��� + if (isSrcSide) { + aliasCollector.addAlias(new DeltaAlias(Alias.AliasType.THIS, 0, thisObjectId, tracePoint.duplicate(), true)); + } else { + aliasCollector.addAlias(new DeltaAlias(Alias.AliasType.THIS, 0, thisObjectId, tracePoint.duplicate(), false)); + } } if (isLost) { checkList.add(objList.get(retIndex)); diff --git a/src/org/ntlab/deltaExtractor/DeltaExtractorJSON.java b/src/org/ntlab/deltaExtractor/DeltaExtractorJSON.java index 4332284..6837abf 100644 --- a/src/org/ntlab/deltaExtractor/DeltaExtractorJSON.java +++ b/src/org/ntlab/deltaExtractor/DeltaExtractorJSON.java @@ -247,6 +247,11 @@ isTrackingThis = true; // �Ăяo�����T���O�ɕ��� } aliasCollector.addAlias(new Alias(Alias.AliasType.RECEIVER, 0, objList.get(retIndex), tracePoint.duplicate())); + } else if (objList.get(retIndex) == null) { + // static �Ăяo���������ꍇ + removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜�� + isTrackingThis = true; // �Ăяo�����T���O�ɕ��� + aliasCollector.addAlias(new Alias(Alias.AliasType.THIS, 0, thisObjectId, tracePoint.duplicate())); } if (isLost) { checkList.add(objList.get(retIndex)); diff --git a/src/org/ntlab/deltaViewer/CollaborationLayout.java b/src/org/ntlab/deltaViewer/CollaborationLayout.java index 76674f9..30f331b 100644 --- a/src/org/ntlab/deltaViewer/CollaborationLayout.java +++ b/src/org/ntlab/deltaViewer/CollaborationLayout.java @@ -115,18 +115,6 @@ String srcClassName = methodExec.getThisClassName(); String dstClassName = methodExec.getReturnValue().getActualType(); idx = references.indexOf(new Reference(srcObjId, dstObjId, srcClassName, dstClassName)); - } else if (methodExec.isStatic() && methodExec.getCallerMethodExecution().isStatic()) { - // For calls from a static method to another static method. - String dstClassName = methodExec.getThisClassName(); - String srcClassName = methodExec.getCallerMethodExecution().getThisClassName(); - String dstObjId = methodExec.getThisObjId() + ":" + dstClassName; - String srcObjId = methodExec.getCallerMethodExecution().getThisObjId() + ":" + srcClassName; - Reference r = new Reference(srcObjId, dstObjId, srcClassName, dstClassName); - idx = references.indexOf(r); - if (idx < 0) { - references.add(r); - idx = references.indexOf(r); - } } } else if (a.getAliasType() == AliasType.CONSTRACTOR_INVOCATION) { MethodInvocation c = (MethodInvocation) a.getOccurrencePoint().getStatement(); @@ -140,6 +128,29 @@ String srcObjId = a.getMethodExecution().getThisObjId(); String srcClassName = a.getMethodExecution().getThisClassName(); idx = references.indexOf(new Reference(srcObjId, ac.getArrayObjectId(), srcClassName, ac.getArrayClassName())); + } else if (a.getAliasType() == AliasType.THIS) { + Statement st = a.getOccurrencePoint().getStatement(); + if (st instanceof MethodInvocation) { + MethodExecution methodExec = ((MethodInvocation) st).getCalledMethodExecution(); + if (methodExec.isStatic()) { + // For calls to a static method. + String dstClassName = methodExec.getThisClassName(); + String srcClassName = methodExec.getCallerMethodExecution().getThisClassName(); + String dstObjId = methodExec.getThisObjId() + ":" + dstClassName; + String srcObjId = null; + if (!a.getMethodExecution().isStatic()) { + srcObjId = methodExec.getCallerMethodExecution().getThisObjId(); + } else { + srcObjId = methodExec.getCallerMethodExecution().getThisObjId() + ":" + srcClassName; + } + Reference r = new Reference(srcObjId, dstObjId, srcClassName, dstClassName); + idx = references.indexOf(r); + if (idx < 0) { + references.add(r); + idx = references.indexOf(r); + } + } + } } if (idx >= 0) { Reference r = references.get(idx);