diff options
author | aclement <aclement> | 2006-10-19 14:05:02 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-10-19 14:05:02 +0000 |
commit | 044542c6d5996806ce29156e83e1725823f5f8fe (patch) | |
tree | cc7047618a120440236e9e5aa697e1df2a45e693 | |
parent | db68044fe8ea0f43a5e090a67b9410f4c334bff6 (diff) | |
download | aspectj-044542c6d5996806ce29156e83e1725823f5f8fe.tar.gz aspectj-044542c6d5996806ce29156e83e1725823f5f8fe.zip |
test and fix for 161217
-rw-r--r-- | tests/bugs153/pr161217/AtAspectJAspect.java | 13 | ||||
-rw-r--r-- | tests/bugs153/pr161217/C.java | 9 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc153/ajc153.xml | 4 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java | 2 |
5 files changed, 28 insertions, 1 deletions
diff --git a/tests/bugs153/pr161217/AtAspectJAspect.java b/tests/bugs153/pr161217/AtAspectJAspect.java new file mode 100644 index 000000000..7194bb0aa --- /dev/null +++ b/tests/bugs153/pr161217/AtAspectJAspect.java @@ -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 index 000000000..3bbd052f3 --- /dev/null +++ b/tests/bugs153/pr161217/C.java @@ -0,0 +1,9 @@ +package pkg; + +public class C { + + public void foo() { + + } + +} diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java index 0f1f79025..36ab1f60f 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java @@ -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() { diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml index d7e0cd677..5243b6168 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml @@ -742,4 +742,8 @@ </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 diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java index 05156b715..c9fabc205 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java @@ -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, |