diff --git a/src/org/ntlab/deltaViewer/DeltaViewer.java b/src/org/ntlab/deltaViewer/DeltaViewer.java index 75dc438..0bc014f 100644 --- a/src/org/ntlab/deltaViewer/DeltaViewer.java +++ b/src/org/ntlab/deltaViewer/DeltaViewer.java @@ -1233,7 +1233,7 @@ */ private void createMethodExecutionVertex(String objId, String methodSignature, MethodExecution methodExec) { - if (methodSignature.contains(" ")) { + if (methodSignature.matches(".+\\(.*\\)")) { System.out.println(methodSignature); methodSignature = formatMethodSignature(methodSignature, methodExec.getThisClassName()); } @@ -1671,15 +1671,23 @@ String[] thisClassNames = thisClassName.split("\\."); methodSignatures = tmpMethodSignature.split("\\."); StringBuffer sb = new StringBuffer(); - for (int i = 0; i < methodSignatures.length; i++) { - if ((thisClassNames.length > i && !methodSignatures[i].equals(thisClassNames[i])) || thisClassNames.length <= i) { - sb.append(methodSignatures[i]); - if (methodSignatures.length - i > 1) sb.append("."); - } + int i = methodSignatures.length - 2; + if (i >= 0 && !thisClassNames[thisClassNames.length - 1].equals(methodSignatures[i])) { + if (thisClassNames[thisClassNames.length - 1].equals(methodSignatures[i + 1])) i += 1; + sb.append(methodSignatures[i]); + if (methodSignatures.length - i > 1) sb.append("."); } -// sb.append(tmpMethodSignature); + for (i = i + 1; i < methodSignatures.length; i++) { + sb.append(methodSignatures[i]); + if (methodSignatures.length - i > 1) sb.append("."); + } sb.append("()"); - return sb.toString(); + + String newMethodSignature = sb.toString(); + if (!newMethodSignature.isEmpty()) { + return newMethodSignature; + } + return methodSignature; } private String formatArrayName(String srcClassName) {