]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 148737
authoraclement <aclement>
Mon, 3 Jul 2006 13:49:07 +0000 (13:49 +0000)
committeraclement <aclement>
Mon, 3 Jul 2006 13:49:07 +0000 (13:49 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java
tests/bugs153/pr148737/A.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml

index dde7e8b6266adce81af4202d37d04419162573bc..4aff85e3867bc10f61a38c725367def886f8c1ae 100644 (file)
@@ -665,7 +665,7 @@ public class BuildArgParser extends Main {
             } else if (arg.equals("-source")) {
                if (args.size() > nextArgIndex) {
                        String level = ((ConfigParser.Arg)args.get(nextArgIndex)).getValue();
-                       if (level.equals("1.5")){
+                       if (level.equals("1.5") || level.equals("5")) {
                                buildConfig.setBehaveInJava5Way(true);
                        }
                        unparsedArgs.add("-source");
diff --git a/tests/bugs153/pr148737/A.java b/tests/bugs153/pr148737/A.java
new file mode 100644 (file)
index 0000000..9c9360b
--- /dev/null
@@ -0,0 +1,19 @@
+public abstract class A<E> {   
+    public A() { }
+    public void setUniqueID(Object o) {}
+}
+
+class B extends A {
+    public B() {}    
+}
+
+class D {
+    public void method() {
+        B b = new B();
+        b.setUniqueID(null);
+    }
+}
+
+aspect TestAspect {
+       before(): call(public void *.*()) { }    
+}
index 8899c4581fbcfd4bbed4db1a6712d842e84a8bbc..2fdfb4664921613a2fc86eb7b059d385d965d9ba 100644 (file)
@@ -20,6 +20,8 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
   // public void testArgnamesAndJavac_pr148381() { runTest("argNames and javac");}
 
+  public void testIllegalStateException_pr148737() { runTest("illegalstateexception for non generic type");}
+
   /////////////////////////////////////////
   public static Test suite() {
     return XMLBasedAjcTestCase.loadSuite(Ajc153Tests.class);
index 45371bed1fcdaccbff4a029c77208a0ec7861a48..ae3f14d8756e344832798d467943ed3acdcd3855 100644 (file)
       </run>
     </ajc-test>
     
+    <ajc-test dir="bugs153/pr148737" title="illegalstateexception for non generic type">
+      <compile files="A.java" options="-source 5 -target 5">
+        <message kind="warning" line="18" text="advice defined in TestAspect has not been applied"/>
+      </compile>
+    </ajc-test>
+    
 </suite>
\ No newline at end of file