]> source.dussan.org Git - aspectj.git/commitdiff
335682
authoraclement <aclement>
Wed, 2 Feb 2011 00:40:45 +0000 (00:40 +0000)
committeraclement <aclement>
Wed, 2 Feb 2011 00:40:45 +0000 (00:40 +0000)
tests/bugs1611/pr335682/foo.jar [new file with mode: 0644]
tests/bugs1611/pr335682/theSource.zip [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc1611/Ajc1611Tests.java
tests/src/org/aspectj/systemtest/ajc1611/ajc1611.xml
tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java

diff --git a/tests/bugs1611/pr335682/foo.jar b/tests/bugs1611/pr335682/foo.jar
new file mode 100644 (file)
index 0000000..ddc5728
Binary files /dev/null and b/tests/bugs1611/pr335682/foo.jar differ
diff --git a/tests/bugs1611/pr335682/theSource.zip b/tests/bugs1611/pr335682/theSource.zip
new file mode 100644 (file)
index 0000000..aeb53c1
Binary files /dev/null and b/tests/bugs1611/pr335682/theSource.zip differ
index 3468d5e48590d8fdffbdd6e4385c1936bcfeac75..aee6649d707a280c11559899b1f7c273eea7b58e 100644 (file)
@@ -21,6 +21,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
  */
 public class Ajc1611Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testDeserialization_335682() {
+               runTest("pr335682");
+       }
+
        public void testNPEAddSerialVersionUID_bug335783() {
                runTest("pr335783");
        }
index 663ad68a08330638ecc035fde5033bd6997a6e1e..afcd5a8e535723eb3f5025f049cc0267442dbb02 100644 (file)
@@ -2,6 +2,9 @@
 
 <suite>
 
+<ajc-test dir="bugs1611/pr335682" title="pr335682">
+  <compile inpath="foo.jar" outjar="bar.jar"/>
+</ajc-test>
   <ajc-test dir="bugs1611/pr335783" title="pr335783">
     <compile files="A.java" options="-1.5"/>
     <compile files="X.aj" options="-1.5 -Xlint:ignore" />
index 29941da8ea324a5be406e35ad3669c7c406b86f4..247af636914d5c066fb66d074a4f58755c1f6b50 100644 (file)
@@ -11,6 +11,7 @@
 package org.aspectj.systemtest.incremental.tools;
 
 import java.io.File;
+import java.util.List;
 import java.util.Set;
 
 import org.aspectj.ajde.core.AjCompiler;
@@ -120,6 +121,65 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental
                assertContains("B.java:4:0::0 Unhandled exception type Exception", getErrorMessages(p).get(0));
        }
 
+       /**
+        * Checking if we have the right information on the member nodes.
+        */
+       public void testModelStructure_333123() throws Exception {
+               String p = "pr333123";
+               initialiseProject(p);
+               build(p);
+               checkWasFullBuild();
+               printModel(p);
+
+               AspectJElementHierarchy model = (AspectJElementHierarchy) getModelFor(p).getHierarchy();
+
+               IProgramElement ipe = null;
+               // fieldInt [field] 10 hid:=pr333123<a.b{Code.java[Code^fieldInt
+               // fieldString [field] 12 hid:=pr333123<a.b{Code.java[Code^fieldString
+               // fieldCode [field] 14 hid:=pr333123<a.b{Code.java[Code^fieldCode
+               ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code^fieldInt");
+               assertEquals("I", ipe.getCorrespondingTypeSignature());
+               assertEquals("int", ipe.getCorrespondingType(true));
+               ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code^fieldString");
+               assertEquals("Ljava/lang/String;", ipe.getCorrespondingTypeSignature());
+               assertEquals("java.lang.String", ipe.getCorrespondingType(true));
+               // assertEquals("Ljava/lang/String;", ipe.getBytecodeSignature());
+               ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code^fieldCode");
+               assertEquals("La/b/Code;", ipe.getCorrespondingTypeSignature());
+               assertEquals("a.b.Code", ipe.getCorrespondingType(true));
+               ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code^fieldList");
+               // assertEquals("La/b/Code;", ipe.getBytecodeSignature());
+               assertEquals("Ljava/util/List<La/b/Code;>;", ipe.getCorrespondingTypeSignature());
+               assertEquals("java.util.List<a.b.Code>", ipe.getCorrespondingType(true));
+
+               // method(java.lang.String) [method] 4 hid:=pr333123<a.b{Code.java[Code~method~QString;
+               // getInt() [method] 6 hid:=pr333123<a.b{Code.java[Code~getInt
+               // transform(a.b.Code,java.lang.String,long) [method] 8 hid:=pr333123<a.b{Code.java[Code~transform~QCode;~QString;~J
+               ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code~method~QString;");
+               assertEquals("(Ljava/lang/String;)V", ipe.getBytecodeSignature());
+               ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code~getInt");
+               assertEquals("()I", ipe.getBytecodeSignature());
+
+               ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code~transform~QCode;~QString;~J");
+               assertEquals("(La/b/Code;Ljava/lang/String;J)La/b/Code;", ipe.getBytecodeSignature());
+
+               List<char[]> paramSigs = ipe.getParameterSignatures();
+               assertEquals("La/b/Code;", new String(paramSigs.get(0)));
+               assertEquals("Ljava/lang/String;", new String(paramSigs.get(1)));
+               assertEquals("J", new String(paramSigs.get(2)));
+
+               assertEquals("a.b.Code", ipe.getCorrespondingType(true));
+               assertEquals("La/b/Code;", ipe.getCorrespondingTypeSignature());
+
+               ipe = model.findElementForHandle("=pr333123<a.b{Code.java[Code~transform2~QList\\<QString;>;");
+               assertEquals("(Ljava/util/List;)Ljava/util/List;", ipe.getBytecodeSignature());
+               paramSigs = ipe.getParameterSignatures();
+               assertEquals("Ljava/util/List<Ljava/lang/String;>;", new String(paramSigs.get(0)));
+               assertEquals("java.util.List<a.b.Code>", ipe.getCorrespondingType(true));
+               assertEquals("Ljava/util/List<La/b/Code;>;", ipe.getCorrespondingTypeSignature());
+
+       }
+
        // changing method return type parameterization
        public void testModifiedMethodReturnTypeGenericTypeParameterShouldTriggerError_318884_3() throws Exception {
                String p = "pr318884_3";
@@ -276,7 +336,7 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental
                IProgramElement ipe = model.findElementForHandleOrCreate("=PR278496_1<a.b.c{Code.java", false);
                assertNull(ipe);
        }
-       
+
        // inner classes
        public void testDeletion_278496_9() throws Exception {
                String p = "PR278496_9";