Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] Conflicts when extending abstract aspect

Eric Simmerman wrote:
> I'm having trouble extending an abstract aspect and hope someone can give
> me
> some advice.
> I'm packaging an abstract aspect that provides introduction to a marker
> interface in a common code base. I extend the abstract aspect with an
> empty
> concrete aspect and it provides introduction correctly within the common
> code base.
> When I use that common code base as a jar/library in a new project, I'd
> like
> the same introduction performed on classes that implement the marker
> interface from the common jar. I've again, extended the abstract aspect
> with
> an empty concrete aspect, but when I attempt to compile I receive the
> following:
> 
> 
> \patterns\SingletonAspectImpl.java:12:1: public static SingletonAspectImpl
> SingletonAspectImpl.aspectOf() conflicts with public static
> SingletonAspect
> Sing
> letonAspect.aspectOf(): defined in same type
<snip>

This error message clearly shows a bug in the compiler.  You might see something like it if you tried to explicitly define an aspectOf method in your code, but I'd hope the compiler could produce something more informative in that case.  Please submit this as a bug to eclipse.org/bugs in the aspectj/compiler section.  It would help for reproducing the bug if you could reduce it to a self-contained small amount of code (either include the SingletonPattern class or figure out a way to remove it from the example).

It would also help if you could include the exact compile options you're using, i.e.
 1. ajc -outjar lib.jar SingletonPattern.java
 -- no errors
 2. ajc -injar lib.jar SingletonAspectImpl.java 
 -- produces the error...

If you can submit an easy to reproduce version of this bug in the next couple of days, then it should be fixed in the next compiler release.

-Jim


Back to the top