From: aclement Date: Thu, 19 Oct 2006 14:05:02 +0000 (+0000) Subject: test and fix for 161217 X-Git-Tag: REMOVING_ASM~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=044542c6d5996806ce29156e83e1725823f5f8fe;p=aspectj.git test and fix for 161217 --- 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 @@ + + + + \ 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,