diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..ca33835
--- /dev/null
+++ b/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: TraceAnalyzer
+Bundle-SymbolicName: org.ntlab.traceAnalyzer;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.ntlab.traceanalyzer.Activator
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Import-Package: org.osgi.framework;version="1.3.0",
+ org.osgi.util.tracker;version="1.3.1"
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.jface,
+ org.eclipse.core.runtime;bundle-version="3.8.0",
+ org.eclipse.core.resources;bundle-version="3.8.1",
+ org.eclipse.jdt.core;bundle-version="3.8.3",
+ org.eclipse.jdt.ui;bundle-version="3.8.2"
diff --git a/bin/java.policy.applet b/bin/java.policy.applet
new file mode 100644
index 0000000..ba9f51d
--- /dev/null
+++ b/bin/java.policy.applet
@@ -0,0 +1,7 @@
+/* AUTOMATICALLY GENERATED ON Tue Apr 16 17:20:59 EDT 2002*/
+/* DO NOT EDIT */
+
+grant {
+ permission java.security.AllPermission;
+};
+
diff --git a/bin/org/ntlab/deltaExtractor/Alias$AliasType.class b/bin/org/ntlab/deltaExtractor/Alias$AliasType.class
new file mode 100644
index 0000000..a6b2540
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/Alias$AliasType.class
Binary files differ
diff --git a/bin/org/ntlab/deltaExtractor/Alias.class b/bin/org/ntlab/deltaExtractor/Alias.class
new file mode 100644
index 0000000..5aa1582
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/Alias.class
Binary files differ
diff --git a/bin/org/ntlab/deltaExtractor/Delta.class b/bin/org/ntlab/deltaExtractor/Delta.class
new file mode 100644
index 0000000..d301295
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/Delta.class
Binary files differ
diff --git a/bin/org/ntlab/deltaExtractor/DeltaAugmentationInfo.class b/bin/org/ntlab/deltaExtractor/DeltaAugmentationInfo.class
new file mode 100644
index 0000000..5902cee
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/DeltaAugmentationInfo.class
Binary files differ
diff --git a/bin/org/ntlab/deltaExtractor/DeltaExtractor$1.class b/bin/org/ntlab/deltaExtractor/DeltaExtractor$1.class
new file mode 100644
index 0000000..3eaedfd
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/DeltaExtractor$1.class
Binary files differ
diff --git a/bin/org/ntlab/deltaExtractor/DeltaExtractor.class b/bin/org/ntlab/deltaExtractor/DeltaExtractor.class
new file mode 100644
index 0000000..d1bcad6
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/DeltaExtractor.class
Binary files differ
diff --git a/bin/org/ntlab/deltaExtractor/DeltaExtractorJSON.class b/bin/org/ntlab/deltaExtractor/DeltaExtractorJSON.class
new file mode 100644
index 0000000..8fa42c5
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/DeltaExtractorJSON.class
Binary files differ
diff --git a/bin/org/ntlab/deltaExtractor/ExtractedStructure.class b/bin/org/ntlab/deltaExtractor/ExtractedStructure.class
new file mode 100644
index 0000000..f7c028d
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/ExtractedStructure.class
Binary files differ
diff --git a/bin/org/ntlab/deltaExtractor/IAliasCollector.class b/bin/org/ntlab/deltaExtractor/IAliasCollector.class
new file mode 100644
index 0000000..118674a
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/IAliasCollector.class
Binary files differ
diff --git a/bin/org/ntlab/deltaExtractor/Test.class b/bin/org/ntlab/deltaExtractor/Test.class
new file mode 100644
index 0000000..e95c2f1
--- /dev/null
+++ b/bin/org/ntlab/deltaExtractor/Test.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/DeltaAliasCollector.class b/bin/org/ntlab/deltaViewer/DeltaAliasCollector.class
new file mode 100644
index 0000000..525bec5
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/DeltaAliasCollector.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/DeltaAnimation$1.class b/bin/org/ntlab/deltaViewer/DeltaAnimation$1.class
new file mode 100644
index 0000000..4e30013
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/DeltaAnimation$1.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/DeltaAnimation$2.class b/bin/org/ntlab/deltaViewer/DeltaAnimation$2.class
new file mode 100644
index 0000000..4049eb0
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/DeltaAnimation$2.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/DeltaAnimation$3.class b/bin/org/ntlab/deltaViewer/DeltaAnimation$3.class
new file mode 100644
index 0000000..07e120b
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/DeltaAnimation$3.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/DeltaAnimation$4.class b/bin/org/ntlab/deltaViewer/DeltaAnimation$4.class
new file mode 100644
index 0000000..81236b1
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/DeltaAnimation$4.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/DeltaAnimation$5.class b/bin/org/ntlab/deltaViewer/DeltaAnimation$5.class
new file mode 100644
index 0000000..ce8e27f
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/DeltaAnimation$5.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/DeltaAnimation.class b/bin/org/ntlab/deltaViewer/DeltaAnimation.class
new file mode 100644
index 0000000..663ec9c
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/DeltaAnimation.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/DeltaGraphAdapter.class b/bin/org/ntlab/deltaViewer/DeltaGraphAdapter.class
new file mode 100644
index 0000000..3ebf9f3
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/DeltaGraphAdapter.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/DeltaViewer.class b/bin/org/ntlab/deltaViewer/DeltaViewer.class
new file mode 100644
index 0000000..8859e20
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/DeltaViewer.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/Edge$TypeName.class b/bin/org/ntlab/deltaViewer/Edge$TypeName.class
new file mode 100644
index 0000000..62ec279
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/Edge$TypeName.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/Edge.class b/bin/org/ntlab/deltaViewer/Edge.class
new file mode 100644
index 0000000..cfd0862
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/Edge.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/JGraphTSample$1.class b/bin/org/ntlab/deltaViewer/JGraphTSample$1.class
new file mode 100644
index 0000000..732c560
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/JGraphTSample$1.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/JGraphTSample$GPanel.class b/bin/org/ntlab/deltaViewer/JGraphTSample$GPanel.class
new file mode 100644
index 0000000..7eafc44
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/JGraphTSample$GPanel.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/JGraphTSample.class b/bin/org/ntlab/deltaViewer/JGraphTSample.class
new file mode 100644
index 0000000..af8f6dd
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/JGraphTSample.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/Vertex.class b/bin/org/ntlab/deltaViewer/Vertex.class
new file mode 100644
index 0000000..e0a2fee
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/Vertex.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/VertexMethodExecution.class b/bin/org/ntlab/deltaViewer/VertexMethodExecution.class
new file mode 100644
index 0000000..98ab6c6
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/VertexMethodExecution.class
Binary files differ
diff --git a/bin/org/ntlab/deltaViewer/VertexObject.class b/bin/org/ntlab/deltaViewer/VertexObject.class
new file mode 100644
index 0000000..3a10185
--- /dev/null
+++ b/bin/org/ntlab/deltaViewer/VertexObject.class
Binary files differ
diff --git a/bin/org/ntlab/featureLocator/ScenarioBasedProbabilisticRanking.class b/bin/org/ntlab/featureLocator/ScenarioBasedProbabilisticRanking.class
new file mode 100644
index 0000000..3c5e78f
--- /dev/null
+++ b/bin/org/ntlab/featureLocator/ScenarioBasedProbabilisticRanking.class
Binary files differ
diff --git a/bin/org/ntlab/featureLocator/SoftwareReconnaissance.class b/bin/org/ntlab/featureLocator/SoftwareReconnaissance.class
new file mode 100644
index 0000000..23d8cb4
--- /dev/null
+++ b/bin/org/ntlab/featureLocator/SoftwareReconnaissance.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectCallCounter$1.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectCallCounter$1.class
new file mode 100644
index 0000000..6f8568f
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectCallCounter$1.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectCallCounter$2.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectCallCounter$2.class
new file mode 100644
index 0000000..4bd8fa1
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectCallCounter$2.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectCallCounter.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectCallCounter.class
new file mode 100644
index 0000000..d4805f6
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectCallCounter.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectCreationGraphConstructor$1.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectCreationGraphConstructor$1.class
new file mode 100644
index 0000000..3637801
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectCreationGraphConstructor$1.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectCreationGraphConstructor.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectCreationGraphConstructor.class
new file mode 100644
index 0000000..c215e9f
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectCreationGraphConstructor.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectGraphReconstructor$1.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectGraphReconstructor$1.class
new file mode 100644
index 0000000..1017fc2
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectGraphReconstructor$1.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectGraphReconstructor$2.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectGraphReconstructor$2.class
new file mode 100644
index 0000000..54ea5fe
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectGraphReconstructor$2.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectGraphReconstructor.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectGraphReconstructor.class
new file mode 100644
index 0000000..99c7b8c
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectGraphReconstructor.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectLinkCounter$1.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectLinkCounter$1.class
new file mode 100644
index 0000000..75aa8f2
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectLinkCounter$1.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectLinkCounter$2.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectLinkCounter$2.class
new file mode 100644
index 0000000..3acec30
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectLinkCounter$2.class
Binary files differ
diff --git a/bin/org/ntlab/objectGraphAnalyzer/ObjectLinkCounter.class b/bin/org/ntlab/objectGraphAnalyzer/ObjectLinkCounter.class
new file mode 100644
index 0000000..0caa4b4
--- /dev/null
+++ b/bin/org/ntlab/objectGraphAnalyzer/ObjectLinkCounter.class
Binary files differ
diff --git a/bin/org/ntlab/trace/ArrayAccess.class b/bin/org/ntlab/trace/ArrayAccess.class
new file mode 100644
index 0000000..13971bb
--- /dev/null
+++ b/bin/org/ntlab/trace/ArrayAccess.class
Binary files differ
diff --git a/bin/org/ntlab/trace/ArrayCreate.class b/bin/org/ntlab/trace/ArrayCreate.class
new file mode 100644
index 0000000..fb8c46c
--- /dev/null
+++ b/bin/org/ntlab/trace/ArrayCreate.class
Binary files differ
diff --git a/bin/org/ntlab/trace/ArrayUpdate.class b/bin/org/ntlab/trace/ArrayUpdate.class
new file mode 100644
index 0000000..6a62178
--- /dev/null
+++ b/bin/org/ntlab/trace/ArrayUpdate.class
Binary files differ
diff --git a/bin/org/ntlab/trace/AugmentationInfo.class b/bin/org/ntlab/trace/AugmentationInfo.class
new file mode 100644
index 0000000..33c0b13
--- /dev/null
+++ b/bin/org/ntlab/trace/AugmentationInfo.class
Binary files differ
diff --git a/bin/org/ntlab/trace/BlockEnter.class b/bin/org/ntlab/trace/BlockEnter.class
new file mode 100644
index 0000000..fe69b9a
--- /dev/null
+++ b/bin/org/ntlab/trace/BlockEnter.class
Binary files differ
diff --git a/bin/org/ntlab/trace/ClassInfo.class b/bin/org/ntlab/trace/ClassInfo.class
new file mode 100644
index 0000000..581ed2c
--- /dev/null
+++ b/bin/org/ntlab/trace/ClassInfo.class
Binary files differ
diff --git a/bin/org/ntlab/trace/DeltaViewerSample.class b/bin/org/ntlab/trace/DeltaViewerSample.class
new file mode 100644
index 0000000..6596241
--- /dev/null
+++ b/bin/org/ntlab/trace/DeltaViewerSample.class
Binary files differ
diff --git a/bin/org/ntlab/trace/FieldAccess.class b/bin/org/ntlab/trace/FieldAccess.class
new file mode 100644
index 0000000..5017132
--- /dev/null
+++ b/bin/org/ntlab/trace/FieldAccess.class
Binary files differ
diff --git a/bin/org/ntlab/trace/FieldUpdate.class b/bin/org/ntlab/trace/FieldUpdate.class
new file mode 100644
index 0000000..18bab86
--- /dev/null
+++ b/bin/org/ntlab/trace/FieldUpdate.class
Binary files differ
diff --git a/bin/org/ntlab/trace/IBoundaryChecker.class b/bin/org/ntlab/trace/IBoundaryChecker.class
new file mode 100644
index 0000000..c7f607f
--- /dev/null
+++ b/bin/org/ntlab/trace/IBoundaryChecker.class
Binary files differ
diff --git a/bin/org/ntlab/trace/IMethodExecutionVisitor.class b/bin/org/ntlab/trace/IMethodExecutionVisitor.class
new file mode 100644
index 0000000..1267b54
--- /dev/null
+++ b/bin/org/ntlab/trace/IMethodExecutionVisitor.class
Binary files differ
diff --git a/bin/org/ntlab/trace/IStatementVisitor.class b/bin/org/ntlab/trace/IStatementVisitor.class
new file mode 100644
index 0000000..e04850f
--- /dev/null
+++ b/bin/org/ntlab/trace/IStatementVisitor.class
Binary files differ
diff --git a/bin/org/ntlab/trace/MethodExecution.class b/bin/org/ntlab/trace/MethodExecution.class
new file mode 100644
index 0000000..4436ee3
--- /dev/null
+++ b/bin/org/ntlab/trace/MethodExecution.class
Binary files differ
diff --git a/bin/org/ntlab/trace/MethodExecutionJPDA$IMethodExecutionVisitorJPDA.class b/bin/org/ntlab/trace/MethodExecutionJPDA$IMethodExecutionVisitorJPDA.class
new file mode 100644
index 0000000..33d22cd
--- /dev/null
+++ b/bin/org/ntlab/trace/MethodExecutionJPDA$IMethodExecutionVisitorJPDA.class
Binary files differ
diff --git a/bin/org/ntlab/trace/MethodExecutionJPDA.class b/bin/org/ntlab/trace/MethodExecutionJPDA.class
new file mode 100644
index 0000000..a895333
--- /dev/null
+++ b/bin/org/ntlab/trace/MethodExecutionJPDA.class
Binary files differ
diff --git a/bin/org/ntlab/trace/MethodInvocation.class b/bin/org/ntlab/trace/MethodInvocation.class
new file mode 100644
index 0000000..99bf982
--- /dev/null
+++ b/bin/org/ntlab/trace/MethodInvocation.class
Binary files differ
diff --git a/bin/org/ntlab/trace/ObjectReference.class b/bin/org/ntlab/trace/ObjectReference.class
new file mode 100644
index 0000000..53c3bb6
--- /dev/null
+++ b/bin/org/ntlab/trace/ObjectReference.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Reference.class b/bin/org/ntlab/trace/Reference.class
new file mode 100644
index 0000000..52d021a
--- /dev/null
+++ b/bin/org/ntlab/trace/Reference.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Statement.class b/bin/org/ntlab/trace/Statement.class
new file mode 100644
index 0000000..e0774e5
--- /dev/null
+++ b/bin/org/ntlab/trace/Statement.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TestTrace$1.class b/bin/org/ntlab/trace/TestTrace$1.class
new file mode 100644
index 0000000..5fffd24
--- /dev/null
+++ b/bin/org/ntlab/trace/TestTrace$1.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TestTrace$2.class b/bin/org/ntlab/trace/TestTrace$2.class
new file mode 100644
index 0000000..b91c999
--- /dev/null
+++ b/bin/org/ntlab/trace/TestTrace$2.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TestTrace.class b/bin/org/ntlab/trace/TestTrace.class
new file mode 100644
index 0000000..0de5693
--- /dev/null
+++ b/bin/org/ntlab/trace/TestTrace.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TestTraceJPDA$1.class b/bin/org/ntlab/trace/TestTraceJPDA$1.class
new file mode 100644
index 0000000..4eb9d2a
--- /dev/null
+++ b/bin/org/ntlab/trace/TestTraceJPDA$1.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TestTraceJPDA.class b/bin/org/ntlab/trace/TestTraceJPDA.class
new file mode 100644
index 0000000..b7948c7
--- /dev/null
+++ b/bin/org/ntlab/trace/TestTraceJPDA.class
Binary files differ
diff --git a/bin/org/ntlab/trace/ThreadInstance.class b/bin/org/ntlab/trace/ThreadInstance.class
new file mode 100644
index 0000000..58daff3
--- /dev/null
+++ b/bin/org/ntlab/trace/ThreadInstance.class
Binary files differ
diff --git a/bin/org/ntlab/trace/ThreadInstanceJPDA.class b/bin/org/ntlab/trace/ThreadInstanceJPDA.class
new file mode 100644
index 0000000..d150246
--- /dev/null
+++ b/bin/org/ntlab/trace/ThreadInstanceJPDA.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$1.class b/bin/org/ntlab/trace/Trace$1.class
new file mode 100644
index 0000000..e1257ea
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$1.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$10.class b/bin/org/ntlab/trace/Trace$10.class
new file mode 100644
index 0000000..4207013
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$10.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$11.class b/bin/org/ntlab/trace/Trace$11.class
new file mode 100644
index 0000000..e74cf2c
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$11.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$12.class b/bin/org/ntlab/trace/Trace$12.class
new file mode 100644
index 0000000..13a2eaa
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$12.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$13.class b/bin/org/ntlab/trace/Trace$13.class
new file mode 100644
index 0000000..1788c09
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$13.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$2.class b/bin/org/ntlab/trace/Trace$2.class
new file mode 100644
index 0000000..e4b8d18
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$2.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$3.class b/bin/org/ntlab/trace/Trace$3.class
new file mode 100644
index 0000000..4b9ed5c
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$3.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$4.class b/bin/org/ntlab/trace/Trace$4.class
new file mode 100644
index 0000000..9611a60
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$4.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$5.class b/bin/org/ntlab/trace/Trace$5.class
new file mode 100644
index 0000000..292d623
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$5.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$6.class b/bin/org/ntlab/trace/Trace$6.class
new file mode 100644
index 0000000..dde9382
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$6.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$7.class b/bin/org/ntlab/trace/Trace$7.class
new file mode 100644
index 0000000..f5be5ac
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$7.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$8.class b/bin/org/ntlab/trace/Trace$8.class
new file mode 100644
index 0000000..0131a9c
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$8.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace$9.class b/bin/org/ntlab/trace/Trace$9.class
new file mode 100644
index 0000000..cde0142
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace$9.class
Binary files differ
diff --git a/bin/org/ntlab/trace/Trace.class b/bin/org/ntlab/trace/Trace.class
new file mode 100644
index 0000000..e1ff5d4
--- /dev/null
+++ b/bin/org/ntlab/trace/Trace.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJPDA$1.class b/bin/org/ntlab/trace/TraceJPDA$1.class
new file mode 100644
index 0000000..dc255be
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJPDA$1.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJPDA$2.class b/bin/org/ntlab/trace/TraceJPDA$2.class
new file mode 100644
index 0000000..aedabff
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJPDA$2.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJPDA.class b/bin/org/ntlab/trace/TraceJPDA.class
new file mode 100644
index 0000000..ce401b7
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJPDA.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJSON$1.class b/bin/org/ntlab/trace/TraceJSON$1.class
new file mode 100644
index 0000000..421593e
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJSON$1.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJSON$2.class b/bin/org/ntlab/trace/TraceJSON$2.class
new file mode 100644
index 0000000..2780d62
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJSON$2.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJSON$3.class b/bin/org/ntlab/trace/TraceJSON$3.class
new file mode 100644
index 0000000..0b4006c
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJSON$3.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJSON$4.class b/bin/org/ntlab/trace/TraceJSON$4.class
new file mode 100644
index 0000000..ca2e72f
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJSON$4.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJSON$5.class b/bin/org/ntlab/trace/TraceJSON$5.class
new file mode 100644
index 0000000..2d296e5
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJSON$5.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJSON$6.class b/bin/org/ntlab/trace/TraceJSON$6.class
new file mode 100644
index 0000000..37eacb9
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJSON$6.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJSON$7.class b/bin/org/ntlab/trace/TraceJSON$7.class
new file mode 100644
index 0000000..03a247e
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJSON$7.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TraceJSON.class b/bin/org/ntlab/trace/TraceJSON.class
new file mode 100644
index 0000000..027e6d4
--- /dev/null
+++ b/bin/org/ntlab/trace/TraceJSON.class
Binary files differ
diff --git a/bin/org/ntlab/trace/TracePoint.class b/bin/org/ntlab/trace/TracePoint.class
new file mode 100644
index 0000000..7a9f1c4
--- /dev/null
+++ b/bin/org/ntlab/trace/TracePoint.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/Activator.class b/bin/org/ntlab/traceanalyzer/Activator.class
new file mode 100644
index 0000000..4ebd69f
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/Activator.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/CallTreeContentProvider.class b/bin/org/ntlab/traceanalyzer/CallTreeContentProvider.class
new file mode 100644
index 0000000..96b0b84
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/CallTreeContentProvider.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/CallTreeLabelProvider.class b/bin/org/ntlab/traceanalyzer/CallTreeLabelProvider.class
new file mode 100644
index 0000000..5d98053
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/CallTreeLabelProvider.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/CallTreeView$1.class b/bin/org/ntlab/traceanalyzer/CallTreeView$1.class
new file mode 100644
index 0000000..e23be9a
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/CallTreeView$1.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/CallTreeView$2.class b/bin/org/ntlab/traceanalyzer/CallTreeView$2.class
new file mode 100644
index 0000000..5a70329
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/CallTreeView$2.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/CallTreeView$3$1.class b/bin/org/ntlab/traceanalyzer/CallTreeView$3$1.class
new file mode 100644
index 0000000..44b7a04
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/CallTreeView$3$1.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/CallTreeView$3.class b/bin/org/ntlab/traceanalyzer/CallTreeView$3.class
new file mode 100644
index 0000000..2bf69fd
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/CallTreeView$3.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/CallTreeView$4.class b/bin/org/ntlab/traceanalyzer/CallTreeView$4.class
new file mode 100644
index 0000000..ca6d9c5
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/CallTreeView$4.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/CallTreeView.class b/bin/org/ntlab/traceanalyzer/CallTreeView.class
new file mode 100644
index 0000000..612df6b
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/CallTreeView.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/Dictionary.class b/bin/org/ntlab/traceanalyzer/Dictionary.class
new file mode 100644
index 0000000..70fabe9
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/Dictionary.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/DictionaryImpl.class b/bin/org/ntlab/traceanalyzer/DictionaryImpl.class
new file mode 100644
index 0000000..1540527
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/DictionaryImpl.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/DictionaryService.class b/bin/org/ntlab/traceanalyzer/DictionaryService.class
new file mode 100644
index 0000000..488a632
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/DictionaryService.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/DictionaryServiceImpl.class b/bin/org/ntlab/traceanalyzer/DictionaryServiceImpl.class
new file mode 100644
index 0000000..cacf9b9
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/DictionaryServiceImpl.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/MarkedMethodExecution.class b/bin/org/ntlab/traceanalyzer/MarkedMethodExecution.class
new file mode 100644
index 0000000..bad6593
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/MarkedMethodExecution.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/MarkedMethodExecutionVisitor.class b/bin/org/ntlab/traceanalyzer/MarkedMethodExecutionVisitor.class
new file mode 100644
index 0000000..8555035
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/MarkedMethodExecutionVisitor.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/MarkedThread.class b/bin/org/ntlab/traceanalyzer/MarkedThread.class
new file mode 100644
index 0000000..706b182
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/MarkedThread.class
Binary files differ
diff --git a/bin/org/ntlab/traceanalyzer/MarkedTrace.class b/bin/org/ntlab/traceanalyzer/MarkedTrace.class
new file mode 100644
index 0000000..5791f4e
--- /dev/null
+++ b/bin/org/ntlab/traceanalyzer/MarkedTrace.class
Binary files differ
diff --git a/build.properties b/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/icons/full/read_obj.gif b/icons/full/read_obj.gif
new file mode 100644
index 0000000..c876ebd
--- /dev/null
+++ b/icons/full/read_obj.gif
Binary files differ
diff --git a/icons/full/stckframe_obj.gif b/icons/full/stckframe_obj.gif
new file mode 100644
index 0000000..f1e585b
--- /dev/null
+++ b/icons/full/stckframe_obj.gif
Binary files differ
diff --git a/icons/full/stckframe_obj2.gif b/icons/full/stckframe_obj2.gif
new file mode 100644
index 0000000..0fdf558
--- /dev/null
+++ b/icons/full/stckframe_obj2.gif
Binary files differ
diff --git a/icons/full/stckframe_obj3.gif b/icons/full/stckframe_obj3.gif
new file mode 100644
index 0000000..ab64f22
--- /dev/null
+++ b/icons/full/stckframe_obj3.gif
Binary files differ
diff --git a/icons/full/threads_obj.gif b/icons/full/threads_obj.gif
new file mode 100644
index 0000000..45c23a9
--- /dev/null
+++ b/icons/full/threads_obj.gif
Binary files differ
diff --git a/icons/full/threads_obj2.gif b/icons/full/threads_obj2.gif
new file mode 100644
index 0000000..94d122a
--- /dev/null
+++ b/icons/full/threads_obj2.gif
Binary files differ
diff --git a/plugin.xml b/plugin.xml
new file mode 100644
index 0000000..8f4838f
--- /dev/null
+++ b/plugin.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/org/ntlab/deltaExtractor/Alias.java b/src/org/ntlab/deltaExtractor/Alias.java
new file mode 100644
index 0000000..7d83a6e
--- /dev/null
+++ b/src/org/ntlab/deltaExtractor/Alias.java
@@ -0,0 +1,72 @@
+package org.ntlab.deltaExtractor;
+import org.ntlab.trace.MethodExecution;
+import org.ntlab.trace.Statement;
+import org.ntlab.trace.TracePoint;
+/**
+ * �I�u�W�F�N�g�̎Q�Ə��(�G�C���A�X)��\���N���X
+ * @author Isitani
+ *
+ */
+public class Alias {
+ private String objectId;
+ private TracePoint occurrencePoint; // ���Y�I�u�W�F�N�g�̎Q�Ƃ��s���Ă�����s�ӏ��ɑΉ�����TracePoint
+ private AliasType aliasType;
+ private int index;
+
+ public enum AliasType {
+ // ���\�b�h�ւ̓���
+ FORMAL_PARAMETER,
+ THIS,
+ METHOD_INVOCATION,
+ CONSTRACTOR_INVOCATION,
+
+ // �ǐՃI�u�W�F�N�g�̐�ւ�
+ FIELD,
+ CONTAINER,
+ ARRAY_ELEMENT,
+ ARRAY,
+ ARRAY_CREATE,
+
+ // ���\�b�h����̏o��
+ ACTUAL_ARGUMENT,
+ RECEIVER,
+ RETURN_VALUE
+ }
+
+ public Alias(AliasType aliasType, int index, String objectId, TracePoint occurrencePoint) {
+ this.aliasType = aliasType;
+ this.index = index;
+ this.objectId = objectId;
+ this.occurrencePoint = occurrencePoint;
+ }
+
+ public AliasType getAliasType() {
+ return aliasType;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public String getObjectId() {
+ return objectId;
+ }
+
+ public TracePoint getOccurrencePoint() {
+ return occurrencePoint;
+ }
+
+ public MethodExecution getMethodExecution() {
+ return occurrencePoint.getMethodExecution();
+ }
+
+ public String getMethodSignature() {
+ return occurrencePoint.getMethodExecution().getCallerSideSignature();
+ }
+
+ public int getLineNo() {
+ Statement statement = occurrencePoint.getStatement();
+ return statement.getLineNo();
+ }
+
+}
\ No newline at end of file
diff --git a/src/org/ntlab/deltaExtractor/Delta.java b/src/org/ntlab/deltaExtractor/Delta.java
new file mode 100644
index 0000000..ea47d5b
--- /dev/null
+++ b/src/org/ntlab/deltaExtractor/Delta.java
@@ -0,0 +1,27 @@
+package org.ntlab.deltaExtractor;
+
+import java.util.ArrayList;
+
+import org.ntlab.trace.Reference;
+
+public class Delta {
+
+ private ArrayList srcSide = new ArrayList();
+ private ArrayList dstSide = new ArrayList();
+
+ public void addSrcSide(Reference r){
+ getSrcSide().add(r);
+ }
+
+ public void addDstSide(Reference r){
+ getDstSide().add(r);
+ }
+
+ public ArrayList getSrcSide() {
+ return srcSide;
+ }
+
+ public ArrayList getDstSide() {
+ return dstSide;
+ }
+}
diff --git a/src/org/ntlab/deltaExtractor/DeltaAugmentationInfo.java b/src/org/ntlab/deltaExtractor/DeltaAugmentationInfo.java
new file mode 100644
index 0000000..82a373d
--- /dev/null
+++ b/src/org/ntlab/deltaExtractor/DeltaAugmentationInfo.java
@@ -0,0 +1,34 @@
+package org.ntlab.deltaExtractor;
+
+import org.ntlab.trace.AugmentationInfo;
+
+public class DeltaAugmentationInfo extends AugmentationInfo {
+ private Boolean isCoodinator = false;
+ private Boolean isSetter = true;
+ private int traceObjectId = 0;
+
+ public void setTraceObjectId(int traceObjectId) {
+ this.traceObjectId = traceObjectId;
+ }
+
+ public int getTraceObjectId() {
+ return traceObjectId;
+ }
+
+ public void setSetterSide(boolean isSetter) {
+ this.isSetter = isSetter;
+ }
+
+ public boolean isSetterSide() {
+ return isSetter;
+ }
+
+ public void setCoodinator(boolean isCoodinator) {
+ this.isCoodinator = isCoodinator;
+ }
+
+ public boolean isCoodinator() {
+ return isCoodinator;
+ }
+
+}
diff --git a/src/org/ntlab/deltaExtractor/DeltaExtractor.java b/src/org/ntlab/deltaExtractor/DeltaExtractor.java
new file mode 100644
index 0000000..586c3ff
--- /dev/null
+++ b/src/org/ntlab/deltaExtractor/DeltaExtractor.java
@@ -0,0 +1,1117 @@
+package org.ntlab.deltaExtractor;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map.Entry;
+
+import org.ntlab.trace.FieldAccess;
+import org.ntlab.trace.FieldUpdate;
+import org.ntlab.trace.MethodExecution;
+import org.ntlab.trace.MethodInvocation;
+import org.ntlab.trace.ObjectReference;
+import org.ntlab.trace.Reference;
+import org.ntlab.trace.Statement;
+import org.ntlab.trace.Trace;
+import org.ntlab.trace.TracePoint;
+
+/**
+ * �f���^���o�A���S���Y��(�z��ւ̃A�N�Z�X�𐄑�����]���̃o�[�W����)
+ * extract(...)���\�b�h�Q�Œ��o����B
+ *
+ * @author Nitta
+ *
+ */
+public class DeltaExtractor {
+ protected static final int LOST_DECISION_EXTENSION = 0; // ��{�� 0 �ɐݒ�Bfinal�ϐ��̒ǐՃA���S���Y���̕s��C����͕s�v�̂͂��B
+ protected ArrayList data = new ArrayList();
+ protected ArrayList objList = new ArrayList(2);
+ protected ArrayList methodList = new ArrayList();
+ protected ExtractedStructure eStructure = new ExtractedStructure();
+ protected ObjectReference srcObject = null;
+ protected ObjectReference dstObject = null;
+ protected String returnValue;
+ protected String threadNo;
+ protected boolean isLost = false;
+ protected ArrayList checkList = new ArrayList();
+ protected Trace trace = null;
+ protected int finalCount = 0; // final�ϐ������o�ł��Ȃ��\��������̂ŁA�R���̉������ł��Ȃ������ꍇ�ł����炭�ǐՂ��Â���
+
+ protected static final boolean DEBUG1 = true;
+ protected static final boolean DEBUG2 = true;
+ protected final IAliasCollector defaultAliasCollector = new IAliasCollector() {
+ @Override
+ public void changeTrackingObject(String from, String to) {
+ }
+ @Override
+ public void addAlias(Alias alias) {
+ }
+ };
+
+ public DeltaExtractor(String traceFile) {
+ trace = new Trace(traceFile);
+ }
+
+ public DeltaExtractor(Trace trace) {
+ this.trace = trace;
+ }
+
+// public MethodExecution getMethodExecution(Reference createdReference, MethodExecution before) {
+// return trace.getMethodExecution(createdReference, before);
+// }
+//
+// public MethodExecution getMethodExecution(String methodSignature) {
+// return trace.getMethodExecution(methodSignature);
+// }
+//
+// public MethodExecution getMethodExecutionBackwardly(String methodSignature) {
+// return trace.getMethodExecutionBackwardly(methodSignature);
+// }
+//
+// public MethodExecution getCollectionTypeMethodExecution(Reference r, MethodExecution before) {
+// return trace.getCollectionTypeMethodExecution(r, before);
+// }
+//
+// public MethodExecution getArraySetMethodExecution(Reference r, MethodExecution before) {
+// return trace.getArraySetMethodExecution(r, before);
+// }
+//
+// public CallTree getLastCallTree(ArrayList refs,
+// ArrayList colls,
+// ArrayList arrys,
+// int endLine,
+// Reference[] lastRef) throws TraceFileException {
+// return trace.getLastCallTree(refs, colls, arrys, endLine, lastRef);
+// }
+
+ /**
+ * �f���^���o�A���S���Y���̌Ăяo�����T�������icalleeSearch�Ƒ��ݍċA�ɂȂ��Ă���j
+ * @param trace�@��͑Ώۃg���[�X
+ * @param methodExecution �T�����郁�\�b�h���s
+ * @param objList�@�ǐՒ��̃I�u�W�F�N�g
+ * @param child�@���O�ɒT�����Ă����Ăяo����̃��\�b�h���s
+ * @return ���������R�[�f�B�l�[�^
+ * @throws TraceFileException
+ */
+ protected MethodExecution callerSearch(Trace trace, TracePoint tracePoint, ArrayList objList, MethodExecution childMethodExecution) {
+ return callerSearch(trace, tracePoint, objList, childMethodExecution, defaultAliasCollector);
+ }
+
+ /**
+ * �f���^���o�A���S���Y���̌Ăяo�����T�������icalleeSearch�Ƒ��ݍċA�ɂȂ��Ă���j
+ * @param trace�@��͑Ώۃg���[�X
+ * @param methodExecution �T�����郁�\�b�h���s
+ * @param objList�@�ǐՒ��̃I�u�W�F�N�g
+ * @param child�@���O�ɒT�����Ă����Ăяo����̃��\�b�h���s
+ * @return ���������R�[�f�B�l�[�^
+ * @throws TraceFileException
+ */
+ protected MethodExecution callerSearch(Trace trace, TracePoint tracePoint, ArrayList objList, MethodExecution childMethodExecution, IAliasCollector aliasCollector) {
+ MethodExecution methodExecution = tracePoint.getMethodExecution();
+ methodExecution.setAugmentation(new DeltaAugmentationInfo());
+ eStructure.createParent(methodExecution);
+ String thisObjectId = methodExecution.getThisObjId();
+ ArrayList removeList = new ArrayList(); // �ǐՂ��Ă���I�u�W�F�N�g���ō폜�ΏۂƂȂ��Ă������
+ ArrayList creationList = new ArrayList(); // ���̃��\�b�h���s���ɐ������ꂽ�I�u�W�F�N�g
+ int existsInFields = 0; // ���̃��\�b�h���s���Ńt�B�[���h�ɗR�����Ă���I�u�W�F�N�g�̐�(1�ȏ�Ȃ炱�̃��\�b�h���s����this�Ɉˑ�)
+ boolean isTrackingThis = false; // �Ăяo�����this�Ɉˑ�����
+ boolean isSrcSide = true; // �Q�ƌ����Q�Ɛ�̂�����̑��̃I�u�W�F�N�g�̗R�������ǂ���this�I�u�W�F�N�g�ɓ��B������?
+ ArrayList fieldArrays = new ArrayList();
+ ArrayList fieldArrayElements = new ArrayList();
+ ObjectReference thisObj = new ObjectReference(thisObjectId, methodExecution.getThisClassName(),
+ Trace.getDeclaringType(methodExecution.getSignature(), methodExecution.isConstructor()), Trace.getDeclaringType(methodExecution.getCallerSideSignature(), methodExecution.isConstructor()));
+
+ if (childMethodExecution == null) {
+ // �T���J�n���͈�U�폜���A�Ăяo�����̒T���𑱂���ۂɕ���������
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ isTrackingThis = true; // �Ăяo�����T���O�ɕ���
+ }
+
+ if (childMethodExecution != null && objList.contains(childMethodExecution.getThisObjId())) {
+ // �Ăяo�����this�Ɉˑ�����
+ if (thisObjectId.equals(childMethodExecution.getThisObjId())) {
+ // �I�u�W�F�N�g���Ăяo���̂Ƃ��݈̂�U�폜���A�Ăяo�����̒T���𑱂���ۂɕ���������
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ isTrackingThis = true; // �Ăяo�����T���O�ɕ���
+ }
+ }
+
+ if (childMethodExecution != null && childMethodExecution.isConstructor()) {
+ // �Ăяo���悪�R���X�g���N�^�������ꍇ
+ int newIndex = objList.indexOf(childMethodExecution.getThisObjId());
+ if (newIndex != -1) {
+ // �Ăяo���悪�ǐՑΏۂ̃R���X�g���N�^��������field�Ɠ��l�ɏ���
+ removeList.add(childMethodExecution.getThisObjId());
+ existsInFields++;
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ }
+ }
+
+ if (childMethodExecution != null && Trace.getMethodName(childMethodExecution.getSignature()).startsWith("access$")) {
+ // �G���N���[�W���O�C���X�^���X�ɑ��郁�\�b�h�Ăяo���������ꍇ
+ String enclosingObj = childMethodExecution.getArguments().get(0).getId(); // �G���N���[�W���O�C���X�^���X�͑������ɓ����Ă���炵��
+ int encIndex = objList.indexOf(enclosingObj);
+ if (encIndex != -1) {
+ // thisObject �ɒu����������Afield�Ɠ��l�ɏ���
+ removeList.add(enclosingObj);
+ existsInFields++;
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ }
+ }
+
+ // �߂�l�ɒT���Ώۂ��܂܂�Ă����calleeSearch���ċA�Ăяo��
+ while (tracePoint.stepBackOver()) {
+ Statement statement = tracePoint.getStatement();
+ // ���ڎQ�Ƃ���уt�B�[���h�Q�Ƃ̒T��
+ if (statement instanceof FieldAccess) {
+ FieldAccess fs = (FieldAccess)statement;
+ String refObjectId = fs.getValueObjId();
+ int index = objList.indexOf(refObjectId);
+ if (index != -1) {
+ String ownerObjectId = fs.getContainerObjId();
+ if (ownerObjectId.equals(thisObjectId)) {
+ // �t�B�[���h�Q�Ƃ̏ꍇ
+ removeList.add(refObjectId);
+ existsInFields++; // set�������get�����o������\��������
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ } else {
+ // ���ڎQ�Ƃ̏ꍇ
+ if (refObjectId.equals(srcObject.getId())) {
+ eStructure.addSrcSide(new Reference(ownerObjectId, refObjectId,
+ fs.getContainerClassName(), srcObject.getActualType()));
+ srcObject = new ObjectReference(ownerObjectId, fs.getContainerClassName());
+ } else if(refObjectId.equals(dstObject.getId())) {
+ eStructure.addDstSide(new Reference(ownerObjectId, refObjectId,
+ fs.getContainerClassName(), dstObject.getActualType()));
+ dstObject = new ObjectReference(ownerObjectId, fs.getContainerClassName());
+ }
+ objList.set(index, ownerObjectId);
+ }
+ } else {
+ // �ŏI�I�ɃI�u�W�F�N�g�̗R����������Ȃ������ꍇ�ɁA�����ŎQ�Ƃ����z������̗v�f�ɗR�����Ă���\��������
+ String refObjType = fs.getValueClassName();
+ if (refObjType.startsWith("[L")) {
+ // �Q�Ƃ����t�B�[���h���z��̏ꍇ
+ ObjectReference trackingObj = null;
+ if ((srcObject.getActualType() != null && refObjType.endsWith(srcObject.getActualType() + ";"))
+ || (srcObject.getCalleeType() != null && refObjType.endsWith(srcObject.getCalleeType() + ";"))
+ || (srcObject.getCallerType() != null && refObjType.endsWith(srcObject.getCallerType() + ";"))) {
+ trackingObj = srcObject;
+ } else if ((dstObject.getActualType() != null && refObjType.endsWith(dstObject.getActualType() + ";"))
+ || (dstObject.getCalleeType() != null && refObjType.endsWith(dstObject.getCalleeType() + ";"))
+ || (dstObject.getCallerType() != null && refObjType.endsWith(dstObject.getCallerType() + ";"))) {
+ trackingObj = dstObject;
+ }
+ if (trackingObj != null) {
+ // �ǐՒ��̃I�u�W�F�N�g�ɁA�z��v�f�Ɠ����^�����I�u�W�F�N�g�����݂���ꍇ
+ String ownerObjectId = fs.getContainerObjId();
+ if (ownerObjectId.equals(thisObjectId)) {
+ // �t�B�[���h�Q�Ƃ̏ꍇ�i���ɗR���̉\�����Ȃ��Ƃ킩�������_�ŁA���̔z��̗v�f�ɗR�����Ă�����̂Ɛ�������B�j
+ fieldArrays.add(new ObjectReference(refObjectId, refObjType));
+ fieldArrayElements.add(trackingObj);
+ } else {
+ // ���ڎQ�Ƃ̏ꍇ(�{���ɂ��̔z��̗v�f����擾���ꂽ���̂Ȃ炱���ŒǐՑΏۂ�u��������ׂ������A
+ // ���̎��_�ő��̗R���̉\����r���ł��Ȃ��B�����ŒǐՑΏۂ�u�������Ă��܂��ƁA��ŕʂɗR�������邱�Ƃ��킩�����ꍇ��
+ // ��蒼��������B)
+ }
+ }
+ }
+ }
+ } else if (statement instanceof MethodInvocation) {
+ MethodExecution prevChildMethodExecution = ((MethodInvocation)statement).getCalledMethodExecution();
+ if (!prevChildMethodExecution.equals(childMethodExecution)) {
+ // �߂�l
+ ObjectReference ret = prevChildMethodExecution.getReturnValue();
+ if (ret != null) {
+ int retIndex = -1;
+ retIndex = objList.indexOf(ret.getId());
+ if (retIndex != -1) {
+ // �߂�l���R��������
+ prevChildMethodExecution.setAugmentation(new DeltaAugmentationInfo());
+ if (prevChildMethodExecution.isConstructor()) {
+ // �ǐՑΏۂ�constractor���Ă�ł�����(�I�u�W�F�N�g�̐�����������)field�Ɠ��l�ɏ���
+ String newObjId = ret.getId();
+ creationList.add(newObjId);
+ removeList.add(newObjId);
+ existsInFields++;
+ // objList.remove(callTree.getThisObjId());
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ ((DeltaAugmentationInfo)prevChildMethodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(newObjId)); // �ǐՑΏ�
+ ((DeltaAugmentationInfo)prevChildMethodExecution.getAugmentation()).setSetterSide(false); // getter�Ăяo���Ɠ��l
+ continue;
+ }
+ String retObj = objList.get(retIndex);
+ if (removeList.contains(retObj)) {
+ // ��xget�Ō��o���ăt�B�[���h�Ɉˑ����Ă���Ɣ��f�������{���̗R�����߂�l���������Ƃ����������̂ŁA�t�B�[���h�ւ̈ˑ����L�����Z������
+ removeList.remove(retObj);
+ existsInFields--;
+ if (existsInFields == 0) {
+ removeList.remove(thisObjectId);
+ }
+ }
+ ((DeltaAugmentationInfo)prevChildMethodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(retObj)); // �ǐՑΏ�
+ TracePoint prevChildTracePoint = tracePoint.duplicate();
+ prevChildTracePoint.stepBackNoReturn();
+ calleeSearch(trace, prevChildTracePoint, objList, prevChildMethodExecution.isStatic(), retIndex, aliasCollector); // �Ăяo�����T��
+ if (objList.get(retIndex) != null && objList.get(retIndex).equals(prevChildMethodExecution.getThisObjId())
+ && thisObjectId.equals(prevChildMethodExecution.getThisObjId())) {
+ // �Ăяo����Ńt�B�[���h�Ɉˑ����Ă����ꍇ�̏���
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ isTrackingThis = true; // �Ăяo�����T���O�ɕ���
+ }
+ if (isLost) {
+ checkList.add(objList.get(retIndex));
+ isLost = false;
+ }
+ } else {
+ // �ŏI�I�ɃI�u�W�F�N�g�̗R����������Ȃ������ꍇ�ɁA���̖߂�l�Ŏ擾�����z������̗v�f�ɗR�����Ă���\��������
+ String retType = ret.getActualType();
+ if (retType.startsWith("[L")) {
+ // �߂�l���z��̏ꍇ
+ if ((srcObject.getActualType() != null && retType.endsWith(srcObject.getActualType() + ";"))
+ || (srcObject.getCalleeType() != null && retType.endsWith(srcObject.getCalleeType() + ";"))
+ || (srcObject.getCallerType() != null && retType.endsWith(srcObject.getCallerType() + ";"))) {
+ retType = srcObject.getActualType();
+ } else if ((dstObject.getActualType() != null && retType.endsWith(dstObject.getActualType() + ";"))
+ || (dstObject.getCalleeType() != null && retType.endsWith(dstObject.getCalleeType() + ";"))
+ || (dstObject.getCallerType() != null && retType.endsWith(dstObject.getCallerType() + ";"))) {
+ retType = dstObject.getActualType();
+ } else {
+ retType = null;
+ }
+ if (retType != null) {
+ // �{���ɂ��̔z��̗v�f����擾���ꂽ���̂Ȃ炱���ŒǐՑΏۂ�u�������āA�Ăяo�����T�����ׂ������A
+ // ���̎��_�ő��̗R���̉\����r���ł��Ȃ��B�����ŒǐՑΏۂ�u�������Ă��܂��ƁA��ŕʂɗR�������邱�Ƃ��킩�����ꍇ��
+ // ��蒼��������B
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ // --- ���̎��_�� tracePoint �͌Ăяo�������w���Ă��� ---
+
+ // �R���N�V�����^�Ή�
+ if (methodExecution.isCollectionType()) {
+ objList.add(thisObjectId);
+ }
+
+ // �����̎擾
+ ArrayList argments = methodExecution.getArguments();
+
+ // �����ƃt�B�[���h�ɓ���ID�̃I�u�W�F�N�g������ꍇ��z��
+ Reference r;
+ for (int i = 0; i < removeList.size(); i++) {
+ String removeId = removeList.get(i);
+ if (argments.contains(new ObjectReference(removeId))) {
+ removeList.remove(removeId); // �t�B�[���h�ƈ����̗����ɒǐՑΏۂ����݂����ꍇ�A������D��
+ } else if(objList.contains(removeId)) {
+ // �t�B�[���h�ɂ����Ȃ������ꍇ(�������A�I�u�W�F�N�g�̐������t�B�[���h�Ɠ��l�Ɉ���)
+ objList.remove(removeId); // �ǐՑΏۂ���O��
+ if (!removeId.equals(thisObjectId)) {
+ // �t�B�[���h�ithis ���� removeId �ւ̎Q�Ɓj���f���^�̍\���v�f�ɂȂ�
+ if (removeId.equals(srcObject.getId())) {
+ r = new Reference(thisObj, srcObject);
+ r.setCreation(creationList.contains(removeId)); // �I�u�W�F�N�g�̐�����?
+ eStructure.addSrcSide(r);
+ srcObject = thisObj;
+ isSrcSide = true;
+ } else if (removeId.equals(dstObject.getId())) {
+ r = new Reference(thisObj, dstObject);
+ r.setCreation(creationList.contains(removeId)); // �I�u�W�F�N�g�̐�����?
+ eStructure.addDstSide(r);
+ dstObject = thisObj;
+ isSrcSide = false;
+ }
+ }
+ }
+ }
+ // --- ���̎��_�� this ���ǐՑΏۂł������Ƃ��Ă� objList �̒����炢������폜����Ă��� ---
+
+ // �����T��
+ boolean existsInAnArgument = false;
+ for (int i = 0; i < objList.size(); i++) {
+ String objectId = objList.get(i);
+ if (objectId != null) {
+ ObjectReference trackingObj = new ObjectReference(objectId);
+ if (argments.contains(trackingObj)) {
+ // �������R��������
+ existsInAnArgument = true;
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(objectId));
+ } else {
+ // �R�����ǂ��ɂ�������Ȃ�����
+ boolean isSrcSide2 = true;
+ trackingObj = null;
+ if (objectId.equals(srcObject.getId())) {
+ isSrcSide2 = true;
+ trackingObj = srcObject;
+ } else if (objectId.equals(dstObject.getId())) {
+ isSrcSide2 = false;
+ trackingObj = dstObject;
+ }
+ if (trackingObj != null) {
+ // �܂��z������̗v�f��R���Ƃ��ċ^��(������D��)
+ for (int j = 0; j < argments.size(); j++) {
+ ObjectReference argArray = argments.get(j);
+ if (argArray.getActualType().startsWith("[L")
+ && (trackingObj.getActualType() != null && (argArray.getActualType().endsWith(trackingObj.getActualType() + ";"))
+ || (trackingObj.getCalleeType() != null && argArray.getActualType().endsWith(trackingObj.getCalleeType() + ";"))
+ || (trackingObj.getCallerType() != null && argArray.getActualType().endsWith(trackingObj.getCallerType() + ";")))) {
+ // �^����v������z������̗v�f��R���Ƃ݂Ȃ�
+ existsInAnArgument = true;
+ objList.remove(objectId);
+ objList.add(argArray.getId()); // �ǐՑΏۂ�z��v�f����z��ɒu������
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(argArray.getId()));
+ r = new Reference(argArray.getId(), trackingObj.getId(),
+ argArray.getActualType(), trackingObj.getActualType());
+ r.setArray(true);
+ if (isSrcSide2) {
+ eStructure.addSrcSide(r);
+ srcObject = new ObjectReference(argArray.getId(), argArray.getActualType());
+ } else {
+ eStructure.addDstSide(r);
+ dstObject = new ObjectReference(argArray.getId(), argArray.getActualType());
+ }
+ objectId = null;
+ break;
+ }
+ }
+ if (objectId != null) {
+ // ���ɔz��t�B�[���h�̗v�f��R���Ƃ��ċ^��(�t�B�[���h�͈�������)
+ int index = fieldArrayElements.indexOf(trackingObj);
+ if (index != -1) {
+ // �^����v���Ă�̂Ŕz��t�B�[���h�̗v�f��R���Ƃ݂Ȃ�
+ ObjectReference fieldArray = fieldArrays.get(index);
+ existsInFields++;
+ objList.remove(objectId);
+ r = new Reference(fieldArray.getId(), trackingObj.getId(),
+ fieldArray.getActualType(), trackingObj.getActualType());
+ r.setArray(true);
+ if (isSrcSide2) {
+ eStructure.addSrcSide(r);
+ eStructure.addSrcSide(new Reference(thisObjectId, fieldArray.getId(),
+ methodExecution.getThisClassName(), fieldArray.getActualType()));
+ srcObject = thisObj;
+ isSrcSide = true;
+ } else {
+ eStructure.addDstSide(r);
+ eStructure.addDstSide(new Reference(thisObjectId, fieldArray.getId(),
+ methodExecution.getThisClassName(), fieldArray.getActualType()));
+ dstObject = thisObj;
+ isSrcSide = false;
+ }
+ }
+ }
+ if (trackingObj.getActualType() != null && trackingObj.getActualType().startsWith("[L")) {
+ // �ǂ��ɂ�������Ȃ������ꍇ�A�T���Ă���̂��z��^�Ȃ�A���̃��\�b�h���Ő������ꂽ���̂ƍl����
+ objList.remove(objectId);
+ if (isSrcSide2) {
+ eStructure.addSrcSide(new Reference(thisObjectId, trackingObj.getId(),
+ methodExecution.getThisClassName(), trackingObj.getActualType()));
+ srcObject = thisObj;
+ isSrcSide = true;
+ } else {
+ eStructure.addDstSide(new Reference(thisObjectId, trackingObj.getId(),
+ methodExecution.getThisClassName(), trackingObj.getActualType()));
+ dstObject = thisObj;
+ isSrcSide = false;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (existsInAnArgument) {
+ // ������1�ł��ǐՑΏۂ����݂����ꍇ
+ if (existsInFields > 0 || isTrackingThis) {
+ // this�I�u�W�F�N�g��ǐՒ��̏ꍇ
+ if (!Trace.isNull(thisObjectId)) {
+ objList.add(thisObjectId); // ����ɒT������ꍇ�A��U��菜���� thisObject ��
+ } else {
+ objList.add(null); // ������static�Ăяo���������ꍇ�A����ȏ�ǐՂ��Ȃ�
+ }
+ }
+// if (existsInFields > 0) {
+// // �t�B�[���h��R���Ɏ��I�u�W�F�N�g�����݂����ꍇ
+// if (isSrcSide) {
+// srcObject = thisObj;
+// } else {
+// dstObject = thisObj;
+// }
+// }
+ if (tracePoint.isValid()) {
+ finalCount = 0;
+ return callerSearch(trace, tracePoint, objList, methodExecution, aliasCollector); // �Ăяo����������ɒT��
+ }
+ }
+
+ for (int i = 0; i < objList.size(); i++) {
+ objList.remove(null);
+ }
+ if (objList.isEmpty()) {
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setCoodinator(true);
+ } else {
+ // �R���������ł��Ȃ�����
+ if (!methodExecution.isStatic()) {
+ finalCount++;
+ if (finalCount <= LOST_DECISION_EXTENSION) {
+ // final�ϐ����Q�Ƃ��Ă���ꍇ�R���������ł��Ȃ��\��������̂ŁA�ǐՂ������I�������P�\���Ԃ�݂���
+ if (tracePoint.isValid()) {
+ MethodExecution c = callerSearch(trace, tracePoint, objList, methodExecution, aliasCollector); // �Ăяo����������ɒT��
+ if (((DeltaAugmentationInfo)c.getAugmentation()).isCoodinator()) {
+ methodExecution = c; // �ǐՂ𑱂������ʃR�[�f�B�l�[�^����������
+ }
+ }
+ } else if (thisObj.getActualType().contains("$")) {
+ // �����������܂��͖����N���X�̏ꍇ�A���������I�u�W�F�N�g���O�����\�b�h�̓���final�ϐ�����擾�����Ƃ݂Ȃ��A����Ɏ����̒��̃t�B�[���h�̈��Ƃ݂Ȃ�
+ for (int i = objList.size() - 1; i >= 0; i--) {
+ String objectId = objList.get(i);
+ if (objectId != null) {
+ ObjectReference trackingObj = new ObjectReference(objectId);
+ boolean isSrcSide2 = true;
+ trackingObj = null;
+ if (objectId.equals(srcObject.getId())) {
+ isSrcSide2 = true;
+ trackingObj = srcObject;
+ } else if (objectId.equals(dstObject.getId())) {
+ isSrcSide2 = false;
+ trackingObj = dstObject;
+ }
+ if (trackingObj != null) {
+ r = new Reference(thisObjectId, trackingObj.getId(),
+ methodExecution.getThisClassName(), trackingObj.getActualType());
+ r.setFinalLocal(true);
+ if (isSrcSide2) {
+ eStructure.addSrcSide(r);
+ srcObject = thisObj;
+ isSrcSide = true;
+ } else {
+ eStructure.addDstSide(r);
+ dstObject = thisObj;
+ isSrcSide = false;
+ }
+ existsInFields++;
+ objList.remove(objectId);
+ }
+ }
+ }
+ }
+ }
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setCoodinator(false);
+ }
+ finalCount = 0;
+ return methodExecution;
+ }
+
+ /**
+ * �f���^���o�A���S���Y���̌Ăяo����T������(�ċA�Ăяo���ɂȂ��Ă���)
+ * @param trace ��͑Ώۃg���[�X
+ * @param methodExecution �T�����郁�\�b�h���s
+ * @param objList �ǐՒ��̃I�u�W�F�N�g
+ * @param isStatic�@�ÓI���\�b�h���ۂ�
+ * @param index�@objList���̂ǂ̃I�u�W�F�N�g��ǐՂ��Ă��̃��\�b�h���s�ɓ����Ă����̂�
+ * @throws TraceFileException
+ */
+ protected void calleeSearch(Trace trace, TracePoint tracePoint, ArrayList objList, Boolean isStatic, int index, IAliasCollector aliasCollector) {
+ MethodExecution methodExecution = tracePoint.getMethodExecution();
+ Boolean isResolved = false;
+ String objectId = objList.get(index); // calleeSearch() �ł͒ǐՑΏۂ̃I�u�W�F�N�g�͈�����A��objList��index�Ԗڂ̗v�f�ȊO�ύX���Ă͂����Ȃ�
+ String thisObjectId = methodExecution.getThisObjId();
+ ArrayList fieldArrays = new ArrayList();
+ ArrayList fieldArrayElements = new ArrayList();
+ ObjectReference thisObj = new ObjectReference(thisObjectId, methodExecution.getThisClassName(),
+ Trace.getDeclaringType(methodExecution.getSignature(), methodExecution.isConstructor()),
+ Trace.getDeclaringType(methodExecution.getCallerSideSignature(), methodExecution.isConstructor()));
+
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setSetterSide(false); // ��{�I��getter�Ăяo���̂͂������A����
+ ArrayList argments = methodExecution.getArguments();
+ ObjectReference trackingObj = null;
+ //static���o�R�����null�������Ă��鎞������
+ if (objectId != null) {
+ String returnType = Trace.getReturnType(methodExecution.getSignature());
+ if (objectId.equals(srcObject.getId())) {
+ trackingObj = srcObject;
+ trackingObj.setCalleeType(returnType);
+ } else if(objectId.equals(dstObject.getId())) {
+ trackingObj = dstObject;
+ trackingObj.setCalleeType(returnType);
+ } else {
+ trackingObj = new ObjectReference(objectId, null, returnType);
+ }
+
+ Reference r;
+ // �߂�l�ɒT���Ώۂ��܂܂�Ă����calleeSearch�Ăяo��
+ do {
+ if (!tracePoint.isValid()) break;
+ Statement statement = tracePoint.getStatement();
+ // ���ڎQ�Ƃ���уt�B�[���h�Q�Ƃ̒T��
+ if (statement instanceof FieldAccess) {
+ FieldAccess fs = (FieldAccess)statement;
+ if (objectId != null && objectId.equals(fs.getValueObjId())) {
+ String ownerObjectId = fs.getContainerObjId();
+ if (ownerObjectId.equals(thisObjectId)) {
+ // �t�B�[���h�Q�Ƃ̏ꍇ
+ if (objectId.equals(srcObject.getId())) {
+ eStructure.addSrcSide(new Reference(thisObj, srcObject));
+ srcObject = thisObj;
+ trackingObj = srcObject;
+ } else if(objectId.equals(dstObject.getId())) {
+ eStructure.addDstSide(new Reference(thisObj, dstObject));
+ dstObject = thisObj;
+ trackingObj = dstObject;
+ }
+ if (Trace.isNull(thisObjectId)) objectId = null; // static�ϐ��̏ꍇ
+ else objectId = thisObjectId;
+ objList.set(index, objectId);
+ } else {
+ // ���ڎQ�Ƃ̏ꍇ
+ if (objectId.equals(srcObject.getId())) {
+ eStructure.addSrcSide(new Reference(ownerObjectId, objectId,
+ fs.getContainerClassName(), srcObject.getActualType()));
+ srcObject = new ObjectReference(ownerObjectId, fs.getContainerClassName());
+ trackingObj = srcObject;
+ } else if(objectId.equals(dstObject.getId())) {
+ eStructure.addDstSide(new Reference(ownerObjectId, objectId,
+ fs.getContainerClassName(), dstObject.getActualType()));
+ dstObject = new ObjectReference(ownerObjectId, fs.getContainerClassName());
+ trackingObj = dstObject;
+ }
+ if (Trace.isNull(ownerObjectId)) objectId = null; // static�ϐ��̏ꍇ
+ else objectId = ownerObjectId;
+ objList.set(index, objectId);
+ }
+ isResolved = true;
+ } else {
+ // �I�u�W�F�N�g�̗R�������ڌ�����Ȃ������ꍇ�ł��A�����ꂩ�̔z��̗v�f�ɗR�����Ă���\��������
+ String refObjType = fs.getValueClassName();
+ if (refObjType.startsWith("[L")) {
+ // �Q�Ƃ����t�B�[���h���z��̏ꍇ
+ if ((trackingObj.getActualType() != null && refObjType.endsWith(trackingObj.getActualType() + ";"))
+ || (trackingObj.getCalleeType() != null && refObjType.endsWith(trackingObj.getCalleeType() + ";"))
+ || (trackingObj.getCallerType() != null && refObjType.endsWith(trackingObj.getCallerType() + ";"))) {
+ // �z��̗v�f�̕����ǐՒ��̃I�u�W�F�N�g�̌^�ƈ�v�����ꍇ
+ String ownerObjectId = fs.getContainerObjId();
+ if (ownerObjectId.equals(thisObjectId)) {
+ // �t�B�[���h�Q�Ƃ̏ꍇ�i���ɗR���̉\�����Ȃ��Ƃ킩�������_�ŁA���̔z��̗v�f�ɗR�����Ă�����̂Ɛ�������B�j
+ fieldArrays.add(new ObjectReference(fs.getValueObjId(), refObjType));
+ fieldArrayElements.add(trackingObj);
+ } else {
+ // ���ڎQ�Ƃ̏ꍇ(�{���ɂ��̔z��̗v�f����擾���ꂽ���̂Ȃ炱���ŒǐՑΏۂ�u��������ׂ������A
+ // ���̎��_�ő��̗R���̉\����r���ł��Ȃ��B�����ŒǐՑΏۂ�u�������Ă��܂��ƁA��ŕʂɗR�������邱�Ƃ��킩�����ꍇ��
+ // ��蒼��������B)
+ }
+ }
+ }
+ }
+ } else if (statement instanceof MethodInvocation) {
+ // �߂�l
+ MethodExecution childMethodExecution = ((MethodInvocation)statement).getCalledMethodExecution();
+ ObjectReference ret = childMethodExecution.getReturnValue();
+ if (ret != null && objectId != null && objectId.equals(ret.getId())) {
+ childMethodExecution.setAugmentation(new DeltaAugmentationInfo());
+ ((DeltaAugmentationInfo)childMethodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(objectId));
+ TracePoint childTracePoint = tracePoint.duplicate();
+ childTracePoint.stepBackNoReturn();
+ calleeSearch(trace, childTracePoint, objList, childMethodExecution.isStatic(), index, aliasCollector); // �Ăяo���������ɒT��
+ if (childMethodExecution.isConstructor()) {
+ // �R���X�g���N�^�Ăяo���������ꍇ
+ if (objectId.equals(srcObject.getId())) {
+ r = new Reference(thisObj, srcObject);
+ r.setCreation(true);
+ eStructure.addSrcSide(r);
+ srcObject = thisObj;
+ trackingObj = srcObject;
+ } else if (objectId.equals(dstObject.getId())) {
+ r = new Reference(thisObj, dstObject);
+ r.setCreation(true);
+ eStructure.addDstSide(r);
+ dstObject = thisObj;
+ trackingObj = dstObject;
+ }
+ if (Trace.isNull(thisObjectId)) objectId = null; // static�ϐ��̏ꍇ
+ else objectId = thisObjectId;
+ objList.set(index, objectId);
+ isResolved = true;
+ isLost = false;
+ continue;
+ }
+ objectId = objList.get(index);
+ if (objectId == null) {
+ // static�Ăяo���̖߂�l�������ꍇ�i���Ԃ�j
+ trackingObj = null;
+ isResolved = true;
+ } else if (objectId.equals(srcObject.getId())) {
+ trackingObj = srcObject;
+ } else if (objectId.equals(dstObject.getId())) {
+ trackingObj = dstObject;
+ }
+ if (isLost) {
+ checkList.add(objList.get(index));
+ isLost = false;
+ }
+ } else {
+ // �I�u�W�F�N�g�̗R�������ڌ�����Ȃ������ꍇ�ł��A�ǂ����̔z��̗v�f�ɗR�����Ă���\��������
+ String retType = ret.getActualType();
+ if (retType.startsWith("[L")) {
+ // �߂�l���z��̏ꍇ
+ if ((trackingObj.getActualType() != null && retType.endsWith(trackingObj.getActualType() + ";"))
+ || (trackingObj.getCalleeType() != null && retType.endsWith(trackingObj.getCalleeType() + ";"))
+ || (trackingObj.getCallerType() != null && retType.endsWith(trackingObj.getCallerType() + ";"))) {
+ // �{���ɂ��̔z��̗v�f����擾���ꂽ���̂Ȃ炱���ŒǐՑΏۂ�u�������āA�Ăяo�����T�����ׂ������A
+ // ���̎��_�ő��̗R���̉\����r���ł��Ȃ��B�����ŒǐՑΏۂ�u�������Ă��܂��ƁA��ŕʂɗR�������邱�Ƃ��킩�����ꍇ��
+ // ��蒼��������B
+ }
+ }
+ }
+ }
+ } while (tracePoint.stepBackOver());
+
+ //�����T��
+ if (argments.contains(new ObjectReference(objectId))) {
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setSetterSide(true); // �������K�v?
+ isResolved = true;
+ }
+ }
+
+ //�R���N�V�����^�Ή�
+ Reference r;
+ if (methodExecution.isCollectionType()) {
+ if (objectId != null) {
+ // �R���N�V�����^�̏ꍇ�A�����ŌX�̗v�f�ڕێ����Ă���Ɖ��肷��
+ if (objectId.equals(srcObject.getId())) {
+ r = new Reference(thisObj, srcObject);
+ r.setCollection(true);
+ eStructure.addSrcSide(r);
+ srcObject = thisObj;
+ } else if(objectId.equals(dstObject.getId())) {
+ r = new Reference(thisObj, dstObject);
+ r.setCollection(true);
+ eStructure.addDstSide(r);
+ dstObject =thisObj;
+ }
+ }
+ objList.set(index, methodExecution.getThisObjId());
+ isResolved = true; // �K�v�Ȃ̂ł�?
+ }
+
+ if (!isResolved && objectId != null) {
+ // �R�����ǂ��ɂ�������Ȃ�����
+ boolean isSrcSide = true;
+ if (objectId.equals(srcObject.getId())) {
+ isSrcSide = true;
+ } else if (objectId.equals(dstObject.getId())) {
+ isSrcSide = false;
+ }
+ if (trackingObj != null) {
+ // �܂��z������̗v�f��R���Ƃ��ċ^��(�������D��)
+ for (int i = 0; i < argments.size(); i++) {
+ ObjectReference argArray = argments.get(i);
+ if (argArray.getActualType().startsWith("[L")
+ && ((trackingObj.getActualType() != null && argArray.getActualType().endsWith(trackingObj.getActualType() + ";"))
+ || (trackingObj.getCalleeType() != null && argArray.getActualType().endsWith(trackingObj.getCalleeType() + ";"))
+ || (trackingObj.getCallerType() != null && argArray.getActualType().endsWith(trackingObj.getCallerType() + ";")))) {
+ // �^����v������z������̗v�f��R���Ƃ݂Ȃ�
+ isResolved = true;
+ objList.set(index, argArray.getId()); // �ǐՑΏۂ�z��v�f����z��ɒu������
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(argArray.getId()));
+ r = new Reference(argArray.getId(), trackingObj.getId(),
+ argArray.getActualType(), trackingObj.getActualType());
+ r.setArray(true);
+ if (isSrcSide) {
+ eStructure.addSrcSide(r);
+ srcObject = new ObjectReference(argArray.getId(), argArray.getActualType());
+ } else {
+ eStructure.addDstSide(r);
+ dstObject = new ObjectReference(argArray.getId(), argArray.getActualType());
+ }
+ objectId = null;
+ break;
+ }
+ }
+ if (objectId != null) {
+ // ���ɔz��t�B�[���h�̗v�f��R���Ƃ��ċ^��(�t�B�[���h�͈�������)
+ int indArg = fieldArrayElements.indexOf(trackingObj);
+ if (indArg != -1) {
+ // �^����v���Ă�̂Ŕz��t�B�[���h�̗v�f��R���Ƃ݂Ȃ�
+ isResolved = true;
+ ObjectReference fieldArray = fieldArrays.get(indArg);
+ objList.set(index, thisObjectId); // �ǐՑΏۂ�this�ɒu������
+ r = new Reference(fieldArray.getId(), trackingObj.getId(),
+ fieldArray.getActualType(), trackingObj.getActualType());
+ r.setArray(true);
+ if (isSrcSide) {
+ eStructure.addSrcSide(r);
+ eStructure.addSrcSide(new Reference(thisObjectId, fieldArray.getId(),
+ methodExecution.getThisClassName(), fieldArray.getActualType()));
+ srcObject = thisObj;
+ } else {
+ eStructure.addDstSide(r);
+ eStructure.addDstSide(new Reference(thisObjectId, fieldArray.getId(),
+ methodExecution.getThisClassName(), fieldArray.getActualType()));
+ dstObject = thisObj;
+ }
+ }
+ }
+ if (trackingObj.getActualType() != null && trackingObj.getActualType().startsWith("[L")) {
+ // �ǂ��ɂ�������Ȃ������ꍇ�A�T���Ă���̂��z��^�Ȃ�A���̃��\�b�h���Ő������ꂽ���̂ƍl����
+ isResolved = true;
+ objList.set(index, thisObjectId); // �ǐՑΏۂ�this�ɒu������
+ if (isSrcSide) {
+ eStructure.addSrcSide(new Reference(thisObjectId, trackingObj.getId(),
+ methodExecution.getThisClassName(), trackingObj.getActualType()));
+ srcObject = thisObj;
+ } else {
+ eStructure.addDstSide(new Reference(thisObjectId, trackingObj.getId(),
+ methodExecution.getThisClassName(), trackingObj.getActualType()));
+ dstObject = thisObj;
+ }
+ }
+ }
+ }
+
+ if (objectId == null && isResolved && !isStatic) { // static �Ăяo������̖߂�l��Ԃ��Ă���ꍇ
+ objList.set(index, thisObjectId); // ������ǐՂ�����
+ if (Trace.isNull(srcObject.getId())) {
+ srcObject = thisObj;
+ } else if (Trace.isNull(dstObject.getId())) {
+ dstObject = thisObj;
+ }
+ }
+
+ if (isStatic && !isResolved) { // ���͋N���肦�Ȃ�?(get�|�C���g�J�b�g���擾����悤�ɂ�������)
+ objList.set(index, null);
+ }
+ if(!isStatic && !isResolved){
+ isLost = true; // final�ϐ�������N���X�ŎQ�Ƃ��Ă���\�������邪�AcalleeSearch()�͕K���Ăяo�����ɕ��A���Ă����̂ŁA�����ł͉������Ȃ�
+ }
+ }
+
+ /**
+ * �v�ύX��̃A���S���Y���̋N�����\�b�h(������)
+ * @param targetRef �ΏۂƂȂ�Q��
+ * @param before �T���J�n�g���[�X�|�C���g(������ȑO��T��)
+ * @return ���o����
+ */
+ public ExtractedStructure extract(Reference targetRef, TracePoint before) {
+ return extract(targetRef, before, defaultAliasCollector);
+ }
+
+ /**
+ * �v�ύX��̃A���S���Y���̋N�����\�b�h(������)
+ * @param targetRef �ΏۂƂȂ�Q��
+ * @param before �T���J�n�g���[�X�|�C���g(������ȑO��T��)
+ * @param aliasCollector �f���^���o���ɒǐՂ����I�u�W�F�N�g�̑S�G�C���A�X�����W���郊�X�i
+ * @return ���o����
+ */
+ public ExtractedStructure extract(Reference targetRef, TracePoint before, IAliasCollector aliasCollector) {
+ TracePoint creationTracePoint;
+ if (targetRef.isArray()) {
+ // srcId �̔z��� dstId ���������Ă���\�������郁�\�b�h���s���擾�i�z���p�̏����j
+ creationTracePoint = trace.getArraySetTracePoint(targetRef, before);
+ } else if (targetRef.isCollection()) {
+ // srcId �̃R���N�V�����^�I�u�W�F�N�g�� dstId ���n����Ă��郁�\�b�h���s���擾�i�R���N�V�����^��p�̏����j
+ creationTracePoint = trace.getCollectionAddTracePoint(targetRef, before);
+ } else if (targetRef.isFinalLocal()) {
+ // srcId �̓����܂��͖����N���X�̃C���X�^���X�� final local �ϐ��ɑ������Ă��� dstId �� �I�u�W�F�N�g���n���ꂽ�\�������郁�\�b�h���s���擾�ifinal local�̋^��������ꍇ�̏����j
+ creationTracePoint = trace.getCreationTracePoint(targetRef.getSrcObject(), before);
+ targetRef = new Reference(creationTracePoint.getMethodExecution().getThisObjId(), targetRef.getDstObjectId(), creationTracePoint.getMethodExecution().getThisClassName(), targetRef.getDstClassName());
+ } else {
+ // �I�u�W�F�N�g�ԎQ�� r ���������ꂽ���\�b�h���s���擾�i�ʏ�j
+ creationTracePoint = trace.getFieldUpdateTracePoint(targetRef, before);
+ }
+ if (creationTracePoint == null) {
+ return null;
+ }
+ return extractSub(creationTracePoint, targetRef, aliasCollector);
+ }
+
+ /**
+ * �v�ύX��̃A���S���Y���̋N�����\�b�h(������)
+ * @param creationTracePoint �I�u�W�F�N�g�ԎQ�Ɛ����g���[�X�|�C���g(�t�B�[���h�ւ̑��)
+ * @return ���o����
+ */
+ public ExtractedStructure extract(TracePoint creationTracePoint) {
+ creationTracePoint = creationTracePoint.duplicate();
+ Statement statement = creationTracePoint.getStatement();
+ if (statement instanceof FieldUpdate) {
+ Reference targetRef = ((FieldUpdate)statement).getReference();
+ return extractSub(creationTracePoint, targetRef, defaultAliasCollector);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * �v�ύX��̃A���S���Y���̋N�����\�b�h(������)
+ * @param creationTracePoint �I�u�W�F�N�g�ԎQ�Ɛ����g���[�X�|�C���g(�t�B�[���h�ւ̑��)
+ * @param aliasCollector �f���^���o���ɒǐՂ����I�u�W�F�N�g�̑S�G�C���A�X�����W���郊�X�i
+ * @return ���o����
+ */
+ public ExtractedStructure extract(TracePoint creationTracePoint, IAliasCollector aliasCollector) {
+ creationTracePoint = creationTracePoint.duplicate();
+ Statement statement = creationTracePoint.getStatement();
+ if (statement instanceof FieldUpdate) {
+ Reference targetRef = ((FieldUpdate)statement).getReference();
+ return extractSub(creationTracePoint, targetRef, aliasCollector);
+ } else {
+ return null;
+ }
+ }
+
+ private ExtractedStructure extractSub(TracePoint creationTracePoint, Reference targetRef, IAliasCollector aliasCollector) {
+ eStructure = new ExtractedStructure();
+ ArrayList objList = new ArrayList();
+ srcObject = targetRef.getSrcObject();
+ dstObject = targetRef.getDstObject();
+if (DEBUG1) {
+ System.out.println("extract delta of:" + targetRef.getSrcObject().getActualType() + "(" + targetRef.getSrcObjectId() + ")" + " -> " + targetRef.getDstObject().getActualType() + "(" + targetRef.getDstObjectId() + ")");
+}
+ if (!Trace.isNull(targetRef.getSrcObjectId())) {
+ objList.add(targetRef.getSrcObjectId());
+ } else {
+ objList.add(null);
+ }
+ if (!Trace.isNull(targetRef.getDstObjectId())) {
+ objList.add(targetRef.getDstObjectId());
+ } else {
+ objList.add(null);
+ }
+ return extractSub2(creationTracePoint, objList, aliasCollector);
+ }
+
+ public ExtractedStructure extract(TracePoint tracePoint, ObjectReference argObj) {
+ return extract(tracePoint, argObj, defaultAliasCollector);
+ }
+
+ public ExtractedStructure extract(TracePoint tracePoint, ObjectReference argObj, IAliasCollector aliasCollector) {
+ MethodExecution methodExecution = tracePoint.getMethodExecution();
+ eStructure = new ExtractedStructure();
+ ArrayList objList = new ArrayList();
+ String thisObjectId = methodExecution.getThisObjId();
+ objList.add(thisObjectId);
+ objList.add(argObj.getId());
+ srcObject = new ObjectReference(thisObjectId, methodExecution.getThisClassName(),
+ Trace.getDeclaringType(methodExecution.getSignature(), methodExecution.isConstructor()), Trace.getDeclaringType(methodExecution.getCallerSideSignature(), methodExecution.isConstructor()));
+ dstObject = argObj;
+if (DEBUG1) {
+ System.out.println("extract delta of:" + methodExecution.getSignature() + " -> " + argObj.getActualType() + "(" + argObj.getId() + ")");
+}
+ return extractSub2(tracePoint, objList, aliasCollector);
+ }
+
+ private ExtractedStructure extractSub2(TracePoint creationTracePoint, ArrayList objList, IAliasCollector aliasCollector) {
+ eStructure.setCreationMethodExecution(creationTracePoint.getMethodExecution());
+ MethodExecution coordinator = callerSearch(trace, creationTracePoint, objList, null, aliasCollector);
+ eStructure.setCoordinator(coordinator);
+if (DEBUG2) {
+ if (((DeltaAugmentationInfo)coordinator.getAugmentation()).isCoodinator()) {
+ System.out.println("Coordinator");
+ } else {
+ System.out.println("Warning");
+ }
+ System.out.println("coordinator:" + coordinator.getSignature());
+ System.out.println("srcSide:");
+ for (int i = 0; i < eStructure.getDelta().getSrcSide().size(); i++) {
+ Reference ref = eStructure.getDelta().getSrcSide().get(i);
+ if (!ref.isCreation() || !ref.getSrcObjectId().equals(ref.getDstObjectId())) {
+ System.out.println("\t" + ref.getSrcClassName() + "(" + ref.getSrcObjectId() + ")" + " -> " + ref.getDstClassName() + "(" + ref.getDstObjectId() + ")");
+ }
+ }
+ System.out.println("dstSide:");
+ for (int i = 0; i < eStructure.getDelta().getDstSide().size(); i++) {
+ Reference ref = eStructure.getDelta().getDstSide().get(i);
+ if (!ref.isCreation() || !ref.getSrcObjectId().equals(ref.getDstObjectId())) {
+ System.out.println("\t" + ref.getSrcClassName() + "(" + ref.getSrcObjectId() + ")" + " -> " + ref.getDstClassName() + "(" + ref.getDstObjectId() + ")");
+ }
+ }
+ System.out.println("overCoordinator:");
+ MethodExecution parent = coordinator.getParent();
+ while (parent != null) {
+ System.out.println("\t" + parent.getSignature());
+ parent = parent.getParent();
+ }
+}
+ return eStructure;
+ }
+
+ /**
+ * ���ۂ̎Q�ƌ��ƎQ�Ɛ�̃I�u�W�F�N�g���w�肵�ăf���^�𒊏o����(�I�����C����͗p)
+ * @param srcObj ��������ɂ���Q�ƌ��I�u�W�F�N�g
+ * @param dstObj ��������ɂ���Q�Ɛ�I�u�W�F�N�g
+ * @param before �T���J�n�g���[�X�|�C���g(������ȑO��T��)
+ * @return�@���o����
+ */
+ public ExtractedStructure extract(Object srcObj, Object dstObj, TracePoint before) {
+ return extract(srcObj, dstObj, before, defaultAliasCollector);
+ }
+
+ /**
+ * �Q�ƌ��ƎQ�Ɛ�̃I�u�W�F�N�g���w�肵�ăf���^�𒊏o����(�I�����C����͗p)
+ * @param srcObj ��������ɂ���Q�ƌ��I�u�W�F�N�g
+ * @param dstObj ��������ɂ���Q�Ɛ�I�u�W�F�N�g
+ * @param before �T���J�n�g���[�X�|�C���g(������ȑO��T��)
+ * @param aliasCollector �f���^���o���ɒǐՂ����I�u�W�F�N�g�̑S�G�C���A�X�����W���郊�X�i
+ * @return�@���o����
+ */
+ public ExtractedStructure extract(Object srcObj, Object dstObj, TracePoint before, IAliasCollector aliasCollector) {
+ Reference targetRef = new Reference(Integer.toString(System.identityHashCode(srcObj)), Integer.toString(System.identityHashCode(dstObj)), null, null);
+ return extract(targetRef, before, aliasCollector);
+ }
+
+ /**
+ * ���\�b�h���s���̃g���[�X�|�C���g�Ǝ��ۂ̎Q�Ɛ�I�u�W�F�N�g���w�肵�ăf���^�𒊏o����(�I�����C����͗p)
+ * @param tracePoint ���\�b�h���s���̃g���[�X�|�C���g
+ * @param arg ��������ɂ���Q�Ɛ�I�u�W�F�N�g(���[�J���ϐ�������ɂ��Q�Ɛ�)
+ * @return ���o����
+ */
+ public ExtractedStructure extract(TracePoint tracePoint, Object arg) {
+ return extract(tracePoint, arg, defaultAliasCollector);
+ }
+
+ /**
+ * ���\�b�h���s���̃g���[�X�|�C���g�Ǝ��ۂ̎Q�Ɛ�I�u�W�F�N�g���w�肵�ăf���^�𒊏o����(�I�����C����͗p)
+ * @param tracePoint ���\�b�h���s���̃g���[�X�|�C���g
+ * @param arg ��������ɂ���Q�Ɛ�I�u�W�F�N�g(���[�J���ϐ�������ɂ��Q�Ɛ�)
+ * @return ���o����
+ */
+ public ExtractedStructure extract(TracePoint tracePoint, Object arg, IAliasCollector aliasCollector) {
+ ObjectReference argObj = new ObjectReference(Integer.toString(System.identityHashCode(arg)));
+ return extract(tracePoint, argObj, aliasCollector);
+ }
+
+ /**
+ * �w�肵���X���b�h��Ō��ݎ��s���̃��\�b�h���s���擾����(�I�����C����͗p)
+ * @param thread �ΏۃX���b�h
+ * @return thread ��Ō��ݎ��s���̃��\�b�h���s
+ */
+ public MethodExecution getCurrentMethodExecution(Thread thread) {
+ return trace.getCurrentMethodExecution(thread);
+ }
+
+ /**
+ * methodSignature �ɑO����v���郁�\�b�h���������\�b�h�̍Ō�̎��s
+ * @param methodSignature ���\�b�h��(�O����v��������)
+ * @return �Y������Ō�̃��\�b�h���s
+ */
+ public MethodExecution getLastMethodExecution(String methodSignature) {
+ return trace.getLastMethodExecution(methodSignature);
+ }
+
+ /**
+ * methodSignature �ɑO����v���郁�\�b�h���������\�b�h�� before �ȑO�̍Ō�̎��s
+ * @param methodSignature ���\�b�h��(�O����v��������)
+ * @param before�@�T���J�n�g���[�X�|�C���g(������ȑO��T��)
+ * @return�@�Y������Ō�̃��\�b�h���s
+ */
+ public MethodExecution getLastMethodExecution(String methodSignature, TracePoint before) {
+ return trace.getLastMethodExecution(methodSignature, before);
+ }
+
+ public ArrayList getMethodExecutions(String methodSignature) {
+ return trace.getMethodExecutions(methodSignature);
+ }
+
+// public ExtractedStructure extract(MethodExecution caller, MethodExecution callee) {
+// eStructure = new ExtractedStructure();
+// ArrayList objList = new ArrayList();
+// String thisObjectId = caller.getThisObjId();
+// objList.add(thisObjectId);
+// objList.add(callee.getThisObjId());
+// srcObject = new ObjectReference(thisObjectId, caller.getThisClassName(),
+// Trace.getDeclaringType(caller.getSignature(), caller.isConstractor()), Trace.getDeclaringType(caller.getCallerSideSignature(), caller.isConstractor()));
+// dstObject = new ObjectReference(callee.getThisObjId(), callee.getThisClassName(),
+// Trace.getDeclaringType(callee.getSignature(), callee.isConstractor()), Trace.getDeclaringType(callee.getCallerSideSignature(), callee.isConstractor()));
+//if (DEBUG1) {
+// System.out.println("extract delta of:" + caller.getSignature() + " -> " + callee.getSignature());
+//}
+//
+// caller = new MethodExecution(caller); // ��͗p�p�����[�^���������������̂��g�p����
+// eStructure.setCreationMethodExecution(caller);
+// MethodExecution coordinator = callerSearch(trace, caller, objList, null);
+// eStructure.setCoordinator(coordinator);
+//if (DEBUG2) {
+// if (coordinator.isCoodinator()) {
+// System.out.println("Coordinator");
+// } else {
+// System.out.println("Warning");
+// }
+// System.out.println("coordinator:" + coordinator.getSignature());
+// System.out.println("srcSide:");
+// for (int i = 0; i < eStructure.getDelta().getSrcSide().size(); i++) {
+// Reference ref = eStructure.getDelta().getSrcSide().get(i);
+// if (!ref.isCreation() || !ref.getSrcObjectId().equals(ref.getDstObjectId())) {
+// System.out.println("\t" + ref.getSrcClassName() + "(" + ref.getSrcObjectId() + ")" + " -> " + ref.getDstClassName() + "(" + ref.getDstObjectId() + ")");
+// }
+// }
+// System.out.println("dstSide:");
+// for (int i = 0; i < eStructure.getDelta().getDstSide().size(); i++) {
+// Reference ref = eStructure.getDelta().getDstSide().get(i);
+// if (!ref.isCreation() || !ref.getSrcObjectId().equals(ref.getDstObjectId())) {
+// System.out.println("\t" + ref.getSrcClassName() + "(" + ref.getSrcObjectId() + ")" + " -> " + ref.getDstClassName() + "(" + ref.getDstObjectId() + ")");
+// }
+// }
+// System.out.println("overCoordinator:");
+// MethodExecution parent = coordinator.getParent();
+// while (parent != null) {
+// System.out.println("\t" + parent.getSignature());
+// parent = parent.getParent();
+// }
+//}
+// return eStructure;
+// }
+//
+//
+// /**
+// * ���\�b�h�̈����Ƃ��ăI�u�W�F�N�g���Q�Ƃ����ꍇ�̃f���^�𒊏o����
+// * @param caller �Q�ƌ��̃��\�b�h
+// * @param argObj �����Ƃ��ĎQ�Ƃ����I�u�W�F�N�g
+// * @return�@���o����
+// */
+// public ExtractedStructure extract(MethodExecution caller, ObjectReference argObj) {
+// eStructure = new ExtractedStructure();
+// ArrayList objList = new ArrayList();
+// String thisObjectId = caller.getThisObjId();
+// objList.add(thisObjectId);
+// objList.add(argObj.getId());
+// srcObject = new ObjectReference(thisObjectId, caller.getThisClassName(),
+// Trace.getDeclaringType(caller.getSignature(), caller.isConstractor()), Trace.getDeclaringType(caller.getCallerSideSignature(), caller.isConstractor()));
+// dstObject = argObj;
+//if (DEBUG1) {
+// System.out.println("extract delta of:" + caller.getSignature() + " -> " + argObj.getActualType() + "(" + argObj.getId() + ")");
+//}
+//
+// caller = new MethodExecution(caller); // ��͗p�p�����[�^���������������̂��g�p����
+// eStructure.setCreationMethodExecution(caller);
+// MethodExecution coordinator = callerSearch(trace, caller, objList, null);
+// eStructure.setCoordinator(coordinator);
+//if (DEBUG2) {
+// if (coordinator.isCoodinator()) {
+// System.out.println("Coordinator");
+// } else {
+// System.out.println("Warning");
+// }
+// System.out.println("coordinator:" + coordinator.getSignature());
+// System.out.println("srcSide:");
+// for (int i = 0; i < eStructure.getDelta().getSrcSide().size(); i++) {
+// Reference ref = eStructure.getDelta().getSrcSide().get(i);
+// if (!ref.isCreation() || !ref.getSrcObjectId().equals(ref.getDstObjectId())) {
+// System.out.println("\t" + ref.getSrcClassName() + "(" + ref.getSrcObjectId() + ")" + " -> " + ref.getDstClassName() + "(" + ref.getDstObjectId() + ")");
+// }
+// }
+// System.out.println("dstSide:");
+// for (int i = 0; i < eStructure.getDelta().getDstSide().size(); i++) {
+// Reference ref = eStructure.getDelta().getDstSide().get(i);
+// if (!ref.isCreation() || !ref.getSrcObjectId().equals(ref.getDstObjectId())) {
+// System.out.println("\t" + ref.getSrcClassName() + "(" + ref.getSrcObjectId() + ")" + " -> " + ref.getDstClassName() + "(" + ref.getDstObjectId() + ")");
+// }
+// }
+// System.out.println("overCoordinator:");
+// MethodExecution parent = coordinator.getParent();
+// while (parent != null) {
+// System.out.println("\t" + parent.getSignature());
+// parent = parent.getParent();
+// }
+//}
+// return eStructure;
+// }
+}
diff --git a/src/org/ntlab/deltaExtractor/DeltaExtractorJSON.java b/src/org/ntlab/deltaExtractor/DeltaExtractorJSON.java
new file mode 100644
index 0000000..25c38e5
--- /dev/null
+++ b/src/org/ntlab/deltaExtractor/DeltaExtractorJSON.java
@@ -0,0 +1,622 @@
+package org.ntlab.deltaExtractor;
+
+import java.util.AbstractMap;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.ntlab.trace.ArrayAccess;
+import org.ntlab.trace.ArrayCreate;
+import org.ntlab.trace.FieldAccess;
+import org.ntlab.trace.FieldUpdate;
+import org.ntlab.trace.MethodExecution;
+import org.ntlab.trace.MethodInvocation;
+import org.ntlab.trace.ObjectReference;
+import org.ntlab.trace.Reference;
+import org.ntlab.trace.Statement;
+import org.ntlab.trace.Trace;
+import org.ntlab.trace.TraceJSON;
+import org.ntlab.trace.TracePoint;
+
+/**
+ * �f���^���o�A���S���Y��(�z��ւ̃A�N�Z�X�����m�ł���Javassist��JSON�g���[�X�ɑΉ����A�A���S���Y����P����)
+ *
+ * @author Nitta
+ *
+ */
+public class DeltaExtractorJSON extends DeltaExtractor {
+ public DeltaExtractorJSON(String traceFile) {
+ super(new TraceJSON(traceFile));
+ }
+
+ public DeltaExtractorJSON(TraceJSON trace) {
+ super(trace);
+ }
+
+// /**
+// * �f���^���o�A���S���Y���̌Ăяo�����T�������icalleeSearch�Ƒ��ݍċA�ɂȂ��Ă���j
+// * @param trace�@��͑Ώۃg���[�X
+// * @param methodExecution �T�����郁�\�b�h���s
+// * @param objList�@�ǐՒ��̃I�u�W�F�N�g
+// * @param child�@���O�ɒT�����Ă����Ăяo����̃��\�b�h���s
+// * @return ���������R�[�f�B�l�[�^
+// * @throws TraceFileException
+// */
+// protected MethodExecution callerSearch(Trace trace, TracePoint tracePoint, ArrayList objList, MethodExecution childMethodExecution) {
+// return callerSearch(trace, tracePoint, objList, childMethodExecution, new IAliasCollector() {
+// @Override
+// public void addAlias(Alias alias) {
+// }
+// @Override
+// public void changeTrackingObject(String from, String to) {
+// }
+// });
+// }
+
+ /**
+ * �f���^���o�A���S���Y���̌Ăяo�����T�������icalleeSearch�Ƒ��ݍċA�ɂȂ��Ă���j
+ * @param trace�@��͑Ώۃg���[�X
+ * @param methodExecution �T�����郁�\�b�h���s
+ * @param objList�@�ǐՒ��̃I�u�W�F�N�g
+ * @param child�@���O�ɒT�����Ă����Ăяo����̃��\�b�h���s
+ * @return ���������R�[�f�B�l�[�^
+ * @throws TraceFileException
+ */
+ protected MethodExecution callerSearch(Trace trace, TracePoint tracePoint, ArrayList objList, MethodExecution childMethodExecution, IAliasCollector aliasCollector) {
+ MethodExecution methodExecution = tracePoint.getMethodExecution();
+ methodExecution.setAugmentation(new DeltaAugmentationInfo());
+ eStructure.createParent(methodExecution);
+ String thisObjectId = methodExecution.getThisObjId();
+ ArrayList removeList = new ArrayList(); // �ǐՂ��Ă���I�u�W�F�N�g���ō폜�ΏۂƂȂ��Ă������
+ ArrayList creationList = new ArrayList(); // ���̃��\�b�h���s���ɐ������ꂽ�I�u�W�F�N�g
+ int existsInFields = 0; // ���̃��\�b�h���s���Ńt�B�[���h�ɗR�����Ă���I�u�W�F�N�g�̐�(1�ȏ�Ȃ炱�̃��\�b�h���s����this�Ɉˑ�)
+ boolean isTrackingThis = false; // �Ăяo�����this�Ɉˑ�����
+ boolean isSrcSide = true; // �Q�ƌ����Q�Ɛ�̂�����̑��̃I�u�W�F�N�g�̗R�������ǂ���this�I�u�W�F�N�g�ɓ��B������?
+ ObjectReference thisObj = new ObjectReference(thisObjectId, methodExecution.getThisClassName(),
+ Trace.getDeclaringType(methodExecution.getSignature(), methodExecution.isConstructor()), Trace.getDeclaringType(methodExecution.getCallerSideSignature(), methodExecution.isConstructor()));
+
+ HashMap aliasList = new HashMap<>();
+
+ if (childMethodExecution == null) {
+ // �T���J�n���͈�U�폜���A�Ăяo�����̒T���𑱂���ۂɕ���������
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ isTrackingThis = true; // �Ăяo�����T���O�ɕ���
+ }
+
+ if (childMethodExecution != null && objList.contains(childMethodExecution.getThisObjId())) {
+ // �Ăяo�����this�Ɉˑ�����
+ if (thisObjectId.equals(childMethodExecution.getThisObjId())) {
+ // �I�u�W�F�N�g���Ăяo���̂Ƃ��݈̂�U�폜���A�Ăяo�����̒T���𑱂���ۂɕ���������
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ isTrackingThis = true; // �Ăяo�����T���O�ɕ���
+ }
+
+ aliasCollector.addAlias(new Alias(Alias.AliasType.RECEIVER, 0, childMethodExecution.getThisObjId(), tracePoint.duplicate()));
+ }
+
+ if (childMethodExecution != null) {
+ for (String objId : objList) {
+ if (!objId.equals(childMethodExecution.getThisObjId())) {
+ aliasCollector.addAlias(new Alias(Alias.AliasType.ACTUAL_ARGUMENT, -1, objId, tracePoint.duplicate())); // argIndex�͕s��
+ }
+ }
+ }
+
+ if (childMethodExecution != null && childMethodExecution.isConstructor()) {
+ // �Ăяo���悪�R���X�g���N�^�������ꍇ
+ int newIndex = objList.indexOf(childMethodExecution.getThisObjId());
+ if (newIndex != -1) {
+ // �Ăяo���悪�ǐՑΏۂ̃R���X�g���N�^��������field�Ɠ��l�ɏ���
+ removeList.add(childMethodExecution.getThisObjId());
+ existsInFields++;
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ }
+ }
+
+ if (childMethodExecution != null && Trace.getMethodName(childMethodExecution.getSignature()).startsWith("access$")) {
+ // �G���N���[�W���O�C���X�^���X�ɑ��郁�\�b�h�Ăяo���������ꍇ
+ String enclosingObj = childMethodExecution.getArguments().get(0).getId(); // �G���N���[�W���O�C���X�^���X�͑������ɓ����Ă���炵��
+ int encIndex = objList.indexOf(enclosingObj);
+ if (encIndex != -1) {
+ // thisObject �ɒu����������Afield�Ɠ��l�ɏ���
+ removeList.add(enclosingObj);
+ existsInFields++;
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ }
+ }
+
+ // �߂�l�ɒT���Ώۂ��܂܂�Ă����calleeSearch���ċA�Ăяo��
+ while (tracePoint.stepBackOver()) {
+ Statement statement = tracePoint.getStatement();
+ // ���ڎQ�ƁA�t�B�[���h�Q�Ƃ���єz��A�N�Z�X�̒T��
+ if (statement instanceof FieldAccess) {
+ FieldAccess fs = (FieldAccess)statement;
+ String refObjectId = fs.getValueObjId();
+ int index = objList.indexOf(refObjectId);
+ if (index != -1) {
+ String ownerObjectId = fs.getContainerObjId();
+
+ if (ownerObjectId.equals(thisObjectId)) {
+ // �t�B�[���h�Q�Ƃ̏ꍇ
+ removeList.add(refObjectId);
+ existsInFields++; // set�������get�����o������\��������
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ aliasList.put(refObjectId, new Alias(Alias.AliasType.FIELD, 0, refObjectId, tracePoint.duplicate()));
+ } else {
+ // ���ڎQ�Ƃ̏ꍇ
+ if (refObjectId.equals(srcObject.getId())) {
+ eStructure.addSrcSide(new Reference(ownerObjectId, refObjectId,
+ fs.getContainerClassName(), srcObject.getActualType()));
+ srcObject = new ObjectReference(ownerObjectId, fs.getContainerClassName());
+ } else if(refObjectId.equals(dstObject.getId())) {
+ eStructure.addDstSide(new Reference(ownerObjectId, refObjectId,
+ fs.getContainerClassName(), dstObject.getActualType()));
+ dstObject = new ObjectReference(ownerObjectId, fs.getContainerClassName());
+ }
+ objList.set(index, ownerObjectId);
+ aliasCollector.addAlias(new Alias(Alias.AliasType.FIELD, 0, refObjectId, tracePoint.duplicate()));
+ aliasCollector.changeTrackingObject(refObjectId, ownerObjectId); //�ǐՑΏۃI�u�W�F�N�g�̐�ւ�
+ aliasCollector.addAlias(new Alias(Alias.AliasType.CONTAINER, 0, ownerObjectId, tracePoint.duplicate()));
+ }
+ }
+ } else if (statement instanceof ArrayAccess) {
+ ArrayAccess aa = (ArrayAccess)statement;
+ String elementObjectId = aa.getValueObjectId();
+ int index = objList.indexOf(elementObjectId);
+ if (index != -1) {
+ // �z��A�N�Z�X�̏ꍇ
+ String arrayObjectId = aa.getArrayObjectId();
+ if (elementObjectId.equals(srcObject.getId())) {
+ eStructure.addSrcSide(new Reference(arrayObjectId, elementObjectId,
+ aa.getArrayClassName(), srcObject.getActualType()));
+ srcObject = new ObjectReference(arrayObjectId, aa.getArrayClassName());
+ } else if(elementObjectId.equals(dstObject.getId())) {
+ eStructure.addDstSide(new Reference(arrayObjectId, elementObjectId,
+ aa.getArrayClassName(), dstObject.getActualType()));
+ dstObject = new ObjectReference(arrayObjectId, aa.getArrayClassName());
+ }
+ objList.set(index, arrayObjectId);
+ aliasCollector.addAlias(new Alias(Alias.AliasType.ARRAY_ELEMENT, aa.getIndex(), elementObjectId, tracePoint.duplicate()));
+ aliasCollector.changeTrackingObject(elementObjectId, arrayObjectId); //�ǐՑΏۃI�u�W�F�N�g�̐�ւ�
+ aliasCollector.addAlias(new Alias(Alias.AliasType.ARRAY, 0, arrayObjectId, tracePoint.duplicate()));
+ }
+ } else if (statement instanceof ArrayCreate) {
+ ArrayCreate ac = (ArrayCreate)statement;
+ String arrayObjectId = ac.getArrayObjectId();
+ int index = objList.indexOf(arrayObjectId);
+ if (index != -1) {
+ // �z���̏ꍇfield�Ɠ��l�ɏ���
+ creationList.add(arrayObjectId);
+ removeList.add(arrayObjectId);
+ existsInFields++;
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ aliasList.put(arrayObjectId, new Alias(Alias.AliasType.ARRAY_CREATE, 0, arrayObjectId, tracePoint.duplicate()));
+ }
+ } else if (statement instanceof MethodInvocation) {
+ MethodExecution prevChildMethodExecution = ((MethodInvocation)statement).getCalledMethodExecution();
+ if (!prevChildMethodExecution.equals(childMethodExecution)) {
+ // �߂�l
+ ObjectReference ret = prevChildMethodExecution.getReturnValue();
+ if (ret != null) {
+ int retIndex = -1;
+ retIndex = objList.indexOf(ret.getId());
+ if (retIndex != -1) {
+ // �߂�l���R��������
+ prevChildMethodExecution.setAugmentation(new DeltaAugmentationInfo());
+
+ if (prevChildMethodExecution.isConstructor()) {
+ // �ǐՑΏۂ�constractor���Ă�ł�����(�I�u�W�F�N�g�̐�����������)field�Ɠ��l�ɏ���
+ String newObjId = ret.getId();
+ creationList.add(newObjId);
+ removeList.add(newObjId);
+ existsInFields++;
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ ((DeltaAugmentationInfo)prevChildMethodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(newObjId)); // �ǐՑΏ�
+ ((DeltaAugmentationInfo)prevChildMethodExecution.getAugmentation()).setSetterSide(false); // getter�Ăяo���Ɠ��l
+ aliasList.put(newObjId, new Alias(Alias.AliasType.CONSTRACTOR_INVOCATION, 0, newObjId, tracePoint.duplicate()));
+ continue;
+ }
+ String retObj = objList.get(retIndex);
+ aliasCollector.addAlias(new Alias(Alias.AliasType.METHOD_INVOCATION, 0, retObj, tracePoint.duplicate()));
+ if (removeList.contains(retObj)) {
+ // ��xget�Ō��o���ăt�B�[���h�Ɉˑ����Ă���Ɣ��f�������{���̗R�����߂�l���������Ƃ����������̂ŁA�t�B�[���h�ւ̈ˑ����L�����Z������
+ removeList.remove(retObj);
+ existsInFields--;
+ if (existsInFields == 0) {
+ removeList.remove(thisObjectId);
+ }
+ }
+ ((DeltaAugmentationInfo)prevChildMethodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(retObj)); // �ǐՑΏ�
+ TracePoint prevChildTracePoint = tracePoint.duplicate();
+ prevChildTracePoint.stepBackNoReturn();
+ calleeSearch(trace, prevChildTracePoint, objList, prevChildMethodExecution.isStatic(), retIndex, aliasCollector); // �Ăяo�����T��
+ if (objList.get(retIndex) != null && objList.get(retIndex).equals(prevChildMethodExecution.getThisObjId())) {
+ if ( thisObjectId.equals(prevChildMethodExecution.getThisObjId())) {
+ // �Ăяo����Ńt�B�[���h�Ɉˑ����Ă����ꍇ�̏���
+ removeList.add(thisObjectId); // ��ň�U�AthisObject ����菜��
+ isTrackingThis = true; // �Ăяo�����T���O�ɕ���
+ }
+ aliasCollector.addAlias(new Alias(Alias.AliasType.RECEIVER, 0, objList.get(retIndex), tracePoint.duplicate()));
+ }
+ if (isLost) {
+ checkList.add(objList.get(retIndex));
+ isLost = false;
+ }
+ }
+ }
+ }
+ }
+ }
+ // --- ���̎��_�� tracePoint �͌Ăяo�������w���Ă��� ---
+
+ // �R���N�V�����^�Ή�
+ if (methodExecution.isCollectionType()) {
+ objList.add(thisObjectId);
+ }
+
+ // �����̎擾
+ ArrayList arguments = methodExecution.getArguments();
+
+ // �����ƃt�B�[���h�ɓ���ID�̃I�u�W�F�N�g������ꍇ��z��
+ Reference r;
+ for (int i = 0; i < removeList.size(); i++) {
+ String removeId = removeList.get(i);
+ if (arguments.contains(new ObjectReference(removeId))) {
+ removeList.remove(removeId); // �t�B�[���h�ƈ����̗����ɒǐՑΏۂ����݂����ꍇ�A������D��(���A�P�[�X)
+ } else if(objList.contains(removeId)) {
+ // �t�B�[���h�ɂ����Ȃ������ꍇ(�������A�I�u�W�F�N�g�̐������t�B�[���h�Ɠ��l�Ɉ���)
+ objList.remove(removeId); // �ǐՑΏۂ���O��
+ if (!removeId.equals(thisObjectId)) {
+ // �t�B�[���h�ithis ���� removeId �ւ̎Q�Ɓj���f���^�̍\���v�f�ɂȂ�
+ if (removeId.equals(srcObject.getId())) {
+ r = new Reference(thisObj, srcObject);
+ r.setCreation(creationList.contains(removeId)); // �I�u�W�F�N�g�̐�����?
+ eStructure.addSrcSide(r);
+ srcObject = thisObj;
+ isSrcSide = true;
+ } else if (removeId.equals(dstObject.getId())) {
+ r = new Reference(thisObj, dstObject);
+ r.setCreation(creationList.contains(removeId)); // �I�u�W�F�N�g�̐�����?
+ eStructure.addDstSide(r);
+ dstObject = thisObj;
+ isSrcSide = false;
+ }
+ aliasCollector.addAlias(aliasList.get(removeId));
+ aliasCollector.changeTrackingObject(removeId, thisObjectId);
+ aliasCollector.addAlias(new Alias(Alias.AliasType.THIS, 0, thisObjectId, aliasList.get(removeId).getOccurrencePoint()));
+ }
+ }
+ }
+ // --- ���̎��_�� this ���ǐՑΏۂł������Ƃ��Ă� objList �̒����炢������폜����Ă��� ---
+
+ // �����T��
+ boolean existsInAnArgument = false;
+ for (int i = 0; i < objList.size(); i++) {
+ String objectId = objList.get(i);
+ if (objectId != null) {
+ ObjectReference trackingObj = new ObjectReference(objectId);
+ if (arguments.contains(trackingObj)) {
+ // �������R��������
+ existsInAnArgument = true;
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(objectId));
+ aliasCollector.addAlias(new Alias(Alias.AliasType.FORMAL_PARAMETER, arguments.indexOf(trackingObj), trackingObj.getId(), methodExecution.getEntryPoint()));
+ } else {
+ // �R�����ǂ��ɂ�������Ȃ�����
+ boolean isSrcSide2 = true;
+ trackingObj = null;
+ if (objectId.equals(srcObject.getId())) {
+ isSrcSide2 = true;
+ trackingObj = srcObject;
+ } else if (objectId.equals(dstObject.getId())) {
+ isSrcSide2 = false;
+ trackingObj = dstObject;
+ }
+ }
+ }
+ }
+ if (existsInAnArgument) {
+ // ������1�ł��ǐՑΏۂ����݂����ꍇ
+ if (existsInFields > 0 || isTrackingThis) {
+ // this�I�u�W�F�N�g��ǐՒ��̏ꍇ
+ if (!Trace.isNull(thisObjectId)) {
+ objList.add(thisObjectId); // ����ɒT������ꍇ�A��U��菜���� thisObject ��
+ } else {
+ objList.add(null); // ������static�Ăяo���������ꍇ�A����ȏ�ǐՂ��Ȃ�
+ }
+ }
+ if (tracePoint.isValid()) {
+ finalCount = 0;
+ return callerSearch(trace, tracePoint, objList, methodExecution, aliasCollector); // �Ăяo����������ɒT��
+ }
+ }
+
+ for (int i = 0; i < objList.size(); i++) {
+ objList.remove(null);
+ }
+ if (objList.isEmpty()) {
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setCoodinator(true);
+ } else {
+ // �R���������ł��Ȃ�����
+ if (!methodExecution.isStatic()) {
+ finalCount++;
+ if (finalCount <= LOST_DECISION_EXTENSION) {
+ // final�ϐ����Q�Ƃ��Ă���ꍇ�R���������ł��Ȃ��\��������̂ŁA�ǐՂ������I�������P�\���Ԃ�݂���
+ if (tracePoint.isValid()) {
+ MethodExecution c = callerSearch(trace, tracePoint, objList, methodExecution, aliasCollector); // �Ăяo����������ɒT��
+ if (((DeltaAugmentationInfo)c.getAugmentation()).isCoodinator()) {
+ methodExecution = c; // �ǐՂ𑱂������ʃR�[�f�B�l�[�^����������
+ }
+ }
+ } else if (thisObj.getActualType().contains("$")) {
+ // �����������܂��͖����N���X�̏ꍇ�A���������I�u�W�F�N�g���O�����\�b�h�̓���final�ϐ�����擾�����Ƃ݂Ȃ��A����Ɏ����̒��̃t�B�[���h�̈��Ƃ݂Ȃ�
+ for (int i = objList.size() - 1; i >= 0; i--) {
+ String objectId = objList.get(i);
+ if (objectId != null) {
+ ObjectReference trackingObj = new ObjectReference(objectId);
+ boolean isSrcSide2 = true;
+ trackingObj = null;
+ if (objectId.equals(srcObject.getId())) {
+ isSrcSide2 = true;
+ trackingObj = srcObject;
+ } else if (objectId.equals(dstObject.getId())) {
+ isSrcSide2 = false;
+ trackingObj = dstObject;
+ }
+ if (trackingObj != null) {
+ r = new Reference(thisObjectId, trackingObj.getId(),
+ methodExecution.getThisClassName(), trackingObj.getActualType());
+ r.setFinalLocal(true);
+ if (isSrcSide2) {
+ eStructure.addSrcSide(r);
+ srcObject = thisObj;
+ isSrcSide = true;
+ } else {
+ eStructure.addDstSide(r);
+ dstObject = thisObj;
+ isSrcSide = false;
+ }
+ existsInFields++;
+ objList.remove(objectId);
+ }
+ }
+ }
+ }
+ }
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setCoodinator(false);
+ }
+ finalCount = 0;
+ return methodExecution;
+ }
+
+ /**
+ * �f���^���o�A���S���Y���̌Ăяo����T������(�ċA�Ăяo���ɂȂ��Ă���)
+ * @param trace ��͑Ώۃg���[�X
+ * @param methodExecution �T�����郁�\�b�h���s
+ * @param objList �ǐՒ��̃I�u�W�F�N�g
+ * @param isStatic�@�ÓI���\�b�h���ۂ�
+ * @param index�@objList���̂ǂ̃I�u�W�F�N�g��ǐՂ��Ă��̃��\�b�h���s�ɓ����Ă����̂�
+ * @throws TraceFileException
+ */
+ protected void calleeSearch(Trace trace, TracePoint tracePoint, ArrayList objList, Boolean isStatic, int index, IAliasCollector aliasCollector) {
+ MethodExecution methodExecution = tracePoint.getMethodExecution();
+ Boolean isResolved = false;
+ String objectId = objList.get(index); // calleeSearch() �ł͒ǐՑΏۂ̃I�u�W�F�N�g�͈�����A��objList��index�Ԗڂ̗v�f�ȊO�ύX���Ă͂����Ȃ�
+ String thisObjectId = methodExecution.getThisObjId();
+ ObjectReference thisObj = new ObjectReference(thisObjectId, methodExecution.getThisClassName(),
+ Trace.getDeclaringType(methodExecution.getSignature(), methodExecution.isConstructor()),
+ Trace.getDeclaringType(methodExecution.getCallerSideSignature(), methodExecution.isConstructor()));
+
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setSetterSide(false); // ��{�I��getter�Ăяo���̂͂������A����
+ ArrayList arguments = methodExecution.getArguments();
+ ObjectReference trackingObj = null;
+
+ aliasCollector.addAlias(new Alias(Alias.AliasType.RETURN_VALUE, 0, objectId, tracePoint.duplicate()));
+ //static���o�R�����null�������Ă��鎞������
+ if (objectId != null) {
+ String returnType = Trace.getReturnType(methodExecution.getSignature());
+ if (objectId.equals(srcObject.getId())) {
+ trackingObj = srcObject;
+ trackingObj.setCalleeType(returnType);
+ } else if(objectId.equals(dstObject.getId())) {
+ trackingObj = dstObject;
+ trackingObj.setCalleeType(returnType);
+ } else {
+ trackingObj = new ObjectReference(objectId, null, returnType);
+ }
+
+ Reference r;
+ // �߂�l�ɒT���Ώۂ��܂܂�Ă����calleeSearch�Ăяo��
+ do {
+ if (!tracePoint.isValid()) break;
+ Statement statement = tracePoint.getStatement();
+ // ���ڎQ�Ƃ���уt�B�[���h�Q�Ƃ̒T��
+ if (statement instanceof FieldAccess) {
+ FieldAccess fs = (FieldAccess)statement;
+ if (objectId != null && objectId.equals(fs.getValueObjId())) {
+ String ownerObjectId = fs.getContainerObjId();
+ if (ownerObjectId.equals(thisObjectId)) {
+ // �t�B�[���h�Q�Ƃ̏ꍇ
+ if (objectId.equals(srcObject.getId())) {
+ eStructure.addSrcSide(new Reference(thisObj, srcObject));
+ srcObject = thisObj;
+ trackingObj = srcObject;
+ } else if(objectId.equals(dstObject.getId())) {
+ eStructure.addDstSide(new Reference(thisObj, dstObject));
+ dstObject = thisObj;
+ trackingObj = dstObject;
+ }
+ aliasCollector.addAlias(new Alias(Alias.AliasType.FIELD, 0, objectId, tracePoint.duplicate()));
+ aliasCollector.changeTrackingObject(objectId, ownerObjectId);
+ aliasCollector.addAlias(new Alias(Alias.AliasType.THIS, 0, ownerObjectId, tracePoint.duplicate()));
+ if (Trace.isNull(thisObjectId)) objectId = null; // static�ϐ��̏ꍇ
+ else objectId = thisObjectId;
+ objList.set(index, objectId);
+ } else {
+ // ���ڎQ�Ƃ̏ꍇ
+ if (objectId.equals(srcObject.getId())) {
+ eStructure.addSrcSide(new Reference(ownerObjectId, objectId,
+ fs.getContainerClassName(), srcObject.getActualType()));
+ srcObject = new ObjectReference(ownerObjectId, fs.getContainerClassName());
+ trackingObj = srcObject;
+ } else if(objectId.equals(dstObject.getId())) {
+ eStructure.addDstSide(new Reference(ownerObjectId, objectId,
+ fs.getContainerClassName(), dstObject.getActualType()));
+ dstObject = new ObjectReference(ownerObjectId, fs.getContainerClassName());
+ trackingObj = dstObject;
+ }
+ aliasCollector.addAlias(new Alias(Alias.AliasType.FIELD, 0, objectId, tracePoint.duplicate()));
+ aliasCollector.changeTrackingObject(objectId, ownerObjectId);
+ aliasCollector.addAlias(new Alias(Alias.AliasType.CONTAINER, 0, ownerObjectId, tracePoint.duplicate()));
+ if (Trace.isNull(ownerObjectId)) objectId = null; // static�ϐ��̏ꍇ
+ else objectId = ownerObjectId;
+ objList.set(index, objectId);
+ }
+ isResolved = true;
+ }
+ } else if (statement instanceof ArrayAccess) {
+ ArrayAccess aa = (ArrayAccess)statement;
+ if (objectId != null && objectId.equals(aa.getValueObjectId())) {
+ // �z��A�N�Z�X�̏ꍇ
+ String arrayObjectId = aa.getArrayObjectId();
+ if (objectId.equals(srcObject.getId())) {
+ eStructure.addSrcSide(new Reference(arrayObjectId, objectId,
+ aa.getArrayClassName(), srcObject.getActualType()));
+ srcObject = new ObjectReference(arrayObjectId, aa.getArrayClassName());
+ trackingObj = srcObject;
+ } else if(objectId.equals(dstObject.getId())) {
+ eStructure.addDstSide(new Reference(arrayObjectId, objectId,
+ aa.getArrayClassName(), dstObject.getActualType()));
+ dstObject = new ObjectReference(arrayObjectId, aa.getArrayClassName());
+ trackingObj = dstObject;
+ }
+ aliasCollector.addAlias(new Alias(Alias.AliasType.ARRAY_ELEMENT, aa.getIndex(), objectId, tracePoint.duplicate()));
+ aliasCollector.changeTrackingObject(objectId, arrayObjectId);
+ aliasCollector.addAlias(new Alias(Alias.AliasType.ARRAY, 0, arrayObjectId, tracePoint.duplicate()));
+ objectId = arrayObjectId;
+ objList.set(index, objectId);
+ isResolved = true;
+ }
+ } else if (statement instanceof ArrayCreate) {
+ ArrayCreate ac = (ArrayCreate)statement;
+ if (objectId != null && objectId.equals(ac.getArrayObjectId())) {
+ // �z���̏ꍇ
+ if (objectId.equals(srcObject.getId())) {
+ eStructure.addSrcSide(new Reference(thisObj, srcObject));
+ srcObject = thisObj;
+ trackingObj = srcObject;
+ } else if(objectId.equals(dstObject.getId())) {
+ eStructure.addDstSide(new Reference(thisObj, dstObject));
+ dstObject = thisObj;
+ trackingObj = dstObject;
+ }
+ aliasCollector.addAlias(new Alias(Alias.AliasType.ARRAY_CREATE, 0, ac.getArrayObjectId(), tracePoint.duplicate()));
+ aliasCollector.changeTrackingObject(ac.getArrayObjectId(), thisObjectId);
+ aliasCollector.addAlias(new Alias(Alias.AliasType.THIS, 0, thisObjectId, tracePoint.duplicate()));
+ if (Trace.isNull(thisObjectId)) objectId = null; // static�ϐ��̏ꍇ
+ else objectId = thisObjectId;
+ objList.set(index, objectId);
+ }
+ } else if (statement instanceof MethodInvocation) {
+ // �߂�l
+ MethodExecution childMethodExecution = ((MethodInvocation)statement).getCalledMethodExecution();
+ ObjectReference ret = childMethodExecution.getReturnValue();
+ if (ret != null && objectId != null && objectId.equals(ret.getId())) {
+ childMethodExecution.setAugmentation(new DeltaAugmentationInfo());
+ ((DeltaAugmentationInfo)childMethodExecution.getAugmentation()).setTraceObjectId(Integer.parseInt(objectId));
+ TracePoint childTracePoint = tracePoint.duplicate();
+ childTracePoint.stepBackNoReturn();
+ aliasCollector.addAlias(new Alias(Alias.AliasType.METHOD_INVOCATION, 0, ret.getId(), tracePoint.duplicate()));
+ calleeSearch(trace, childTracePoint, objList, childMethodExecution.isStatic(), index, aliasCollector); // �Ăяo���������ɒT��
+ if (childMethodExecution.isConstructor()) {
+ // �R���X�g���N�^�Ăяo���������ꍇ
+ if (objectId.equals(srcObject.getId())) {
+ r = new Reference(thisObj, srcObject);
+ r.setCreation(true);
+ eStructure.addSrcSide(r);
+ srcObject = thisObj;
+ trackingObj = srcObject;
+ } else if (objectId.equals(dstObject.getId())) {
+ r = new Reference(thisObj, dstObject);
+ r.setCreation(true);
+ eStructure.addDstSide(r);
+ dstObject = thisObj;
+ trackingObj = dstObject;
+ }
+ if (Trace.isNull(thisObjectId)) objectId = null; // static�ϐ��̏ꍇ
+ else objectId = thisObjectId;
+ objList.set(index, objectId);
+ isResolved = true;
+ isLost = false;
+ continue;
+ }
+ objectId = objList.get(index);
+ if (objectId == null) {
+ // static�Ăяo���̖߂�l�������ꍇ�i���Ԃ�j
+ trackingObj = null;
+ isResolved = true;
+ } else if (objectId.equals(srcObject.getId())) {
+ trackingObj = srcObject;
+ } else if (objectId.equals(dstObject.getId())) {
+ trackingObj = dstObject;
+ }
+ if (isLost) {
+ checkList.add(objList.get(index));
+ isLost = false;
+ }
+ if (objectId != null) {
+ if (childMethodExecution.getThisObjId().equals(objectId)) {
+ aliasCollector.addAlias(new Alias(Alias.AliasType.RECEIVER, 0, objectId, tracePoint.duplicate()));
+ }
+ }
+ }
+ }
+ } while (tracePoint.stepBackOver());
+
+ //�����T��
+ if (arguments.contains(new ObjectReference(objectId))) {
+ ((DeltaAugmentationInfo)methodExecution.getAugmentation()).setSetterSide(true); // �������K�v?
+ isResolved = true;
+ aliasCollector.addAlias(new Alias(Alias.AliasType.FORMAL_PARAMETER, arguments.indexOf(new ObjectReference(objectId)), objectId, methodExecution.getEntryPoint()));
+ }
+ }
+
+ //�R���N�V�����^�Ή�
+ Reference r;
+ if (methodExecution.isCollectionType()) {
+ if (objectId != null) {
+ // �R���N�V�����^�̏ꍇ�A�����ŌX�̗v�f�ڕێ����Ă���Ɖ��肷��
+ if (objectId.equals(srcObject.getId())) {
+ r = new Reference(thisObj, srcObject);
+ r.setCollection(true);
+ eStructure.addSrcSide(r);
+ srcObject = thisObj;
+ } else if(objectId.equals(dstObject.getId())) {
+ r = new Reference(thisObj, dstObject);
+ r.setCollection(true);
+ eStructure.addDstSide(r);
+ dstObject =thisObj;
+ }
+ }
+ objList.set(index, methodExecution.getThisObjId());
+ isResolved = true; // �K�v�Ȃ̂ł�?
+ }
+
+ if (objectId == null && isResolved && !isStatic) { // static �Ăяo������̖߂�l��Ԃ��Ă���ꍇ
+ objList.set(index, thisObjectId); // ������ǐՂ�����
+ if (Trace.isNull(srcObject.getId())) {
+ srcObject = thisObj;
+ } else if (Trace.isNull(dstObject.getId())) {
+ dstObject = thisObj;
+ }
+ }
+
+ if (isStatic && !isResolved) { // ���͋N���肦�Ȃ�?(get�|�C���g�J�b�g���擾����悤�ɂ�������)
+ objList.set(index, null);
+ }
+ if(!isStatic && !isResolved){
+ isLost = true; // final�ϐ�������N���X�ŎQ�Ƃ��Ă���\�������邪�AcalleeSearch()�͕K���Ăяo�����ɕ��A���Ă����̂ŁA�����ł͉������Ȃ�
+ }
+ }
+}
diff --git a/src/org/ntlab/deltaExtractor/ExtractedStructure.java b/src/org/ntlab/deltaExtractor/ExtractedStructure.java
new file mode 100644
index 0000000..dedf499
--- /dev/null
+++ b/src/org/ntlab/deltaExtractor/ExtractedStructure.java
@@ -0,0 +1,68 @@
+package org.ntlab.deltaExtractor;
+
+import org.ntlab.trace.MethodExecution;
+import org.ntlab.trace.Reference;
+
+
+public class ExtractedStructure {
+
+ private Delta delta = new Delta();
+ private MethodExecution coordinator = null;
+ private MethodExecution parent = null;
+ private MethodExecution creationCallTree;
+
+ public Delta getDelta() {
+ return delta;
+ }
+
+ public MethodExecution getCoordinator() {
+ return coordinator;
+ }
+
+ /**
+ * ������ ������ɍ폜���邱��
+ * @param coordinator
+ */
+ public void setCoordinator(MethodExecution coordinator) {
+ this.coordinator = coordinator;
+ }
+
+ public void createParent(MethodExecution methodExecution) {
+ coordinator = methodExecution;
+ parent = null;
+ }
+
+// public void addParent(MethodExecution callTree) {
+// if (parent == null)
+// coordinator.addChild(parent = callTree);
+// else
+// parent.addChild(parent = callTree);
+// }
+//
+// public void addChild(MethodExecution callTree) {
+// if (parent == null)
+// coordinator.addChild(callTree);
+// else
+// parent.addChild(callTree);
+// }
+//
+ public void addSrcSide(Reference reference) {
+ delta.addSrcSide(reference);
+ }
+
+ public void addDstSide(Reference reference) {
+ delta.addDstSide(reference);
+ }
+
+ public void changeParent() {
+ }
+
+ public void setCreationMethodExecution(MethodExecution callTree) {
+ creationCallTree = callTree;
+ }
+
+ public MethodExecution getCreationCallTree() {
+ return creationCallTree;
+ }
+
+}
diff --git a/src/org/ntlab/deltaExtractor/IAliasCollector.java b/src/org/ntlab/deltaExtractor/IAliasCollector.java
new file mode 100644
index 0000000..66b5388
--- /dev/null
+++ b/src/org/ntlab/deltaExtractor/IAliasCollector.java
@@ -0,0 +1,21 @@
+package org.ntlab.deltaExtractor;
+
+/**
+ * Collect delta aliases interface.
+ *
+ * @author Nitta Lab.
+ */
+public interface IAliasCollector {
+
+ /**
+ * @param alias Object state in the flow of program execution.
+ */
+ void addAlias(Alias alias);
+
+ /**
+ * @param fromObjId
+ * @param toObjId
+ */
+ void changeTrackingObject(String fromObjId, String toObjId);
+
+}
diff --git a/src/org/ntlab/deltaExtractor/Test.java b/src/org/ntlab/deltaExtractor/Test.java
new file mode 100644
index 0000000..5cadd9c
--- /dev/null
+++ b/src/org/ntlab/deltaExtractor/Test.java
@@ -0,0 +1,312 @@
+package org.ntlab.deltaExtractor;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.ntlab.trace.MethodExecution;
+import org.ntlab.trace.ObjectReference;
+import org.ntlab.trace.Reference;
+import org.ntlab.trace.ThreadInstance;
+import org.ntlab.trace.Trace;
+import org.ntlab.trace.TraceJSON;
+import org.ntlab.trace.TracePoint;
+
+public class Test {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+ long time = System.nanoTime();
+// TraceJSON trace = new TraceJSON("traces\\_worstCase.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, "worstCase.P", "worstCase.M"), tp);
+
+// 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();
+ ThreadInstance thread = threads.values().iterator().next();
+ TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint();
+ ExtractedStructure e = s.extract(new Reference(null, null, "arraySample.D", "arraySample.C"), tp);
+
+// 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());
+
+ }
+}
diff --git a/src/org/ntlab/deltaViewer/DeltaAliasCollector.java b/src/org/ntlab/deltaViewer/DeltaAliasCollector.java
new file mode 100644
index 0000000..ed0951e
--- /dev/null
+++ b/src/org/ntlab/deltaViewer/DeltaAliasCollector.java
@@ -0,0 +1,73 @@
+package org.ntlab.deltaViewer;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.ntlab.deltaExtractor.Alias;
+import org.ntlab.deltaExtractor.IAliasCollector;
+import org.ntlab.trace.MethodExecution;
+import org.ntlab.trace.MethodInvocation;
+
+/**
+ * Collect delta aliases for MagnetRON.
+ *
+ * @author Nitta Lab.
+ */
+public class DeltaAliasCollector implements IAliasCollector {
+
+ private String srcObjId;
+ private String dstObjId;
+ private ArrayList aliasList = new ArrayList<>();
+
+ public DeltaAliasCollector() {
+ }
+
+ /**
+ * @param srcObjId
+ * @param dstObjId
+ */
+ public DeltaAliasCollector(String srcObjId, String dstObjId) {
+ this.srcObjId = srcObjId;
+ this.dstObjId = dstObjId;
+ }
+
+ @Override
+ public void addAlias(Alias alias) {
+ switch(alias.getAliasType()) {
+ case RETURN_VALUE:
+ aliasList.add(0, alias);
+ break;
+ case METHOD_INVOCATION:
+ aliasList.add(0, alias);
+ break;
+ case FORMAL_PARAMETER:
+ aliasList.add(0, alias);
+ alias.getOccurrencePoint().getMethodExecution().getThisObjId();
+ break;
+ case ACTUAL_ARGUMENT:
+ aliasList.add(0, alias);
+ break;
+ case THIS:
+ aliasList.add(0, alias);
+ break;
+ case RECEIVER:
+ aliasList.add(0, alias);
+ if (alias.getOccurrencePoint().getStatement() instanceof MethodInvocation) {
+ MethodExecution me = ((MethodInvocation) alias.getOccurrencePoint().getStatement()).getCalledMethodExecution();
+ }
+ break;
+ default:
+ }
+ System.out.println(alias.getObjectId() + ", " + alias.getMethodSignature() + " l." + alias.getLineNo() + " : " + alias.getAliasType().toString());
+ }
+
+ @Override
+ public void changeTrackingObject(String fromObjId, String toObjId) {
+ System.out.println(fromObjId + " -> " + toObjId);
+ }
+
+ public Collection getAliasList() {
+ return this.aliasList;
+ }
+
+}
diff --git a/src/org/ntlab/deltaViewer/DeltaAnimation.java b/src/org/ntlab/deltaViewer/DeltaAnimation.java
new file mode 100644
index 0000000..bc01761
--- /dev/null
+++ b/src/org/ntlab/deltaViewer/DeltaAnimation.java
@@ -0,0 +1,355 @@
+package org.ntlab.deltaViewer;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Stroke;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Line2D;
+import java.awt.geom.Path2D;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import javax.swing.SwingUtilities;
+
+import com.mxgraph.canvas.mxGraphics2DCanvas;
+import com.mxgraph.model.mxICell;
+import com.mxgraph.swing.mxGraphComponent;
+import com.mxgraph.util.mxPoint;
+
+/**
+ * Generate delta animation for MagnetRON.
+ *
+ * @author Nitta Lab.
+ */
+public class DeltaAnimation {
+
+ private DeltaGraphAdapter mxgraph;
+ private mxGraphComponent mxgraphComponent;
+
+ private Graphics2D graphics2D;
+ private Timer timer;
+ private static int FINAL_STEP_COUNT = 10;
+
+ private mxICell sourceCell;
+
+ GeneralPath p = new GeneralPath();
+
+ // X, Y
+ private mxPoint sourcePoint;
+ private mxPoint targetPoint;
+ private mxPoint curPoint;
+ private mxPoint updatePoint = new mxPoint();
+
+ // Width, Height
+ private Dimension targetDimension;
+ private Dimension curDimension = new Dimension();
+ private Dimension updateDimension = new Dimension();
+
+ private double scale = 1;
+
+ /**
+ * @param mxgraph
+ * @param mxgraphComponent
+ */
+ public DeltaAnimation(DeltaGraphAdapter mxgraph, mxGraphComponent mxgraphComponent) {
+ this.mxgraph = mxgraph;
+ this.mxgraphComponent = mxgraphComponent;
+ graphics2D = (Graphics2D)mxgraphComponent.getGraphics();
+ }
+
+ /**
+ * @param zoomLevel Zoom level of MagnetRON view.
+ */
+ public void setScale(double zoomLevel) {
+ this.scale = zoomLevel;
+ }
+
+ /**
+ * Set to move animation sourcell vertex to targetPoint.
+ *
+ * @param sourceCell Vertex.
+ * @param targetPoint XY coordinates.
+ */
+ public void setVertexAnimation(mxICell sourceCell, mxPoint targetPoint) {
+ this.sourceCell = sourceCell;
+ this.targetPoint = targetPoint;
+ curPoint = new mxPoint(sourceCell.getGeometry().getX(), sourceCell.getGeometry().getY());
+// System.out.println("sourcePoint : " + sourceCell.getGeometry().getPoint());
+// System.out.println("targetPoint : " + targetPoint);
+ calculateResizeLineModel();
+ }
+
+ /**
+ * Set stretch(expand) animation of edge from sourcePoint to targetPoint.
+ *
+ * @param sourcePoint Edge sourcePoint.
+ * @param targetPoint Edge targetPoint.
+ */
+ public void setExpandEdgeAnimation(mxPoint sourcePoint, mxPoint targetPoint) {
+ this.sourcePoint = new mxPoint(sourcePoint.getX() * scale + 1, sourcePoint.getY() * scale + 1);
+ this.targetPoint = new mxPoint(targetPoint.getX() * scale, targetPoint.getY() * scale);
+ curPoint = this.sourcePoint;
+// System.out.println("sourcePoint : " + sourcePoint);
+// System.out.println("targetPoint : " + targetPoint);
+
+ graphics2D = (Graphics2D)mxgraphComponent.getGraphics();
+ graphics2D.setColor(Color.decode("#008000"));
+
+ float width = (float) (1 * scale);
+ Stroke dashed = new BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, new float[]{(float) (3.0f * scale * width), (float) (3.0f * scale * width)}, 0.0f);
+ graphics2D.setStroke(dashed);
+ calculateResizeLineModel();
+ }
+
+ /**
+ * Set to move animation sourcell vertex clone to targetPoint, reduce edge length.
+ *
+ * @param sourceCell Remove sourceCell vertex clone.
+ * @param targetPoint
+ */
+ public void setReductionEdgeAnimation(mxICell sourceCell, mxPoint targetPoint) {
+ this.sourceCell = sourceCell;
+ this.targetPoint = targetPoint;
+ curPoint = new mxPoint(sourceCell.getGeometry().getX(), sourceCell.getGeometry().getY());
+// System.out.println("sourcePoint : " + sourceCell.getGeometry().getPoint());
+// System.out.println("targetPoint : " + targetPoint);
+ calculateResizeLineModel();
+ }
+
+ /**
+ * Set animation resize vertex.
+ *
+ * @param sourceCell
+ * @param targetDimension Vertex (Width, Height)
+ */
+ public void setResizeVertexAnimation(mxICell sourceCell, Dimension targetDimension) {
+ this.sourceCell = sourceCell;
+ this.targetDimension = targetDimension;
+ curDimension.setSize(sourceCell.getGeometry().getWidth(), sourceCell.getGeometry().getHeight());
+ calculateResizeVertexModel();
+ }
+
+ /**
+ * Calculate updatePoint every second from curPoint and targetPoint.
+ */
+ public void calculateResizeLineModel() {
+ mxPoint distancePoint = new mxPoint();
+ distancePoint.setX(targetPoint.getX() - curPoint.getX());
+ distancePoint.setY(targetPoint.getY() - curPoint.getY());
+ updatePoint.setX(distancePoint.getX() / FINAL_STEP_COUNT);
+ updatePoint.setY(distancePoint.getY() / FINAL_STEP_COUNT);
+ }
+
+ /**
+ * Calculate updateDimension every second from curPoint and targetPoint.
+ */
+ public void calculateResizeVertexModel() {
+ Dimension distanceDimension = new Dimension();
+ distanceDimension.setSize(targetDimension.getWidth() - curDimension.getWidth(), targetDimension.getHeight() - curDimension.getWidth());
+ updateDimension.setSize(distanceDimension.getWidth() / FINAL_STEP_COUNT, distanceDimension.getHeight() / FINAL_STEP_COUNT);
+ }
+
+ /**
+ * Start animation to move sourcell vertex to targetPoint for 10 sec.
+ */
+ public void startVertexAnimation() {
+ timer = new Timer();
+ timer.schedule(new TimerTask() {
+ int stepCount = 0;
+
+ @Override
+ public void run() {
+ if(stepCount < FINAL_STEP_COUNT) {
+ updateVertexAnimation();
+ stepCount++;
+ if(stepCount >= FINAL_STEP_COUNT){
+ timer.cancel();
+ }
+ }
+ }
+ }, 0, 100);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Start stretch(expand) animation of edge from sourcePoint to targetPoint for 10 sec.
+ */
+ public void startExpandEdgeAnimation() {
+ timer = new Timer();
+ timer.schedule(new TimerTask() {
+ int stepCount = 0;
+
+ @Override
+ public void run() {
+ if(stepCount < FINAL_STEP_COUNT) {
+ updateExpandEdgeAnimation();
+ stepCount++;
+ if(stepCount >= FINAL_STEP_COUNT){
+ timer.cancel();
+ }
+ }
+ }
+ }, 0, 100);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Start move animation sourcell vertex clone to targetPoint, reduce edge length for 10 sec.
+ */
+ public void startReductionEdgeAnimation() {
+ timer = new Timer();
+ timer.schedule(new TimerTask() {
+ int stepCount = 0;
+
+ @Override
+ public void run() {
+ if(stepCount < FINAL_STEP_COUNT) {
+ updateReductionEdgeAnimation();
+ stepCount++;
+ if(stepCount >= FINAL_STEP_COUNT){
+ timer.cancel();
+ }
+ }
+ }
+ }, 0, 100);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Start animation resize vertex for 10 sec.
+ */
+ public void startResizeVertexAnimation() {
+ timer = new Timer();
+ timer.schedule(new TimerTask() {
+ int stepCount = 0;
+
+ @Override
+ public void run() {
+ if(stepCount < FINAL_STEP_COUNT) {
+ updateResizeVertexAnimation();
+ stepCount++;
+ if(stepCount >= FINAL_STEP_COUNT){
+ timer.cancel();
+ }
+ }
+ }
+ }, 0, 100);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Update animation to move sourcell vertex to targetPoint every second.
+ */
+ private void updateVertexAnimation() {
+ // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology.
+ mxgraph.getModel().beginUpdate();
+ try {
+ curPoint.setX(sourceCell.getGeometry().getX());
+ curPoint.setY(sourceCell.getGeometry().getY());
+ sourceCell.getGeometry().setX(curPoint.getX() + updatePoint.getX());
+ sourceCell.getGeometry().setY(curPoint.getY() + updatePoint.getY());
+// System.out.println(sourceCell.getGeometry().getPoint());
+ } finally {
+ mxgraph.getModel().endUpdate();
+ }
+ mxgraphComponent.refresh();
+ }
+
+ /**
+ * Update stretch(expand) animation of edge length updatePoint every second.
+ */
+ private void updateExpandEdgeAnimation() {
+ Runnable r = new Runnable() {
+ public void run() {
+ p.reset();
+ p.moveTo((float)curPoint.getX(), (float)curPoint.getY());
+ curPoint.setX(curPoint.getX() + updatePoint.getX());
+ curPoint.setY(curPoint.getY() + updatePoint.getY());
+// System.out.println("curPoint : " + curPoint);
+ p.lineTo((float)curPoint.getX(), (float)curPoint.getY());
+ graphics2D.draw(p);
+ }
+ };
+
+ // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology.
+ if (!SwingUtilities.isEventDispatchThread()) {
+ SwingUtilities.invokeLater(r);
+ } else {
+ r.run();
+ }
+ }
+
+ /**
+ * Update move animation sourcell vertex clone to targetPoint, reduce edge length updatePoint every second.
+ */
+ private void updateReductionEdgeAnimation() {
+ // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology.
+ mxgraph.getModel().beginUpdate();
+ try {
+ curPoint.setX(sourceCell.getGeometry().getX());
+ curPoint.setY(sourceCell.getGeometry().getY());
+ sourceCell.getGeometry().setX(curPoint.getX() + updatePoint.getX());
+ sourceCell.getGeometry().setY(curPoint.getY() + updatePoint.getY());
+ // System.out.println(sourceCell.getGeometry().getPoint());
+ } finally {
+ mxgraph.getModel().endUpdate();
+ }
+ mxgraphComponent.refresh();
+ }
+
+ /**
+ * Update animation resize vertex every second.
+ */
+ private void updateResizeVertexAnimation() {
+ // Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology.
+ mxgraph.getModel().beginUpdate();
+ try {
+ double preCenterX = sourceCell.getGeometry().getCenterX();
+ double preCenterY = sourceCell.getGeometry().getCenterY();
+
+ curDimension.setSize(sourceCell.getGeometry().getWidth(), sourceCell.getGeometry().getHeight());
+ sourceCell.getGeometry().setWidth(curDimension.getWidth() + updateDimension.getWidth());
+ sourceCell.getGeometry().setHeight(curDimension.getHeight() + updateDimension.getHeight());
+
+ double curCenterX = sourceCell.getGeometry().getCenterX();
+ double curCenterY = sourceCell.getGeometry().getCenterY();
+ double distanceX = (curCenterX - preCenterX);
+ double distanceY = (curCenterY - preCenterY);
+ double curX = sourceCell.getGeometry().getX();
+ double curY = sourceCell.getGeometry().getY();
+
+ sourceCell.getGeometry().setX(curX - distanceX);
+ sourceCell.getGeometry().setY(curY - distanceY);
+
+ for (int i = 0; i < sourceCell.getChildCount(); i++) {
+ mxICell childCell = sourceCell.getChildAt(i);
+ System.out.println("child" + childCell);
+ curX = childCell.getGeometry().getX();
+ curY = childCell.getGeometry().getY();
+ childCell.getGeometry().setX(curX + distanceX);
+ childCell.getGeometry().setY(curY + distanceY);
+ }
+ } finally {
+ mxgraph.getModel().endUpdate();
+ }
+ mxgraphComponent.refresh();
+ }
+}
diff --git a/src/org/ntlab/deltaViewer/DeltaGraphAdapter.java b/src/org/ntlab/deltaViewer/DeltaGraphAdapter.java
new file mode 100644
index 0000000..b0398ff
--- /dev/null
+++ b/src/org/ntlab/deltaViewer/DeltaGraphAdapter.java
@@ -0,0 +1,152 @@
+package org.ntlab.deltaViewer;
+
+import org.jgrapht.Graph;
+import org.jgrapht.ext.JGraphXAdapter;
+import org.jgrapht.graph.DefaultEdge;
+import org.jgrapht.graph.DirectedWeightedPseudograph;
+
+import com.mxgraph.model.mxGeometry;
+import com.mxgraph.model.mxICell;
+import com.mxgraph.util.mxConstants;
+
+/**
+ * JGraphX(visualize) to JGraphT(model) DeltaGraphAdapter for MagnetRON.
+ *
+ * @author Nitta Lab.
+ */
+public class DeltaGraphAdapter extends JGraphXAdapter