From: jhugunin Date: Wed, 12 Mar 2003 19:52:13 +0000 (+0000) Subject: fix and test for Bugzilla Bug 34820 X-Git-Tag: v1_1_0_RC1~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=db37189cebba13a30b7ccdabe70565caa7506c00;p=aspectj.git fix and test for Bugzilla Bug 34820 ajc -aspectpath fails with NPE for cflow pointcuts --- 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 index e55174903..000000000 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAdvice.java +++ /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"); - } - -} diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java index 68c875bfc..4e59b6d8b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java @@ -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; diff --git a/org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj b/org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj index 15a3d5cc6..12a7aa38a 100644 --- a/org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj +++ b/org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj @@ -11,4 +11,12 @@ public aspect ConcreteA { public static class MyException extends Exception {} declare soft: MyException: withincode(new(..)); + + + // added this to cover Bugzilla Bug 34820 + // ajc -aspectpath fails with NPE for cflow pointcuts + int counter = 0; + before(): cflow(within(client..*)) && call(* println(..)) { + counter ++; + } } \ No newline at end of file