]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 161217
authoraclement <aclement>
Thu, 19 Oct 2006 14:05:02 +0000 (14:05 +0000)
committeraclement <aclement>
Thu, 19 Oct 2006 14:05:02 +0000 (14:05 +0000)
tests/bugs153/pr161217/AtAspectJAspect.java [new file with mode: 0644]
tests/bugs153/pr161217/C.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java

diff --git a/tests/bugs153/pr161217/AtAspectJAspect.java b/tests/bugs153/pr161217/AtAspectJAspect.java
new file mode 100644 (file)
index 0000000..7194bb0
--- /dev/null
@@ -0,0 +1,13 @@
+package pkg;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+
+@Aspect()
+public class AtAspectJAspect {
+
+       @Before("execution(* *.*())")
+       public void execOfEverything() {
+       }
+       
+}
diff --git a/tests/bugs153/pr161217/C.java b/tests/bugs153/pr161217/C.java
new file mode 100644 (file)
index 0000000..3bbd052
--- /dev/null
@@ -0,0 +1,9 @@
+package pkg;
+
+public class C {
+       
+       public void foo() {
+               
+       }
+       
+}
index 0f1f79025497f646023cf7cc9ee7e85b2aab805e..36ab1f60fa815368ed9e77e22f9a2372eef5d5e4 100644 (file)
@@ -167,6 +167,7 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   public void testNoInvalidAbsoluteTypeNameWarning_pr156904_3() {runTest("ensure no invalidAbsoluteTypeName when do match - 3");}
   public void testNoInvalidAbsoluteTypeNameWarning_pr156904_4() {runTest("ensure no invalidAbsoluteTypeName when do match - 4");}
 
+  public void testNoNPEWithThrownExceptionWarningAndAtAspectj_pr161217() {runTest("NPE with thrown exception warning and at aspectj");}
   
   /////////////////////////////////////////
   public static Test suite() {
index d7e0cd677b640126114259764fb7114217c56347..5243b61685c4fbbae64a7c3acb05ac8f59c5db29 100644 (file)
 
     </ajc-test>
 
+    <ajc-test dir="bugs153/pr161217" title="NPE with thrown exception warning and at aspectj">
+      <compile files="AtAspectJAspect.java, C.java" options="-warn:+unusedThrown -1.5"/>
+    </ajc-test>
+
 </suite>
\ No newline at end of file
index 05156b7156b1ad1086f69d859221f56d3864b18f..c9fabc205fbf4408097f680ee80d7891c258e26f 100644 (file)
@@ -197,7 +197,7 @@ public class BcelAdvice extends Advice {
         // (bug 129282). This may be expanded to include other compiler warnings
         // at the moment it only deals with 'declared exception is not thrown'
         if (!shadow.getWorld().isIgnoringUnusedDeclaredThrownException() 
-                       && !thrownExceptions.isEmpty()) {
+                       && !getThrownExceptions().isEmpty()) {
                Member member = shadow.getSignature();
                if (member instanceof BcelMethod) {
                        removeUnnecessaryProblems((BcelMethod)member,