Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Multiple Method Introductions: patterns?

First, thank you to Wes and Ramnivas for the suggestions.

This would be great, however, there is no getInputSource() method.  I need
to get directly into the class and access its member variable inputSource.

Let me explain the problem.   First, here are the two definitions of the
types found on the AJ website:

declare parents: TypePattern implements TypeList;
Modifiers Type TypePattern . Id(Formals) { Body }

My question is this, why is the following legal:

declare parents: (org.apache.cocoon.generation.TextGenerator ||
org.apache.cocoon.generation.asciiart.AsciiArtSVGGenerator) implements
CacheableProcessingComponent;

While this is invalid:
public Serializable (org.apache.cocoon.generation.TextGenerator ||
org.apache.cocoon.generation.asciiart.AsciiArtSVGGenerator).generateKey() {
    return this.inputSource.getURI();
}

According to the rules defined above, the second should be legal, but it is
not.  Is this a bug or am I missing something?

If I am trying to encapsulate this method into an aspect from lots of
different disparate classes, it does me no good to simply move the method
declaration into an aspect when the same method already exists in it! ... I
now have unnecessary code duplication in my aspect.

Thanks,

Jeff



Back to the top