Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Previously running program broke with 3.0M8/AJDT 1.1.8

Today I found out that a program that runned without any problems with eclipse 2.1/AJDT 1.1.4 broke with eclipse 3.0M8/AJDT 1.1.8. The cause were pointcuts that targeted constructor executions based on a marker interface. They worked fine with in the older environment, but the pointcuts no longer captured the *.new() joinpoints in the new version. Next follows a simplified example that captures the situation. It runs fine with eclipse 2.1/AJDT 1.1.4 but throws a RuntimeException with 3.0M8/AJDT 1.1.8.
------------------------------------------------------------------
public class Capsule {
}
------------------------------------------------------------------
import java.util.ArrayList;
public aspect Generic {
 private interface Marker {}
 private ArrayList Marker._list;
 pointcut markerCreation(Marker marker):
    execution(Marker.new(..)) && this(marker);
 after(Marker marker) returning : markerCreation(marker) {
    marker._list = new ArrayList();
 }
 public int Marker.getSize() {
    return this._list.size();
 }
 declare parents: Capsule implements Marker;
}
------------------------------------------------------------------
public class Run {
 public static void main(String[] args) {
    Capsule capsule = new Capsule();
    System.out.println("Size on creation: " + capsule.getSize());
 }
}
------------------------------------------------------------------ Was there any change in the semantics of AspectJ from 1.1 to 1.2?
Miguel J. T. Pessoa Monteiro
Ph.D. student Minho University,Portugal
eMail: mmonteiro@xxxxxxxxxxxx
URL:http://gec.di.uminho.pt/mpm/


Back to the top