Bug 144602 - [@AspectJ] perthis aspect fails with repetitive field in woven class
Summary: [@AspectJ] perthis aspect fails with repetitive field in woven class
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.2   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 144601 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-31 03:34 EDT by Andrew Clement CLA
Modified: 2006-05-31 05:30 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2006-05-31 03:34:45 EDT
Received on email:
Sorry if I'm not going through the proper channels, but I ran into an issue and found the following Bugzilla bug and it is strikingly familiar to my problem, and I was hoping you could help me out, or point me in the right direction.

Basically I have an aspect (using the @AspectJ style), and all is fine and good until I change it from being singleton to perthis(). The aspect is not abstract, nor does it derive from anything. I'm getting the following exception, much like the other bug:

    java.lang.ClassFormatError: Repetitive field name/signature in class file com/yada/yada/yada/MyAspect

And this is some partial output from decompiling the class:

    private transient MyAspect ajc$com_yada_yada_yada_MyAspect$perObjectField;
    private static Throwable ajc$initFailureCause;
    private transient MyAspect ajc$com_yada_yada_yada_MyAspect$perObjectField;

My aspect looks like this:

@Aspect("perthis(call( * com.yada.yada.yada.SomeClass.someMethod(..)))")
public class MyAspect {

    @Pointcut("call( * com.yada.yada.yada.SomeClass.someMethod(..)) && args(j,k, *)")
    public void pointcut( int j, int k) {}

    @Before("pointcut( j,k)")
    public void advice( int j, int k ) { … }
}

The exact same code, with @Aspect instead of @Aspect("perthis(… works fine.

Any enlightenment you can provide would be really helpful, here is the bugzilla bug link I found through Google: https://bugs.eclipse.org/bugs/show_bug.cgi?id=114436
Comment 1 Andrew Clement CLA 2006-05-31 04:00:23 EDT
*** Bug 144601 has been marked as a duplicate of this bug. ***
Comment 2 Andrew Clement CLA 2006-05-31 05:30:10 EDT
Fix committed.  Just avoid adding the perobject stuff in the BcelPerClauseAspectAdder because it is done by the PerObjectInterfaceTypeMunger.