]> source.dussan.org Git - aspectj.git/commitdiff
Fix for Bugzilla Bug 75129
authoraclement <aclement>
Thu, 30 Sep 2004 08:18:32 +0000 (08:18 +0000)
committeraclement <aclement>
Thu, 30 Sep 2004 08:18:32 +0000 (08:18 +0000)
   NPE on thisJoinPoint mistake

org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ThisJoinPointVisitor.java
tests/ajcTestsFailing.xml
tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml

index a873f0f2b698b982881af83c1695ec159058e8b9..a0f8097661800c2ea10a01da3d83c470d8c71903 100644 (file)
@@ -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;
index a15692546e32101affabc9b987b501f69e171175..167f12d9e47c6f04a83da8cfaf2fde22e91d9e6b 100644 (file)
           files="Test_AroundVarBug.java,AroundVarBug.java"/>
         <run class="Test_AroundVarBug"/>
     </ajc-test>
-
-    <ajc-test 
-       dir="bugs" 
-       pr="75129"
-               title="NPE on thisJoinPoint mistake">
-        <compile files="TjpMistake.java">
-               <message kind="error" line="22"/>
-        </compile>
-    </ajc-test>
     
 </suite>
index 2ea8c32213aadb5a232b411aa5fdebe061d16e84..02242409048a6f1de94cd05be8a183b13415f969 100644 (file)
@@ -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
index ba4c2cfc8759b9101d4ef9e9df894afb7e1b96a8..5c76906a38e7f809bb3ec74bdf2bff5fdcbabf8f 100644 (file)
                <compile files="PR72157.java">
              <message kind="error" line="13" text="Unhandled"/>
                </compile>
-       </ajc-test>
\ No newline at end of file
+       </ajc-test>
+       
+       <ajc-test 
+       dir="bugs" 
+       pr="75129"
+               title="NPE on thisJoinPoint mistake">
+        <compile files="TjpMistake.java">
+               <message kind="error" line="22"/>
+        </compile>
+    </ajc-test>
\ No newline at end of file