]> source.dussan.org Git - aspectj.git/commitdiff
265993: more jdt like handles
authoraclement <aclement>
Tue, 24 Mar 2009 01:54:43 +0000 (01:54 +0000)
committeraclement <aclement>
Tue, 24 Mar 2009 01:54:43 +0000 (01:54 +0000)
tests/multiIncremental/pr265993/base/src/A.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

diff --git a/tests/multiIncremental/pr265993/base/src/A.java b/tests/multiIncremental/pr265993/base/src/A.java
new file mode 100644 (file)
index 0000000..dd6f2ae
--- /dev/null
@@ -0,0 +1,18 @@
+import java.util.Map; import java.util.List;
+public class A<T> {
+  public void m(String s1,java.lang.String s2) {
+  }
+  public void m2(List l) {}
+  public void m3(java.util.ArrayList l) {}
+
+  public void m4(Map<java.lang.String,List> m) {}
+  public void m5(java.util.Map<java.lang.String,List> m) {} // parameterized qualified
+  public void m6(Map<int[], List> mm) {} // single parameterized with array
+  public void m7(int[] mm) {} // primitive array
+  public void m8(java.lang.String[] mm) {} 
+  public void m9(String[] mm) {} 
+  public void m10(List<String>[][] m) {}
+  public void m11(java.util.List<T> m) {}
+  public void m12(T[] m) {}
+
+}
index ffb15c619cbc1ceb0153c1374fcb14b14172503d..e3a5f3e380d23e273af486e110ab3bf3a7869bcc 100644 (file)
@@ -985,6 +985,30 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                assertEquals("=AspectPath4/binaries<(Asp2.class}Asp2&before", findElementAtLine(root, 16).getHandleIdentifier());
        }
 
+       public void testHandleQualification_pr265993() throws IOException {
+               String p = "pr265993";
+               initialiseProject(p);
+               build(p);
+               IProgramElement root = getModelFor(p).getHierarchy().getRoot();
+               dumptree(getModelFor(p).getHierarchy().getRoot(), 0);
+               PrintWriter pw = new PrintWriter(System.out);
+               getModelFor(p).dumprels(pw);
+               pw.flush();
+               assertEquals("=pr265993<{A.java[A~m~QString;~Qjava.lang.String;", findElementAtLine(root, 3).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m2~QList;", findElementAtLine(root, 5).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m3~Qjava.util.ArrayList;", findElementAtLine(root, 6).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m4~QMap\\<Qjava.lang.String;QList;>;", findElementAtLine(root, 8).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m5~Qjava.util.Map\\<Qjava.lang.String;QList;>;", findElementAtLine(root, 9)
+                               .getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m6~QMap\\<\\[IQList;>;", findElementAtLine(root, 10).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m7~\\[I", findElementAtLine(root, 11).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m8~\\[Qjava.lang.String;", findElementAtLine(root, 12).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m9~\\[QString;", findElementAtLine(root, 13).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m10~\\[\\[QList\\<QString;>;", findElementAtLine(root, 14).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m11~Qjava.util.List\\<TT;>;", findElementAtLine(root, 15).getHandleIdentifier());
+               assertEquals("=pr265993<{A.java[A~m12~\\[TT;", findElementAtLine(root, 16).getHandleIdentifier());
+       }
+
        /**
         * A change is made to an aspect on the aspectpath (staticinitialization() advice is added) for another project.
         * <p>