diff --git a/src/org/ntlab/deltaViewer/DeltaAnimation.java b/src/org/ntlab/deltaViewer/DeltaAnimation.java index b4c4fc9..a3ac999 100644 --- a/src/org/ntlab/deltaViewer/DeltaAnimation.java +++ b/src/org/ntlab/deltaViewer/DeltaAnimation.java @@ -306,6 +306,7 @@ // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); try { + System.out.println(sourceCell); curPoint.setX(sourceCell.getGeometry().getX()); curPoint.setY(sourceCell.getGeometry().getY()); sourceCell.getGeometry().setX(curPoint.getX() + updatePoint.getX()); diff --git a/src/org/ntlab/deltaViewer/DeltaViewer.java b/src/org/ntlab/deltaViewer/DeltaViewer.java index 5ef20a1..58e6ca2 100644 --- a/src/org/ntlab/deltaViewer/DeltaViewer.java +++ b/src/org/ntlab/deltaViewer/DeltaViewer.java @@ -722,7 +722,6 @@ private void moveLocalObjectVertex(MethodExecution callerMethodExec, ObjectVertex sourceVertexObject, MethodExecutionVertex targetVertexMethodExec) { mxICell sourceCell = (mxICell)sourceVertexObject.getCell(); mxICell targetCell = (mxICell) targetVertexMethodExec.getCell(); -// mxICell parentTargetMethodExecCell = targetMethodExecCell.getParent(); if (sourceCell == targetCell.getParent()) { System.out.println("nothing."); @@ -730,17 +729,6 @@ } // Remove sourceVertex from Locals and Arguments Vertex of MethodExecution's Vertex. -// MethodExecution callercallerMethodExec = callerMethodExec.getCallerMethodExecution(); -// System.out.println(callerMethodExec.getSignature()); -// if (methodExecToVertexMap.containsKey(callercallerMethodExec) && methodExecToVertexMap.get(callercallerMethodExec).getLocals().contains(sourceVertexObject)) { -// methodExecToVertexMap.get(callercallerMethodExec).getLocals().remove(sourceVertexObject); -// System.out.println(methodExecToVertexMap.get(callercallerMethodExec).getLabel() + " :removeLocal: " + sourceVertexObject.getLabel()); -// } -// -// if (methodExecToVertexMap.containsKey(callercallerMethodExec) && methodExecToVertexMap.get(callercallerMethodExec).getArguments().contains(sourceVertexObject)) { -// methodExecToVertexMap.get(callercallerMethodExec).getArguments().remove(sourceVertexObject); -// System.out.println(methodExecToVertexMap.get(callercallerMethodExec).getLabel() + " :removeArgument: " + sourceVertexObject.getLabel()); -// } if (methodExecToVertexMap.containsKey(callerMethodExec) && methodExecToVertexMap.get(callerMethodExec).getLocals().contains(sourceVertexObject)) { methodExecToVertexMap.get(callerMethodExec).getLocals().remove(sourceVertexObject); System.out.println(methodExecToVertexMap.get(callerMethodExec).getLabel() + " :removeLocal: " + sourceVertexObject.getLabel()); @@ -754,7 +742,7 @@ // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); try { - int time = targetVertexMethodExec.getLocals().size() + 1; + int time = targetVertexMethodExec.getLocals().size(); double sourceX = sourceCell.getGeometry().getX(); double sourceY = sourceCell.getGeometry().getY(); @@ -778,16 +766,24 @@ double sourceWidth = sourceCell.getGeometry().getWidth(); double sourceHeight = sourceCell.getGeometry().getHeight(); + double targetWidth = targetCell.getGeometry().getWidth(); + double targetHeight = targetCell.getGeometry().getHeight(); double overlapWidth = sourceWidth - (sourceWidth * Math.sqrt(2) * 0.1); double overlapHeight = sourceHeight - (sourceHeight * Math.sqrt(2) * 0.1); - deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - overlapWidth, targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time))); +// deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - overlapWidth, targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time))); +// deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - overlapWidth + (sourceWidth * time), targetCell.getGeometry().getY() - overlapHeight + sourceHeight)); + deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - (sourceWidth / Math.sqrt(2.5)) + (sourceWidth * time), targetCell.getGeometry().getY() + targetHeight)); deltaAnimation.startVertexAnimation(); sourceCell.setParent(targetCell.getParent()); targetCell.getParent().insert(sourceCell); - sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - overlapWidth); - sourceCell.getGeometry().setY(targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time)); +// sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - overlapWidth); +// sourceCell.getGeometry().setY(targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time)); +// sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - overlapWidth + (sourceWidth * time)); +// sourceCell.getGeometry().setY(targetCell.getGeometry().getY() - overlapHeight + sourceHeight); + sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - (sourceWidth / Math.sqrt(2.5)) + (sourceWidth * time)); + sourceCell.getGeometry().setY(targetCell.getGeometry().getY() + targetHeight); targetVertexMethodExec.getLocals().add(sourceVertexObject); System.out.println("moveLocalObjectVertex: " + targetVertexMethodExec.getLabel() + " :Local: " + sourceVertexObject.getLabel()); } finally { @@ -898,8 +894,9 @@ // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); try { - // int time = targetVertexMethodExec.getArguments().size(); - int time = targetVertexMethodExec.getLocals().size() + 1; +// int time = targetVertexMethodExec.getArguments().size(); +// int time = targetVertexMethodExec.getLocals().size() + 1; + int time = targetVertexMethodExec.getLocals().size(); double sourceX = sourceCell.getGeometry().getX(); double sourceY = sourceCell.getGeometry().getY(); @@ -921,13 +918,19 @@ double sourceWidth = sourceCell.getGeometry().getWidth(); double sourceHeight = sourceCell.getGeometry().getHeight(); + double targetWidth = targetCell.getGeometry().getWidth(); + double targetHeight = targetCell.getGeometry().getHeight(); double overlapWidth = sourceWidth - (sourceWidth * Math.sqrt(2) * 0.1); double overlapHeight = sourceHeight - (sourceHeight * Math.sqrt(2) * 0.1); - deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - overlapWidth, targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time))); +// deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - overlapWidth, targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time))); + deltaAnimation.setVertexAnimation(sourceCell, new mxPoint(targetCell.getGeometry().getX() - (sourceWidth / Math.sqrt(3)) + (sourceWidth * time), targetCell.getGeometry().getY() + targetHeight)); deltaAnimation.startVertexAnimation(); - sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - overlapWidth); - sourceCell.getGeometry().setY(targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time)); +// sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - overlapWidth); +// sourceCell.getGeometry().setY(targetCell.getGeometry().getY() - overlapHeight + (sourceHeight * time)); + sourceCell.getGeometry().setX(targetCell.getGeometry().getX() - (sourceWidth / Math.sqrt(3)) + (sourceWidth * time)); + sourceCell.getGeometry().setY(targetCell.getGeometry().getY() + targetHeight); + targetVertexMethodExec.getArguments().add(sourceVertexObject); System.out.println("moveActualArgumentObjectVertex: " + targetVertexMethodExec.getLabel() + " :Argument: " + sourceVertexObject.getLabel()); } finally { @@ -1055,7 +1058,7 @@ mxgraph.getModel().beginUpdate(); try { String objectId = alias.getObjectId(); - if (methodExec.isStatic()) { + if (methodExec.isStatic() && !objectId.equals("0")) { objectId = alias.getMethodExecution().getCallerMethodExecution().getThisObjId(); } Object object = objectToVertexMap.get(objectId).getCell(); diff --git a/src/org/ntlab/deltaViewer/DeltaViewerSample.java b/src/org/ntlab/deltaViewer/DeltaViewerSample.java index 3ed3ae3..a4f6f3c 100644 --- a/src/org/ntlab/deltaViewer/DeltaViewerSample.java +++ b/src/org/ntlab/deltaViewer/DeltaViewerSample.java @@ -32,31 +32,11 @@ * @param args */ public static void main(String[] args) { -// TraceJSON trace = new TraceJSON("traces/jEditBenchmark.trace"); -// TraceJSON trace = new TraceJSON("traces/jHotDrawBenchmark.trace"); -// TraceJSON trace = new TraceJSON("traces/ArgoUMLBenchmark.trace"); -// TraceJSON trace = new TraceJSON("traces/testTrace2.txt"); - - // one delta extract -// TraceJSON trace = new TraceJSON("traces/traceSample1.txt"); -// TraceJSON trace = new TraceJSON("traces/traceSample2.txt"); -// TraceJSON trace = new TraceJSON("traces/presenSample.txt"); -// TraceJSON trace = new TraceJSON("traces/_worstCase.txt"); -// TraceJSON trace = new TraceJSON("traces/sample1.trace"); -// TraceJSON trace = new TraceJSON("traces/sampleArray.trace"); -// TraceJSON trace = new TraceJSON("traces/sampleCollection.trace"); -// TraceJSON trace = new TraceJSON("traces/sampleCreate.trace"); -// TraceJSON trace = new TraceJSON("traces/sampleStatic.trace"); -// TraceJSON trace = new TraceJSON("traces/jHotDrawBenchmarkWithMoreStandardClasses.trace"); -// TraceJSON trace = new TraceJSON("traces/ArgoUMLBenchmarkWithMoreStandardClasses.trace"); -// TraceJSON trace = new TraceJSON("traces/testTrace3.txt"); -// TraceJSON trace = new TraceJSON("traces/testTrace5.txt"); - // DeltaExtractorJSON dex = new DeltaExtractorJSON(trace); // HashMap threads = trace.getAllThreads(); // ThreadInstance thread = threads.values().iterator().next(); // �Ō�̃X���b�h�����Ă��邾���c // TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); -// + // System.out.println("===== All Statements Backward ====="); // TracePoint tp = null; // ExtractedStructure e = null; @@ -106,16 +86,6 @@ // }); // } - // �Q�ƌ��̃I�u�W�F�N�gId -// ExtractedStructure e = dex.extract(new Reference(null, null, "E", "C"), tp, dac); -// ExtractedStructure e = dex.extract(new Reference(null, null, "D", "C"), tp, dac); -// ExtractedStructure e = dex.extract(new Reference(null, null, "worstCase.P", "worstCase.M"), tp, dac); -// ExtractedStructure e = dex.extract(new Reference(null, null, "sample1.D", "sample1.C"), tp, dac); -// ExtractedStructure e = dex.extract(new Reference(null, null, "sampleArray.D", "sampleArray.C"), tp, dac); -// ExtractedStructure e = dex.extract(new Reference(null, null, "sampleCollection.D", "sampleCollection.C"), tp, dac); -// ExtractedStructure e = dex.extract(new Reference(null, null, "sampleCreate.D", "sampleCreate.C"), tp, dac); -// ExtractedStructure e = dex.extract(new Reference(null, null, "sampleStatic.D", "sampleStatic.C"), tp, dac); - // HashSet marked = trace.getMarkedMethodSignatures(1255991806833871L, 1255991808597322L); // HashSet marked = trace.getMarkedMethodSignatures(1699553004208835L, 1699553004739523L); // System.out.println("===== Marked Methods ====="); @@ -143,730 +113,108 @@ Map argsMap = new HashMap<>(); setArgmentsForDeltaExtract(argsMap); -// String argsKey = "ArgoUMLPlace1_1"; //���o�������f���^�̈������i�[����Map��key - String argsKey = "ArgoUMLSelect0_1"; //���o�������f���^�̈������i�[����Map��key -// String argsKey = "ArgoUMLSelect1_2"; //���o�������f���^�̈������i�[����Map��key -// String argsKey = "sampleStatic"; //���o�������f���^�̈������i�[����Map��key -// String argsKey = "worstCase"; //���o�������f���^�̈������i�[����Map��key -// String argsKey = "sample1"; //���o�������f���^�̈������i�[����Map��key + //���o�������f���^�̈������i�[����Map��key +// String argsKey = "ArgoUMLPlace1_1"; + String argsKey = "ArgoUMLSelect0_1"; +// String argsKey = "ArgoUMLSelect1_2"; +// String argsKey = "sampleArray"; +// String argsKey = "sampleCollection"; +// String argsKey = "sampleCreate"; +// String argsKey = "sampleStatic"; +// String argsKey = "delta_eg1"; +// String argsKey = "delta_eg5"; +// String argsKey = "worstCase"; +// String argsKey = "sample1"; long time = System.nanoTime(); TraceJSON trace = new TraceJSON(argsMap.get(argsKey)[4]); DeltaExtractorJSON s = new DeltaExtractorJSON(trace); HashMap threads = trace.getAllThreads(); + List eList = new ArrayList<>(); List dacList = new ArrayList<>(); - for (ThreadInstance thread: threads.values()) { + if (threads.values().size() == 1) { + ThreadInstance thread = threads.values().iterator().next(); // �Ō�̃X���b�h�����Ă��邾���c TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); Reference reference = new Reference(argsMap.get(argsKey)[0], argsMap.get(argsKey)[1], argsMap.get(argsKey)[2], argsMap.get(argsKey)[3]); - reference.setCollection(true); + DeltaAliasCollector dac = new DeltaAliasCollector(); + ExtractedStructure e = s.extract(reference, tp, dac); + eList.add(e); + dacList.add(dac); + } else { + for (ThreadInstance thread: threads.values()) { + TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); + Reference reference = new Reference(argsMap.get(argsKey)[0], argsMap.get(argsKey)[1], argsMap.get(argsKey)[2], argsMap.get(argsKey)[3]); + reference.setCollection(true); // reference.setArray(true); // reference.setFinalLocal(true); // reference.setCreation(true); - DeltaAliasCollector dac = new DeltaAliasCollector(); - ExtractedStructure e = s.extract(reference, tp, dac); - if (e != null) { - eList.add(e); - dacList.add(dac); - System.out.println("add" + eList.size() + ", " + dacList.size()); + DeltaAliasCollector dac = new DeltaAliasCollector(); + ExtractedStructure e = s.extract(reference, tp, dac); + System.out.println(e); + if (e != null) { + eList.add(e); + dacList.add(dac); + System.out.println("add" + eList.size() + ", " + dacList.size()); + } + System.out.println("---------------------------"); } - System.out.println("---------------------------"); } -// TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); -// //ExtractedStructure e = s.extract(new Reference(null, null, "sampleCollection.D", "sampleCollection.C"), tp, new IAliasCollector() { -// String ArgmentsKey = "jEditSelect"; //���o�������f���^�̈������i�[����Map��key -// ExtractedStructure e = s.extract(new Reference(argsMap.get(ArgmentsKey)[0], argsMap.get(ArgmentsKey)[1], argsMap.get(ArgmentsKey)[2], argsMap.get(ArgmentsKey)[3]), tp, new IAliasCollector() { -// @Override -// public void addAlias(Alias alias) { -// System.out.println(alias.getAliasType().toString() + ":" + alias.getObjectId() +"," + alias.getIndex() + "," + alias.getMethodSignature() + "," + alias.getLineNo()); -// } -// @Override -// public void changeTrackingObject(String from, String to) { -// System.out.println("Change:" + from + "�@=>�@" + to); -// } -// }); - -// TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); -// ExtractedStructure e = s.extract(new Reference(argsMap.get(argsKey)[0], argsMap.get(argsKey)[1], argsMap.get(argsKey)[2], argsMap.get(argsKey)[3]), tp, new IAliasCollector() { -// //ExtractedStructure e = s.extract(new Reference(candId1, candId2, argsMap.get(ArgmentsKey)[2], argsMap.get(ArgmentsKey)[3]), tp, new IAliasCollector() { -// @Override -// public void addAlias(Alias alias) { -// System.out.println(alias.getAliasType().toString() + ":" + alias.getObjectId() +"," + alias.getIndex() + "," + alias.getMethodSignature() + "," + alias.getLineNo()); -// } -// @Override -// public void changeTrackingObject(String from, String to) { -// System.out.println("Change:" + from + "�@=>�@" + to); -// } -// }); - -// TraceJSON trace = new TraceJSON("traces\\_finalLocal.txt"); -// DeltaExtractorJSON s = new DeltaExtractorJSON(trace); -// HashMap threads = trace.getAllThreads(); -// ThreadInstance thread = threads.values().iterator().next(); -// TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); -// ExtractedStructure e = s.extract(new Reference(null, null, "finalLocal.Main$1Test", "finalLocal.Main$A"), tp); - -// TraceJSON trace = new TraceJSON("traces\\__arraySample.txt"); -// DeltaExtractorJSON s = new DeltaExtractorJSON(trace); -// HashMap threads = trace.getAllThreads(); -// for (ThreadInstance thread: threads.values()) { -// TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); -// ExtractedStructure e = s.extract(new Reference(null, null, "arraySample.D", "arraySample.C"), tp); -// s.extract(e.getDelta().getSrcSide().get(2), e.getCoordinator().getEntryPoint()); -// break; -// } - -// TraceJSON trace = new TraceJSON("traces\\__arraySample.txt"); -// DeltaExtractorJSON s = new DeltaExtractorJSON(trace); -// HashMap threads = trace.getAllThreads(); -// ThreadInstance thread = threads.values().iterator().next(); -// TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); -// Reference ref = new Reference(null, null, "[Ljava.lang.Object;", "arraySample.B"); -// ref.setArray(true); -// ExtractedStructure e = s.extract(ref, tp); - -// TraceJSON trace = new TraceJSON("traces\\_threadSample.txt"); -// DeltaExtractor s = new DeltaExtractorJSON(trace); -// HashMap threads = trace.getAllThreads(); -// Iterator it = threads.values().iterator(); -// it.next(); -// it.next(); -// ThreadInstance thread = it.next(); -// TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); -// ExtractedStructure e = s.extract(new Reference(null, null, "threadSample.D", "threadSample.C"), tp); - -// DeltaExtractor s = new DeltaExtractor("documents\\finalLocal.txt"); -// ExtractedStructure es = s.extract(); -// s.extract("framework.RWT.RWTFrame3D", -// "fight3D.CharacterSelectContainer"); -// s.extract("framework.B", "application.SubC"); -// s.extract("application.SubA", "framework.B"); -// FrameworkUsage usage = extractor.extract("framework.B", -// "application.SubC"); -// FrameworkUsage usage = extractor.extract("application.SubA", -// "framework.B"); -// s.extract("framework.model3D.Object3D", -// "javax.media.j3d.TransformGroup"); -// s.extract("fight3D.Character", "fight3D.WeaponModel"); -// s.extract("test.E","test.C"); -// ExtractedStructure e = s.extract(new Reference("finalLocal.Main$1Test", "finalLocal.Main$A", null, null)); - - // --------------- Eclipse Core --------------- -// DeltaExtractor s = new DeltaExtractor("documents\\eclipse-Core.txt"); -// CallTree m = null; -// ExtractedStructure e = null; -// do { -// if (m == null) { -// m = s.getCallTreeBackwardly("public boolean java.util.HashSet.add("); -// } else { -// m = s.getCallTreeBackwardly("public boolean java.util.HashSet.add(", m.getStartLine() - 1); -// } -// if (m != null) { -// ArrayList argments = m.getArguments(); -// System.out.println(m.getSignature() + ":" + argments.size()); -// for (int i = 0; i < argments.size(); i++) { -// if (argments.get(i).getActualType().equals("org.eclipse.ui.internal.registry.ActionSetDescriptor")) { -// e = s.extract(m, argments.get(i)); -// break; -// } -// } -// } -// } while (m != null); - - - // --------------- Eclipse UI --------------- -// DeltaExtractor s = new DeltaExtractor("documents\\eclipse-ContextMenu.txt"); -// CallTree m = null; -// ExtractedStructure e = null; -// do { -// if (m == null) { -// m = s.getCallTreeBackwardly("private void org.eclipse.jface.action.ContributionManager.addToGroup("); -// } else { -// m = s.getCallTreeBackwardly("private void org.eclipse.jface.action.ContributionManager.addToGroup(", m.getStartLine() - 1); -// } -// if (m != null) { -// ArrayList argments = m.getArguments(); -// System.out.println(m.getSignature() + ":" + argments.size()); -// for (int i = 0; i < argments.size(); i++) { -// if (argments.get(i).getActualType().equals("org.eclipse.ui.internal.PluginActionCoolBarContributionItem")) { -// e = s.extract(m, argments.get(i)); -// break; -// } -// } -// } -// } while (m != null); - - /////////////////////////////////////////////////////////////////////////////////// - // // - // ICSME2015���e�p // - // // - /////////////////////////////////////////////////////////////////////////////////// - - // --------------- Eclipse (2014/12/6 �v���O�����������؎��� �ۑ�1, �ȉ���1��ڂ̃f���^) --------------- -// DeltaExtractor s = new DeltaExtractor("documents\\eclipse-Console2.txt"); -// ExtractedStructure e = null; -// do { -// System.out.println(System.nanoTime() - time); -// if (e == null) { -// e = s.extract(new Reference(null, null, "org.eclipse.jface.action.ActionContributionItem", -// "org.eclipse.ui.console.actions.ClearOutputAction")); -// } else { -// e = s.extract(new Reference(null, null, "org.eclipse.jface.action.ActionContributionItem", -// "org.eclipse.ui.console.actions.ClearOutputAction"), e.getCreationCallTree().getEntryPoint()); -// } -// } while (e != null); - - - // --------------- Eclipse (2014/12/19-20 �v���O�����������؎��� �ۑ�2, �ȉ���2��ڂ̃f���^) --------------- -// DeltaExtractor s = new DeltaExtractor("documents\\eclipse-JavaEditor.txt"); -// ExtractedStructure e = null; -// do { -// System.out.println(System.nanoTime() - time); -// if (e == null) { -// e = s.extract(new Reference(null, null, "org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer", -// "org.eclipse.jface.text.contentassist.ContentAssistant")); -// } else { -// e = s.extract(new Reference(null, null, "org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer", -// "org.eclipse.jface.text.contentassist.ContentAssistant"), e.getCreationCallTree().getEntryPoint()); -// } -// } while (e != null); - - - // --------------- ArgoUML (2014/12/19-20 �v���O�����������؎��� �ۑ�3, �ȉ���1��ڂ̃f���^) --------------- -// DeltaExtractor s = new DeltaExtractor("documents\\ArgoUML-3.txt"); -// MethodExecution m = null; -// ExtractedStructure e = null; -// do { -// System.out.println(System.nanoTime() - time); -// if (m == null) { -// m = s.getLastMethodExecution("protected void org.tigris.gef.base.SelectionManager.addFig("); -// } else { -// m = s.getLastMethodExecution("protected void org.tigris.gef.base.SelectionManager.addFig(", m.getEntryPoint()); -// } -// if (m != null) { -// ArrayList argments = m.getArguments(); -// System.out.println(m.getSignature() + ":" + argments.size()); -// for (int i = 0; i < argments.size(); i++) { -// if (argments.get(i).getActualType().equals("org.argouml.uml.diagram.static_structure.ui.FigClass")) { -// e = s.extract(m.getEntryPoint(), argments.get(i)); -// break; -// } -// } -// } -// } while (m != null); - - - // --------------- ArgoUML (2014/12/19-20 �v���O�����������؎��� �ۑ�4, �ȉ���3��ڂ̃f���^) --------------- -// DeltaExtractor s = new DeltaExtractor("documents\\ArgoUML-3.txt"); -// MethodExecution m = null; -// ExtractedStructure e = null; -// do { -// System.out.println(System.nanoTime() - time); -// if (m == null) { -// m = s.getLastMethodExecution("public abstract interface boolean java.util.List.add("); -// } else { -// m = s.getLastMethodExecution("public abstract interface boolean java.util.List.add(", m.getEntryPoint()); -// } -// if (m != null) { -// ArrayList argments = m.getArguments(); -// System.out.println(m.getSignature() + ":" + argments.size()); -// for (int i = 0; i < argments.size(); i++) { -// if (argments.get(i).getActualType().equals("org.argouml.uml.diagram.static_structure.ui.FigClass")) { -// e = s.extract(m.getEntryPoint(), argments.get(i)); -// break; -// } -// } -// } -// } while (m != null); - - /////////////////////////////////////////////////////////////////////////////////// - // // - // SANER2016���e�p // - // // - /////////////////////////////////////////////////////////////////////////////////// - - // --------------- Eclipse SWT (2015/10/31 �A�[�L�e�N�`���������؎��� �ۑ�1) --------------- - // ��1(1st�f���^), �ȉ��̃f���^ -// DeltaExtractor s = new DeltaExtractor("documents\\eclipse-Console2.txt"); -// MethodExecution m = null; -// ExtractedStructure e = null; -// System.out.println(System.nanoTime() - time); -// do { -// if (m == null) { -// m = s.getLastMethodExecution("public void org.eclipse.jface.action.Action.runWithEvent("); -// } else { -// TracePoint nextTp = m.getEntryPoint(); -// nextTp.stepBackOver(); -// m = s.getLastMethodExecution("public void org.eclipse.jface.action.Action.runWithEvent(", nextTp); -// } -// if (m != null) { -// ArrayList argments = m.getArguments(); -// for (int i = 0; i < argments.size(); i++) { -// if (argments.get(i).getActualType().equals("org.eclipse.swt.widgets.Event")) { -// System.out.println(System.nanoTime() - time); -// e = s.extract(m.getEntryPoint(), argments.get(i)); -// break; -// } -// } -// } -// } while (e == null); -// System.out.println(System.nanoTime() - time); -// System.out.println("//////////////////////////////////"); - - // ��2,3(2nd�f���^), ��1�̑���, �ȉ��̃f���^ -// Reference nextTarget = e.getDelta().getSrcSide().get(6); -// e = s.extract(nextTarget, e.getCoordinator().getEntryPoint()); - - - // --------------- Eclipse JDT (2015/10/31 �A�[�L�e�N�`���������؎��� �ۑ�2) --------------- - // ��1,2(1st�f���^), �ȉ��̃f���^(���o�Ƃ��Ă�2��) -// DeltaExtractor s = new DeltaExtractor("documents\\eclipse-Debug1.txt"); -// MethodExecution m = null; -// -// System.out.println(System.nanoTime() - time); -// ExtractedStructure e = null; -// do { -// if (m == null) { -// m = s.getLastMethodExecution("public boolean org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.handleBreakpointEvent("); -// } else { -// TracePoint nextTp = m.getEntryPoint(); -// nextTp.stepBackOver(); -// m = s.getLastMethodExecution("public boolean org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.handleBreakpointEvent(", nextTp); -// } -// if (m != null) { -// ArrayList argments = m.getArguments(); -// for (int i = 0; i < argments.size(); i++) { -// if (argments.get(i).getActualType().equals("org.eclipse.jdi.internal.event.BreakpointEventImpl")) { -// System.out.println(System.nanoTime() - time); -// e = s.extract(m.getEntryPoint(), argments.get(i)); -// break; -// } -// } -// } -// } while (e == null); -// Reference nextTarget = e.getDelta().getDstSide().get(3); // EventDispatcher$1 -> EventSetImpl -// e = s.extract(nextTarget, m.getEntryPoint()); -// System.out.println(System.nanoTime() - time); -// System.out.println("//////////////////////////////////"); -// -// // ��3(2nd�f���^), �ȉ��̃f���^ -// MethodExecution m2 = e.getCoordinator().getChildren().get(21); -// e = s.extract(m2.getExitPoint(), new ObjectReference("859038530", "org.eclipse.jdi.internal.jdwp.JdwpCommandPacket")); -// System.out.println(System.nanoTime() - time); -// System.out.println("//////////////////////////////////"); -// -// -// // ��4(3rd�f���^), �ȉ��̃f���^ -// m = e.getCoordinator().getChildren().get(0).getChildren().get(1).getChildren().get(4); -// Reference lastTarget = new Reference(e.getDelta().getDstSide().get(1).getSrcObject(), e.getDelta().getDstSide().get(0).getDstObject()); -// lastTarget.setCollection(true); -// e = s.extract(lastTarget, m.getExitPoint()); - - - // --------------- ArgoUML + GEF (2014/12/19-20 �v���O�����������؎��� �ۑ�3, �ȉ��̃f���^) --------------- -// DeltaExtractor s = new DeltaExtractor("documents\\ArgoUML-3.txt"); -// MethodExecution m = null; -// ExtractedStructure e = null; -// System.out.println(System.nanoTime() - time); -// m = s.getLastMethodExecution("public void org.argouml.uml.diagram.ui.ActionRemoveFromDiagram.actionPerformed("); -// m = s.getLastMethodExecution("public java.util.Vector org.tigris.gef.base.SelectionManager.getFigs("); -// if (m != null) { -// System.out.println(System.nanoTime() - time); -// Reference r = new Reference(null, null, "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass"); -// r.setCollection(true); -// e = s.extract(r, m.getEntryPoint()); -// } - - -// System.out.println(System.nanoTime() - time); -// System.out.println("//////////////////////////////////"); -// // s.extractArg(e.getCoodinator(), 123456789); -// // s.getCallHistory(e.getCoodinator()); startDeltaViewer(eList.get(0), dacList.get(0)); } - /* - * ���������� - * -===== Marked Methods ===== -void worstCase.O.passL(worstCase.L) -worstCase.L worstCase.I.getL() -worstCase.L worstCase.K.getL() -worstCase.M worstCase.L.getM() -worstCase.K worstCase.J.getK() -void worstCase.N.passI(worstCase.I) -void worstCase.P.setM(worstCase.M) -===== Unmarked Methods ===== -worstCase.F worstCase.C.getF() -worstCase.E worstCase.D.getE() -worstCase.A() -public worstCase.M() -worstCase.F() -void worstCase.A.m() -public static void worstCase.main.main(java.lang.String[]) -worstCase.G() -worstCase.H() -worstCase.I() -worstCase.B() -worstCase.C() -worstCase.D() -worstCase.E() -worstCase.N() -worstCase.O() -worstCase.P() -worstCase.F worstCase.E.getF() -worstCase.J() -worstCase.K() -worstCase.L() -worstCase.I worstCase.F.getI() -worstCase.H worstCase.G.getH() -worstCase.I worstCase.H.getI() -worstCase.I worstCase.B.getI() - */ -// HashSet all = trace.getAllMethodSignatures(); -// System.out.println("===== All Methods ====="); -// for (String method: all) { -// System.out.println(method); -// } - /* - * ���������� - * -===== All Methods ===== -worstCase.F worstCase.C.getF() -worstCase.E worstCase.D.getE() -worstCase.A() -void worstCase.P.setM(worstCase.M) -public worstCase.M() -worstCase.M worstCase.L.getM() -worstCase.L worstCase.I.getL() -worstCase.L worstCase.K.getL() -void worstCase.N.passI(worstCase.I) -void worstCase.A.m() -worstCase.F() -public static void worstCase.main.main(java.lang.String[]) -worstCase.G() -void worstCase.O.passL(worstCase.L) -worstCase.H() -worstCase.I() -worstCase.B() -worstCase.C() -worstCase.D() -worstCase.E() -worstCase.N() -worstCase.O() -worstCase.K worstCase.J.getK() -worstCase.F worstCase.E.getF() -worstCase.P() -worstCase.J() -worstCase.K() -worstCase.I worstCase.F.getI() -worstCase.I worstCase.H.getI() -worstCase.H worstCase.G.getH() -worstCase.L() -worstCase.I worstCase.B.getI() - */ - -// ArrayList specified = trace.getMethodExecutions("void"); -// System.out.println("===== Specified Methods ====="); -// for (MethodExecution method: specified) { -// System.out.println(method.getSignature()); -// } - /* - * ���������� - * -===== Specified Methods ===== -void worstCase.A.m() -void worstCase.N.passI(worstCase.I) -void worstCase.O.passL(worstCase.L) -void worstCase.P.setM(worstCase.M) * - */ -// HashMap> allExecutions = trace.getAllMethodExecutions(); -// System.out.println("===== All Methods and Executions ====="); -// for (String method: allExecutions.keySet()) { -// System.out.println(method + ":" + allExecutions.get(method).size()); -// } - /* - * ���������� - * -===== All Methods and Executions ===== -worstCase.F worstCase.C.getF():1 -worstCase.E worstCase.D.getE():1 -worstCase.A():1 -void worstCase.P.setM(worstCase.M):1 -public worstCase.M():1 -worstCase.M worstCase.L.getM():1 -worstCase.L worstCase.I.getL():1 -worstCase.L worstCase.K.getL():1 -void worstCase.N.passI(worstCase.I):1 -void worstCase.A.m():1 -worstCase.F():1 -public static void worstCase.main.main(java.lang.String[]):1 -worstCase.G():1 -void worstCase.O.passL(worstCase.L):1 -worstCase.H():1 -worstCase.I():1 -worstCase.B():1 -worstCase.C():1 -worstCase.D():1 -worstCase.E():1 -worstCase.N():1 -worstCase.O():1 -worstCase.K worstCase.J.getK():1 -worstCase.F worstCase.E.getF():1 -worstCase.P():1 -worstCase.J():1 -worstCase.K():1 -worstCase.I worstCase.F.getI():1 -worstCase.I worstCase.H.getI():1 -worstCase.H worstCase.G.getH():1 -worstCase.L():1 -worstCase.I worstCase.B.getI():1 - */ -// System.out.println("===== All Statements Forward ====="); -// trace.traverseStatementsInTrace(new IStatementVisitor() { -// @Override -// public boolean preVisitStatement(Statement statement) { -// if (statement instanceof FieldUpdate) { -// if(trace.isNull((((FieldUpdate) statement).getValueObjId()))) { -// -// } -// } -// System.out.println("pre:" + statement.getClass().getName() + ":" + statement.getTimeStamp()); -// return false; -// } -// @Override -// public boolean postVisitStatement(Statement statement) { -// System.out.println("post:" + statement.getClass().getName() + ":" + statement.getTimeStamp()); -// return false; -// } -// }); - /* - * ���������� - * -===== All Statements Forward ===== -pre:org.ntlab.trace.BlockEnter:1699552992988213 -post:org.ntlab.trace.BlockEnter:1699552992988213 -pre:org.ntlab.trace.MethodInvocation:1699552993730471 -pre:org.ntlab.trace.MethodInvocation:1699552994339441 -pre:org.ntlab.trace.MethodInvocation:1699552994979793 -pre:org.ntlab.trace.MethodInvocation:1699552995575363 -pre:org.ntlab.trace.MethodInvocation:1699552996163881 -pre:org.ntlab.trace.MethodInvocation:1699552996774613 -pre:org.ntlab.trace.MethodInvocation:1699552997363836 -pre:org.ntlab.trace.MethodInvocation:1699552997949532 -pre:org.ntlab.trace.MethodInvocation:1699552998548628 -pre:org.ntlab.trace.MethodInvocation:1699552999050402 -pre:org.ntlab.trace.MethodInvocation:1699552999466490 -pre:org.ntlab.trace.MethodInvocation:1699552999875526 -pre:org.ntlab.trace.MethodInvocation:1699553000173135 -post:org.ntlab.trace.MethodInvocation:1699553000173135 -pre:org.ntlab.trace.FieldUpdate:1699553000225322 -post:org.ntlab.trace.FieldUpdate:1699553000225322 -post:org.ntlab.trace.MethodInvocation:1699552999875526 -pre:org.ntlab.trace.FieldUpdate:1699553000259878 -post:org.ntlab.trace.FieldUpdate:1699553000259878 -post:org.ntlab.trace.MethodInvocation:1699552999466490 -pre:org.ntlab.trace.FieldUpdate:1699553000290908 -post:org.ntlab.trace.FieldUpdate:1699553000290908 -post:org.ntlab.trace.MethodInvocation:1699552999050402 -pre:org.ntlab.trace.FieldUpdate:1699553000331107 -post:org.ntlab.trace.FieldUpdate:1699553000331107 -post:org.ntlab.trace.MethodInvocation:1699552998548628 -pre:org.ntlab.trace.FieldUpdate:1699553000376947 -post:org.ntlab.trace.FieldUpdate:1699553000376947 -post:org.ntlab.trace.MethodInvocation:1699552997949532 -pre:org.ntlab.trace.FieldUpdate:1699553000422435 -post:org.ntlab.trace.FieldUpdate:1699553000422435 -post:org.ntlab.trace.MethodInvocation:1699552997363836 -pre:org.ntlab.trace.FieldUpdate:1699553000463691 -post:org.ntlab.trace.FieldUpdate:1699553000463691 -post:org.ntlab.trace.MethodInvocation:1699552996774613 -pre:org.ntlab.trace.FieldUpdate:1699553000508121 -post:org.ntlab.trace.FieldUpdate:1699553000508121 -post:org.ntlab.trace.MethodInvocation:1699552996163881 -pre:org.ntlab.trace.FieldUpdate:1699553000551845 -post:org.ntlab.trace.FieldUpdate:1699553000551845 -post:org.ntlab.trace.MethodInvocation:1699552995575363 -pre:org.ntlab.trace.FieldUpdate:1699553000596627 -post:org.ntlab.trace.FieldUpdate:1699553000596627 -post:org.ntlab.trace.MethodInvocation:1699552994979793 -pre:org.ntlab.trace.FieldUpdate:1699553000640352 -post:org.ntlab.trace.FieldUpdate:1699553000640352 -post:org.ntlab.trace.MethodInvocation:1699552994339441 -pre:org.ntlab.trace.FieldUpdate:1699553000682666 -post:org.ntlab.trace.FieldUpdate:1699553000682666 -pre:org.ntlab.trace.MethodInvocation:1699553001472175 -pre:org.ntlab.trace.MethodInvocation:1699553002201034 -pre:org.ntlab.trace.MethodInvocation:1699553003026510 -post:org.ntlab.trace.MethodInvocation:1699553003026510 -pre:org.ntlab.trace.FieldUpdate:1699553003101618 -post:org.ntlab.trace.FieldUpdate:1699553003101618 -post:org.ntlab.trace.MethodInvocation:1699553002201034 -pre:org.ntlab.trace.FieldUpdate:1699553003149926 -post:org.ntlab.trace.FieldUpdate:1699553003149926 -post:org.ntlab.trace.MethodInvocation:1699553001472175 -pre:org.ntlab.trace.FieldUpdate:1699553003190477 -post:org.ntlab.trace.FieldUpdate:1699553003190477 -post:org.ntlab.trace.MethodInvocation:1699552993730471 -pre:org.ntlab.trace.MethodInvocation:1699553003253243 -pre:org.ntlab.trace.BlockEnter:1699553003273695 -post:org.ntlab.trace.BlockEnter:1699553003273695 -pre:org.ntlab.trace.FieldAccess:1699553003299083 -post:org.ntlab.trace.FieldAccess:1699553003299083 -pre:org.ntlab.trace.FieldAccess:1699553003355502 -post:org.ntlab.trace.FieldAccess:1699553003355502 -pre:org.ntlab.trace.MethodInvocation:1699553003386885 -pre:org.ntlab.trace.BlockEnter:1699553003400637 -post:org.ntlab.trace.BlockEnter:1699553003400637 -pre:org.ntlab.trace.FieldAccess:1699553003436956 -post:org.ntlab.trace.FieldAccess:1699553003436956 -pre:org.ntlab.trace.MethodInvocation:1699553003482444 -pre:org.ntlab.trace.BlockEnter:1699553003500427 -post:org.ntlab.trace.BlockEnter:1699553003500427 -pre:org.ntlab.trace.FieldAccess:1699553003526169 -post:org.ntlab.trace.FieldAccess:1699553003526169 -pre:org.ntlab.trace.MethodInvocation:1699553003556141 -pre:org.ntlab.trace.BlockEnter:1699553003570951 -post:org.ntlab.trace.BlockEnter:1699553003570951 -pre:org.ntlab.trace.FieldAccess:1699553003599513 -post:org.ntlab.trace.FieldAccess:1699553003599513 -post:org.ntlab.trace.MethodInvocation:1699553003556141 -pre:org.ntlab.trace.MethodInvocation:1699553003668273 -pre:org.ntlab.trace.BlockEnter:1699553003688020 -post:org.ntlab.trace.BlockEnter:1699553003688020 -pre:org.ntlab.trace.FieldAccess:1699553003715876 -post:org.ntlab.trace.FieldAccess:1699553003715876 -post:org.ntlab.trace.MethodInvocation:1699553003668273 -post:org.ntlab.trace.MethodInvocation:1699553003482444 -pre:org.ntlab.trace.MethodInvocation:1699553003805088 -pre:org.ntlab.trace.BlockEnter:1699553003818135 -post:org.ntlab.trace.BlockEnter:1699553003818135 -pre:org.ntlab.trace.FieldAccess:1699553003846345 -post:org.ntlab.trace.FieldAccess:1699553003846345 -pre:org.ntlab.trace.MethodInvocation:1699553003896769 -pre:org.ntlab.trace.BlockEnter:1699553003912989 -post:org.ntlab.trace.BlockEnter:1699553003912989 -pre:org.ntlab.trace.FieldAccess:1699553003944020 -post:org.ntlab.trace.FieldAccess:1699553003944020 -post:org.ntlab.trace.MethodInvocation:1699553003896769 -pre:org.ntlab.trace.MethodInvocation:1699553004012075 -pre:org.ntlab.trace.BlockEnter:1699553004029706 -post:org.ntlab.trace.BlockEnter:1699553004029706 -pre:org.ntlab.trace.FieldAccess:1699553004082951 -post:org.ntlab.trace.FieldAccess:1699553004082951 -post:org.ntlab.trace.MethodInvocation:1699553004012075 -post:org.ntlab.trace.MethodInvocation:1699553003805088 -post:org.ntlab.trace.MethodInvocation:1699553003386885 -pre:org.ntlab.trace.MethodInvocation:1699553004208835 -pre:org.ntlab.trace.BlockEnter:1699553004228229 -post:org.ntlab.trace.BlockEnter:1699553004228229 -pre:org.ntlab.trace.FieldAccess:1699553004257849 -post:org.ntlab.trace.FieldAccess:1699553004257849 -pre:org.ntlab.trace.MethodInvocation:1699553004302631 -pre:org.ntlab.trace.BlockEnter:1699553004326962 -post:org.ntlab.trace.BlockEnter:1699553004326962 -pre:org.ntlab.trace.FieldAccess:1699553004373507 -post:org.ntlab.trace.FieldAccess:1699553004373507 -pre:org.ntlab.trace.MethodInvocation:1699553004418995 -pre:org.ntlab.trace.BlockEnter:1699553004434510 -post:org.ntlab.trace.BlockEnter:1699553004434510 -pre:org.ntlab.trace.FieldAccess:1699553004461661 -post:org.ntlab.trace.FieldAccess:1699553004461661 -post:org.ntlab.trace.MethodInvocation:1699553004418995 -pre:org.ntlab.trace.MethodInvocation:1699553004515964 -pre:org.ntlab.trace.BlockEnter:1699553004526543 -post:org.ntlab.trace.BlockEnter:1699553004526543 -pre:org.ntlab.trace.FieldAccess:1699553004546994 -post:org.ntlab.trace.FieldAccess:1699553004546994 -post:org.ntlab.trace.MethodInvocation:1699553004515964 -post:org.ntlab.trace.MethodInvocation:1699553004302631 -pre:org.ntlab.trace.MethodInvocation:1699553004606587 -pre:org.ntlab.trace.BlockEnter:1699553004615402 -post:org.ntlab.trace.BlockEnter:1699553004615402 -pre:org.ntlab.trace.FieldAccess:1699553004629507 -post:org.ntlab.trace.FieldAccess:1699553004629507 -pre:org.ntlab.trace.MethodInvocation:1699553004648195 -pre:org.ntlab.trace.BlockEnter:1699553004655953 -post:org.ntlab.trace.BlockEnter:1699553004655953 -pre:org.ntlab.trace.FieldAccess:1699553004670763 -post:org.ntlab.trace.FieldAccess:1699553004670763 -post:org.ntlab.trace.MethodInvocation:1699553004648195 -pre:org.ntlab.trace.MethodInvocation:1699553004703556 -pre:org.ntlab.trace.BlockEnter:1699553004712019 -post:org.ntlab.trace.BlockEnter:1699553004712019 -pre:org.ntlab.trace.FieldUpdate:1699553004728240 -post:org.ntlab.trace.FieldUpdate:1699553004728240 -post:org.ntlab.trace.MethodInvocation:1699553004703556 -post:org.ntlab.trace.MethodInvocation:1699553004606587 -post:org.ntlab.trace.MethodInvocation:1699553004208835 -post:org.ntlab.trace.MethodInvocation:1699553003253243 - */ - - // Change! -// System.out.println("===== All Statements Backward ====="); -// TracePoint tp = null; -// DeltaAliasCollector dac = new DeltaAliasCollector(); -// long restart = 0L; -// for(;;) { -// tp = trace.traverseStatementsInTraceBackward(new IStatementVisitor() { -// @Override -// public boolean preVisitStatement(Statement statement) { -// System.out.println("pre:" + statement.getThreadNo() + ":" + statement.getTimeStamp()); -// if(statement instanceof FieldUpdate) { -// FieldUpdate fu = (FieldUpdate) statement; -// if(!Trace.isNull(fu.getValueObjId()) && !Trace.isPrimitive(fu.getValueClassName())) { -// return true; -// } -// } -// return false; -// } -// -// @Override -// public boolean postVisitStatement(Statement statement) { -// System.out.println("post:" + statement.getThreadNo() + ":" + statement.getTimeStamp()); -// return false; -// } -// }, restart); -// if(tp == null || !tp.isValid()) break; -// dex.extract(tp, dac); -// Statement statement = tp.getStatement(); -// if(statement instanceof MethodInvocation) { -// restart = ((MethodInvocation)tp.getStatement()).getCalledMethodExecution().getExitTime(); -// } else { -// restart = tp.getStatement().getTimeStamp(); -// } -// } - -// trace.traverseStatementsInTraceBackward(new IStatementVisitor() { -// @Override -// public boolean preVisitStatement(Statement statement) { -// System.out.println("post:" + statement.getClass().getName() + ":" + statement.getTimeStamp()); -// return false; -// } -// @Override -// public boolean postVisitStatement(Statement statement) { -// System.out.println("pre:" + statement.getClass().getName() + ":" + statement.getTimeStamp()); -// return false; -// } -// }); - private static void startDeltaViewer(ExtractedStructure e, DeltaAliasCollector dac) { - // TODO Auto-generated method stub DeltaViewer dv = new DeltaViewer(e, dac); List aliasList = new ArrayList<>(dac.getAliasList()); -// DeltaViewer dv = new DeltaViewer(e, dac); -// List aliasList = new ArrayList<>(dac.getAliasList()); + // dv.setCoordinatorPoint(1200, 100); dv.init(); -// dv.update(); // for(int i = 0; i < aliasList.size(); i++) { // System.out.println(aliasList.get(i).getObjectId() + ", " + aliasList.get(i).getMethodSignature() + " l." + aliasList.get(i).getLineNo() + " : " + aliasList.get(i).getAliasType().toString()); // } for(int i = 0; i <= aliasList.size(); i++) { dv.stepToAnimation(i); -// dv.update(); } } + + private static void setArgmentsForDeltaExtract(Map map){ + + // one delta extract + String[] traceSample1 = {null, null, "","", "traces/traceSample1.txt"}; map.put("traceSample1", traceSample1); + String[] traceSample2 = {null, null, "","", "traces/traceSample2.txt"}; map.put("traceSample2", traceSample2); + String[] presenSample = {null, null, "","", "traces/presenSample.txt"}; map.put("presenSample", presenSample); + String[] worstCase = {null, null, "worstCase.P", "worstCase.M", "traces/_worstCase.txt"}; map.put("worstCase", worstCase); + String[] sample1 = {null, null, "sample1.D", "sample1.C", "traces\\sample1.trace"}; map.put("sample1", sample1); + String[] sampleArray = {null, null, "sampleArray.D", "sampleArray.C", "traces\\sampleArray.trace"}; map.put("sampleArray", sampleArray); + String[] sampleCollection = {null, null, "sampleCollection.D", "sampleCollection.C", "traces\\sampleCollection.trace"}; map.put("sampleCollection", sampleCollection); + String[] sampleCreate = {null, null, "sampleCreate.D", "sampleCreate.C", "traces\\sampleCreate.trace"}; map.put("sampleCreate", sampleCreate); + String[] sampleStatic = {null, null, "sampleStatic.D", "sampleStatic.C", "traces\\sampleStatic.trace"}; map.put("sampleStatic", sampleStatic); + String[] delta_eg1 = {null, null, "E","C", "traces/testTrace.txt"}; map.put("delta_eg1", delta_eg1); + String[] delta_eg5 = {null, null, "E","C", "traces/testTrace5.txt"}; map.put("delta_eg5", delta_eg5); + String[] testTrace2 = {null, null, "","", "traces/testTrace2.txt"}; map.put("testTrace2", testTrace2); + String[] testTrace3 = {null, null, "","", "traces/testTrace3.txt"}; map.put("testTrace3", testTrace3); + + String[] test = {null, null, "org.argouml.uml.diagram.static_structure.ui.FigClass","org.tigris.gef.base.LayerPerspectiveMutable", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("test", test); + String[] testVectorAddElement = {null, null, "java.util.Vector", "org.tigris.gef.base.LayerPerspective", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("testVectorAddElement", testVectorAddElement);//trace.java��"addElement("�ɑΉ�����悤�ɒlj� + String[] ArgoUMLBenchmark = {"", "", "", "", "traces/ArgoUMLBenchmark.trace"}; map.put("ArgoUMLBenchmark", ArgoUMLBenchmark); + String[] ArgoUMLBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLBenchmarkWithMoreStandardClasses", ArgoUMLBenchmarkWithMoreStandardClasses); +// String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass","traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); + String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", null, null,"traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); + /*Vector.addElemnt()�ɑΉ��ς�*/String[] ArgoUMLDelete0_2 = {"1784213708", "1337038091", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLDelete0_2", ArgoUMLDelete0_2); + /*�X�ɉߋ�mouse.Pressed(), mouseReleased()*/String[] ArgoUMLPlace1_1 = {null, null, "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLPlace1_1", ArgoUMLPlace1_1); + String[] ArgoUMLSelect1_2 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); + String[] jEditBenchmark = {"", "", "", "", "traces/jEditBenchmark.trace"}; map.put("jEditBenchmark", jEditBenchmark); + String[] jEditSelect2_1 = {"932187140", "1572482885", "java.util.ArrayList", "org.gjt.sp.jedit.textarea.Selection$Range", "traces\\jEditBenchmarkWithMoreStandardClasses.trace"}; map.put("jEditSelect2_1", jEditSelect2_1); + String[] jHotDrawBenchmark = {"", "", "", "", "traces/jHotDrawBenchmark.trace"}; map.put("jHotDrawBenchmark", jHotDrawBenchmark); + String[] jHotDrawBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawBenchmarkWithMoreStandardClasses", jHotDrawBenchmarkWithMoreStandardClasses); + /*List.toArray()�ɑΉ�������K�v������H*/String[] jEditDelete2_2 = {null, null, "org.gjt.sp.jedit.buffer.ContentManager", "java.util.ArrayList", "traces\\jEditBenchmarkWithMoreStandardClasses.trace"}; map.put("jEditDelete2_2", jEditDelete2_2); + String[] jHotDrawSelect3_1 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawSelect3_1", jHotDrawSelect3_1); + String[] jHotDrawMove3_2 = {"778703711", "212532447", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawMove3_2", jHotDrawMove3_2); + /*�s��*/String[] jHotDrawMove3_2_1 = {null, null, "java.util.ArrayList", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawMove3_2_1", jHotDrawMove3_2_1); + String[] jHotDrawPlace4_1 = {"1284329882", "212532447", "java.util.HashMap", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawPlace4_1", jHotDrawPlace4_1); + String[] jHotDrawSelect4_2 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); + } + private static void traverseMethodExecution(MethodExecution m) { System.out.println(m.getSignature()); for(Statement ms :m.getStatements()) { @@ -878,191 +226,6 @@ traverseMethodExecution(m2); } } - /* - * ���������� - * -===== All Statements Backward ===== -post:org.ntlab.trace.MethodInvocation:1699553003253243 -post:org.ntlab.trace.MethodInvocation:1699553004208835 -post:org.ntlab.trace.MethodInvocation:1699553004606587 -post:org.ntlab.trace.MethodInvocation:1699553004703556 -post:org.ntlab.trace.FieldUpdate:1699553004728240 -pre:org.ntlab.trace.FieldUpdate:1699553004728240 -post:org.ntlab.trace.BlockEnter:1699553004712019 -pre:org.ntlab.trace.BlockEnter:1699553004712019 -pre:org.ntlab.trace.MethodInvocation:1699553004703556 -post:org.ntlab.trace.MethodInvocation:1699553004648195 -post:org.ntlab.trace.FieldAccess:1699553004670763 -pre:org.ntlab.trace.FieldAccess:1699553004670763 -post:org.ntlab.trace.BlockEnter:1699553004655953 -pre:org.ntlab.trace.BlockEnter:1699553004655953 -pre:org.ntlab.trace.MethodInvocation:1699553004648195 -post:org.ntlab.trace.FieldAccess:1699553004629507 -pre:org.ntlab.trace.FieldAccess:1699553004629507 -post:org.ntlab.trace.BlockEnter:1699553004615402 -pre:org.ntlab.trace.BlockEnter:1699553004615402 -pre:org.ntlab.trace.MethodInvocation:1699553004606587 -post:org.ntlab.trace.MethodInvocation:1699553004302631 -post:org.ntlab.trace.MethodInvocation:1699553004515964 -post:org.ntlab.trace.FieldAccess:1699553004546994 -pre:org.ntlab.trace.FieldAccess:1699553004546994 -post:org.ntlab.trace.BlockEnter:1699553004526543 -pre:org.ntlab.trace.BlockEnter:1699553004526543 -pre:org.ntlab.trace.MethodInvocation:1699553004515964 -post:org.ntlab.trace.MethodInvocation:1699553004418995 -post:org.ntlab.trace.FieldAccess:1699553004461661 -pre:org.ntlab.trace.FieldAccess:1699553004461661 -post:org.ntlab.trace.BlockEnter:1699553004434510 -pre:org.ntlab.trace.BlockEnter:1699553004434510 -pre:org.ntlab.trace.MethodInvocation:1699553004418995 -post:org.ntlab.trace.FieldAccess:1699553004373507 -pre:org.ntlab.trace.FieldAccess:1699553004373507 -post:org.ntlab.trace.BlockEnter:1699553004326962 -pre:org.ntlab.trace.BlockEnter:1699553004326962 -pre:org.ntlab.trace.MethodInvocation:1699553004302631 -post:org.ntlab.trace.FieldAccess:1699553004257849 -pre:org.ntlab.trace.FieldAccess:1699553004257849 -post:org.ntlab.trace.BlockEnter:1699553004228229 -pre:org.ntlab.trace.BlockEnter:1699553004228229 -pre:org.ntlab.trace.MethodInvocation:1699553004208835 -post:org.ntlab.trace.MethodInvocation:1699553003386885 -post:org.ntlab.trace.MethodInvocation:1699553003805088 -post:org.ntlab.trace.MethodInvocation:1699553004012075 -post:org.ntlab.trace.FieldAccess:1699553004082951 -pre:org.ntlab.trace.FieldAccess:1699553004082951 -post:org.ntlab.trace.BlockEnter:1699553004029706 -pre:org.ntlab.trace.BlockEnter:1699553004029706 -pre:org.ntlab.trace.MethodInvocation:1699553004012075 -post:org.ntlab.trace.MethodInvocation:1699553003896769 -post:org.ntlab.trace.FieldAccess:1699553003944020 -pre:org.ntlab.trace.FieldAccess:1699553003944020 -post:org.ntlab.trace.BlockEnter:1699553003912989 -pre:org.ntlab.trace.BlockEnter:1699553003912989 -pre:org.ntlab.trace.MethodInvocation:1699553003896769 -post:org.ntlab.trace.FieldAccess:1699553003846345 -pre:org.ntlab.trace.FieldAccess:1699553003846345 -post:org.ntlab.trace.BlockEnter:1699553003818135 -pre:org.ntlab.trace.BlockEnter:1699553003818135 -pre:org.ntlab.trace.MethodInvocation:1699553003805088 -post:org.ntlab.trace.MethodInvocation:1699553003482444 -post:org.ntlab.trace.MethodInvocation:1699553003668273 -post:org.ntlab.trace.FieldAccess:1699553003715876 -pre:org.ntlab.trace.FieldAccess:1699553003715876 -post:org.ntlab.trace.BlockEnter:1699553003688020 -pre:org.ntlab.trace.BlockEnter:1699553003688020 -pre:org.ntlab.trace.MethodInvocation:1699553003668273 -post:org.ntlab.trace.MethodInvocation:1699553003556141 -post:org.ntlab.trace.FieldAccess:1699553003599513 -pre:org.ntlab.trace.FieldAccess:1699553003599513 -post:org.ntlab.trace.BlockEnter:1699553003570951 -pre:org.ntlab.trace.BlockEnter:1699553003570951 -pre:org.ntlab.trace.MethodInvocation:1699553003556141 -post:org.ntlab.trace.FieldAccess:1699553003526169 -pre:org.ntlab.trace.FieldAccess:1699553003526169 -post:org.ntlab.trace.BlockEnter:1699553003500427 -pre:org.ntlab.trace.BlockEnter:1699553003500427 -pre:org.ntlab.trace.MethodInvocation:1699553003482444 -post:org.ntlab.trace.FieldAccess:1699553003436956 -pre:org.ntlab.trace.FieldAccess:1699553003436956 -post:org.ntlab.trace.BlockEnter:1699553003400637 -pre:org.ntlab.trace.BlockEnter:1699553003400637 -pre:org.ntlab.trace.MethodInvocation:1699553003386885 -post:org.ntlab.trace.FieldAccess:1699553003355502 -pre:org.ntlab.trace.FieldAccess:1699553003355502 -post:org.ntlab.trace.FieldAccess:1699553003299083 -pre:org.ntlab.trace.FieldAccess:1699553003299083 -post:org.ntlab.trace.BlockEnter:1699553003273695 -pre:org.ntlab.trace.BlockEnter:1699553003273695 -pre:org.ntlab.trace.MethodInvocation:1699553003253243 -post:org.ntlab.trace.MethodInvocation:1699552993730471 -post:org.ntlab.trace.FieldUpdate:1699553003190477 -pre:org.ntlab.trace.FieldUpdate:1699553003190477 -post:org.ntlab.trace.MethodInvocation:1699553001472175 -post:org.ntlab.trace.FieldUpdate:1699553003149926 -pre:org.ntlab.trace.FieldUpdate:1699553003149926 -post:org.ntlab.trace.MethodInvocation:1699553002201034 -post:org.ntlab.trace.FieldUpdate:1699553003101618 -pre:org.ntlab.trace.FieldUpdate:1699553003101618 -post:org.ntlab.trace.MethodInvocation:1699553003026510 -pre:org.ntlab.trace.MethodInvocation:1699553003026510 -pre:org.ntlab.trace.MethodInvocation:1699553002201034 -pre:org.ntlab.trace.MethodInvocation:1699553001472175 -post:org.ntlab.trace.FieldUpdate:1699553000682666 -pre:org.ntlab.trace.FieldUpdate:1699553000682666 -post:org.ntlab.trace.MethodInvocation:1699552994339441 -post:org.ntlab.trace.FieldUpdate:1699553000640352 -pre:org.ntlab.trace.FieldUpdate:1699553000640352 -post:org.ntlab.trace.MethodInvocation:1699552994979793 -post:org.ntlab.trace.FieldUpdate:1699553000596627 -pre:org.ntlab.trace.FieldUpdate:1699553000596627 -post:org.ntlab.trace.MethodInvocation:1699552995575363 -post:org.ntlab.trace.FieldUpdate:1699553000551845 -pre:org.ntlab.trace.FieldUpdate:1699553000551845 -post:org.ntlab.trace.MethodInvocation:1699552996163881 -post:org.ntlab.trace.FieldUpdate:1699553000508121 -pre:org.ntlab.trace.FieldUpdate:1699553000508121 -post:org.ntlab.trace.MethodInvocation:1699552996774613 -post:org.ntlab.trace.FieldUpdate:1699553000463691 -pre:org.ntlab.trace.FieldUpdate:1699553000463691 -post:org.ntlab.trace.MethodInvocation:1699552997363836 -post:org.ntlab.trace.FieldUpdate:1699553000422435 -pre:org.ntlab.trace.FieldUpdate:1699553000422435 -post:org.ntlab.trace.MethodInvocation:1699552997949532 -post:org.ntlab.trace.FieldUpdate:1699553000376947 -pre:org.ntlab.trace.FieldUpdate:1699553000376947 -post:org.ntlab.trace.MethodInvocation:1699552998548628 -post:org.ntlab.trace.FieldUpdate:1699553000331107 -pre:org.ntlab.trace.FieldUpdate:1699553000331107 -post:org.ntlab.trace.MethodInvocation:1699552999050402 -post:org.ntlab.trace.FieldUpdate:1699553000290908 -pre:org.ntlab.trace.FieldUpdate:1699553000290908 -post:org.ntlab.trace.MethodInvocation:1699552999466490 -post:org.ntlab.trace.FieldUpdate:1699553000259878 -pre:org.ntlab.trace.FieldUpdate:1699553000259878 -post:org.ntlab.trace.MethodInvocation:1699552999875526 -post:org.ntlab.trace.FieldUpdate:1699553000225322 -pre:org.ntlab.trace.FieldUpdate:1699553000225322 -post:org.ntlab.trace.MethodInvocation:1699553000173135 -pre:org.ntlab.trace.MethodInvocation:1699553000173135 -pre:org.ntlab.trace.MethodInvocation:1699552999875526 -pre:org.ntlab.trace.MethodInvocation:1699552999466490 -pre:org.ntlab.trace.MethodInvocation:1699552999050402 -pre:org.ntlab.trace.MethodInvocation:1699552998548628 -pre:org.ntlab.trace.MethodInvocation:1699552997949532 -pre:org.ntlab.trace.MethodInvocation:1699552997363836 -pre:org.ntlab.trace.MethodInvocation:1699552996774613 -pre:org.ntlab.trace.MethodInvocation:1699552996163881 -pre:org.ntlab.trace.MethodInvocation:1699552995575363 -pre:org.ntlab.trace.MethodInvocation:1699552994979793 -pre:org.ntlab.trace.MethodInvocation:1699552994339441 -pre:org.ntlab.trace.MethodInvocation:1699552993730471 -post:org.ntlab.trace.BlockEnter:1699552992988213 -pre:org.ntlab.trace.BlockEnter:1699552992988213 - */ - - private static void setArgmentsForDeltaExtract(Map map){ - String[] test = {null, null, "org.argouml.uml.diagram.static_structure.ui.FigClass","org.tigris.gef.base.LayerPerspectiveMutable", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("test", test); - String[] testVectorAddElement = {null, null, "java.util.Vector", "org.tigris.gef.base.LayerPerspective", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("testVectorAddElement", testVectorAddElement);//trace.java��"addElement("�ɑΉ�����悤�ɒlj� - String[] sample1 = {null, null, "sample1.D", "sample1.C", "traces\\sample1.trace"}; map.put("sample1", sample1); - String[] sampleArray = {null, null, "sampleArray.D", "sampleArray.C", "traces\\sampleArray.trace"}; map.put("sampleArray", sampleArray); - String[] sampleCollection = {null, null, "sampleCollection.D", "sampleCollection.C", "traces\\sampleCollection.trace"}; map.put("sampleCollection", sampleCollection); - String[] sampleCreate = {null, null, "sampleCreate.D", "sampleCreate.C", "traces\\sampleCreate.trace"}; map.put("sampleCreate", sampleCreate); - String[] sampleStatic = {null, null, "sampleStatic.D", "sampleStatic.C", "traces\\sampleStatic.trace"}; map.put("sampleStatic", sampleStatic); - String[] worstCase = {null, null, "worstCase.P", "worstCase.M", "traces/_worstCase.txt"}; map.put("worstCase", worstCase); - // String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass","traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); - String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", null, null,"traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); - /*Vector.addElemnt()�ɑΉ��ς�*/String[] ArgoUMLDelete0_2 = {"1784213708", "1337038091", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLDelete0_2", ArgoUMLDelete0_2); - /*�X�ɉߋ�mouse.Pressed(), mouseReleased()*/String[] ArgoUMLPlace1_1 = {null, null, "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLPlace1_1", ArgoUMLPlace1_1); - String[] ArgoUMLSelect1_2 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace"}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); - String[] jEditSelect2_1 = {"932187140", "1572482885", "java.util.ArrayList", "org.gjt.sp.jedit.textarea.Selection$Range", "traces\\jEditBenchmarkWithMoreStandardClasses.trace"}; map.put("jEditSelect2_1", jEditSelect2_1); - /*List.toArray()�ɑΉ�������K�v������H*/String[] jEditDelete2_2 = {null, null, "org.gjt.sp.jedit.buffer.ContentManager", "java.util.ArrayList", "traces\\jEditBenchmarkWithMoreStandardClasses.trace"}; map.put("jEditDelete2_2", jEditDelete2_2); - String[] jHotDrawSelect3_1 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawSelect3_1", jHotDrawSelect3_1); - String[] jHotDrawMove3_2 = {"778703711", "212532447", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawMove3_2", jHotDrawMove3_2); - /*�s��*/String[] jHotDrawMove3_2_1 = {null, null, "java.util.ArrayList", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawMove3_2_1", jHotDrawMove3_2_1); - String[] jHotDrawPlace4_1 = {"1284329882", "212532447", "java.util.HashMap", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawPlace4_1", jHotDrawPlace4_1); - String[] jHotDrawSelect4_2 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace"}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); - } - }