From: aclement Date: Thu, 30 Sep 2004 08:18:32 +0000 (+0000) Subject: Fix for Bugzilla Bug 75129 X-Git-Tag: V1_2_1~53 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a89962434e080f2cb939dd59726f1acd65b31d6a;p=aspectj.git Fix for Bugzilla Bug 75129 NPE on thisJoinPoint mistake --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java index a873f0f2b..a0f809766 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java @@ -158,6 +158,10 @@ public class ThisJoinPointVisitor extends ASTVisitor { private void replaceEffectivelyStaticRef(MessageSend call) { NameReference receiver = (NameReference) call.receiver; + + // Don't continue if the call binding is null, as we are going to report an error about this line of code! + if (call.binding==null) return; + //System.err.println("replace static ref: " + receiver + " is " + System.identityHashCode(receiver)); receiver.binding = thisJoinPointStaticPartDecLocal; //thisJoinPointStaticPartDec; receiver.codegenBinding = thisJoinPointStaticPartDecLocal; diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index a15692546..167f12d9e 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -152,14 +152,5 @@ files="Test_AroundVarBug.java,AroundVarBug.java"/> - - - - - - diff --git a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java index 2ea8c3221..022424090 100644 --- a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java @@ -309,5 +309,9 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void test057_decSoftWithSuper() { runTest("declare soft can cause programs with invalid exception behaviour to be generated"); } -} + public void test058_npeOnTJPerror() { + runTest("NPE on thisJoinPoint mistake"); + } + +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml index ba4c2cfc8..5c76906a3 100644 --- a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml @@ -455,4 +455,13 @@ - \ No newline at end of file + + + + + + + \ No newline at end of file