]> source.dussan.org Git - aspectj.git/commitdiff
fix and test for Bugzilla Bug 34820
authorjhugunin <jhugunin>
Wed, 12 Mar 2003 19:52:13 +0000 (19:52 +0000)
committerjhugunin <jhugunin>
Wed, 12 Mar 2003 19:52:13 +0000 (19:52 +0000)
   ajc -aspectpath fails with NPE for cflow pointcuts

org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAdvice.java [deleted file]
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java
org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj

diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAdvice.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAdvice.java
deleted file mode 100644 (file)
index e551749..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* *******************************************************************
- * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
- * All rights reserved. 
- * This program and the accompanying materials are made available 
- * under the terms of the Common Public License v1.0 
- * which accompanies this distribution and is available at 
- * http://www.eclipse.org/legal/cpl-v10.html 
- *  
- * Contributors: 
- *     PARC     initial implementation 
- * ******************************************************************/
-
-
-package org.aspectj.ajdt.internal.compiler.lookup;
-
-import org.aspectj.weaver.Advice;
-import org.aspectj.weaver.AjAttribute;
-import org.aspectj.weaver.Member;
-import org.aspectj.weaver.Shadow;
-import org.aspectj.weaver.patterns.Pointcut;
-
-
-public class EclipseAdvice extends Advice {
-       public EclipseAdvice(AjAttribute.AdviceAttribute attribute, Pointcut pointcut, Member signature) {
-                       
-               super(attribute, pointcut, signature);
-       }
-
-
-
-       public void implementOn(Shadow shadow) {
-               throw new RuntimeException("unimplemented");
-       }
-
-       public void specializeOn(Shadow shadow) {
-               throw new RuntimeException("unimplemented");
-       }
-
-       public int compareTo(Object other) {
-               throw new RuntimeException("unimplemented");
-       }
-
-}
index 68c875bfcdfc072edb4592a7537eecbf08b15bd9..4e59b6d8b9e97053e8fe218470b8efa7ef0efb61 100644 (file)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/cpl-v10.html 
  *  
  * Contributors: 
- *     PARC     initial implementation 
+ *     PARC     initial implementation
  * ******************************************************************/
 
 
@@ -152,7 +152,8 @@ public class EclipseFactory {
        
        public EclipseTypeMunger makeEclipseTypeMunger(ConcreteTypeMunger concrete) {
                if (concrete instanceof EclipseTypeMunger) return (EclipseTypeMunger)concrete;
-               if (EclipseTypeMunger.supportsKind(concrete.getMunger().getKind())) {
+               
+               if (concrete.getMunger() != null && EclipseTypeMunger.supportsKind(concrete.getMunger().getKind())) {
                        return new EclipseTypeMunger(this, concrete.getMunger(), concrete.getAspectType(), null);
                } else {
                        return null;
index 15a3d5cc65df88258ac7a66e93291d1fe9b360e0..12a7aa38ab517dad2cda381945320d1da108815b 100644 (file)
@@ -11,4 +11,12 @@ public aspect ConcreteA {
     public static class MyException extends Exception {}\r
 \r
     declare soft: MyException: withincode(new(..));\r
+    \r
+    \r
+    // added this to cover Bugzilla Bug 34820  \r
+    //     ajc -aspectpath fails with NPE for cflow pointcuts \r
+    int counter = 0;\r
+    before(): cflow(within(client..*)) && call(* println(..)) {\r
+        counter ++;\r
+    }\r
 }
\ No newline at end of file