Browse Source

fix and test for Bugzilla Bug 34820

   ajc -aspectpath fails with NPE for cflow pointcuts
tags/v1_1_0_RC1
jhugunin 21 years ago
parent
commit
db37189ceb

+ 0
- 43
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAdvice.java View File

@@ -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");
}

}

+ 3
- 2
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java View 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;

+ 8
- 0
org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj View File

@@ -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 ++;
}
}

Loading…
Cancel
Save