summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/testsrc
diff options
context:
space:
mode:
authoraclement <aclement>2006-06-19 10:17:28 +0000
committeraclement <aclement>2006-06-19 10:17:28 +0000
commitabe25b029852a8c8e1c682a9a59413896d18dd2b (patch)
tree04eada1bb3d2e225f1f2986f1b6c3a48a7240ea5 /org.aspectj.ajdt.core/testsrc
parentfdbae3fda3e572ea35ac4a73373896b9b5cff8f7 (diff)
downloadaspectj-abe25b029852a8c8e1c682a9a59413896d18dd2b.tar.gz
aspectj-abe25b029852a8c8e1c682a9a59413896d18dd2b.zip
testcode and patches for pr141730 comments #13,14: "new handleprovider"
Diffstat (limited to 'org.aspectj.ajdt.core/testsrc')
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java
index 6114bef57..2d0e1ba6d 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java
@@ -17,12 +17,17 @@ import java.io.FilenameFilter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import junit.framework.AssertionFailedError;
+import org.aspectj.asm.AsmManager;
+import org.aspectj.asm.IProgramElement;
+import org.aspectj.asm.IRelationshipMap;
+import org.aspectj.asm.internal.Relationship;
import org.aspectj.bridge.AbortException;
import org.aspectj.bridge.ICommand;
import org.aspectj.bridge.IMessage;
@@ -431,6 +436,46 @@ public class Ajc {
}
return ret;
}
+
+ public static void dumpAJDEStructureModel(String prefix) {
+ dumpAJDEStructureModel(prefix, false);
+ }
+
+ public static void dumpAJDEStructureModel(String prefix, boolean useHandles) {
+ System.out.println("======================================");//$NON-NLS-1$
+ System.out.println("start of AJDE structure model:"+prefix); //$NON-NLS-1$
+
+ IRelationshipMap asmRelMap = AsmManager.getDefault().getRelationshipMap();
+ for (Iterator iter = asmRelMap.getEntries().iterator(); iter.hasNext();) {
+ String sourceOfRelationship = (String) iter.next();
+ System.err.println("Examining source relationship handle: "+sourceOfRelationship);
+ List relationships = null;
+ if (useHandles) {
+ relationships = asmRelMap.get(sourceOfRelationship);
+ } else {
+ IProgramElement ipe = AsmManager.getDefault().getHierarchy()
+ .findElementForHandle(sourceOfRelationship);
+ relationships = asmRelMap.get(ipe);
+ }
+ if (relationships != null) {
+ for (Iterator iterator = relationships.iterator(); iterator.hasNext();) {
+ Relationship rel = (Relationship) iterator.next();
+ List targets = rel.getTargets();
+ for (Iterator iterator2 = targets.iterator(); iterator2.hasNext();) {
+ String t = (String) iterator2.next();
+ IProgramElement link = AsmManager.getDefault().getHierarchy().findElementForHandle(t);
+ System.out.println(""); //$NON-NLS-1$
+ System.out.println(" sourceOfRelationship " + sourceOfRelationship); //$NON-NLS-1$
+ System.out.println(" relationship " + rel.getName()); //$NON-NLS-1$
+ System.out.println(" target " + link.getName()); //$NON-NLS-1$
+ }
+ }
+
+ }
+ }
+ System.out.println("End of AJDE structure model"); //$NON-NLS-1$
+ System.out.println("======================================");//$NON-NLS-1$
+ }
}
/*