Menu

#2 Error when using anded cflow pointcuts

open-accepted
nobody
None
7
2007-05-31
2007-05-28
Anonymous
No

There is a weired bug which took me some time to grasp. If you use non-simple constellations like multiple plug-ins and complicated pointcuts the additional dependencies resulting from the weaving are not adeded to the some plug-in's classpath.

Attached you find an example: The hello and the test plug-ins call the plug-in a which calls b. There is a pointcut identifying calls on getB (in b) in the control flow of getA (in a):
pointcut getA() : execution(String a.internal.A.getA());
pointcut getB() : execution(String b.internal.B.getB());
String around() : getB() && cflow(getA()) { ... }
During runtime there is a NoClassDefFoundError thrown when trying to load A. This is because there is no additional dependency added on the plug-in A despect of the cflow(getA()) pointcut.

Now comes the weired: If you add a "simple" advice like
before() : getA() {
System.out.println("Before getA()");
}
no more error is thrown.

I already identified that in BundleWeaver.getNewDependencies() there are no weave infos when commenting the above simple advice. But why ...

Discussion

  • Nobody/Anonymous

    Demo of the error

     
  • Heiko Seeberger

    Heiko Seeberger - 2007-05-31

    Demo of the error for eclipse 3.1.2 and AJEER 1.x

     
  • Heiko Seeberger

    Heiko Seeberger - 2007-05-31
    • priority: 5 --> 7
    • status: open --> open-accepted
     
  • Heiko Seeberger

    Heiko Seeberger - 2007-05-31

    Logged In: YES
    user_id=1563248
    Originator: NO

    File Added: ajeer-test-3.1.2.zip

     

Log in to post a comment.