[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] suspicious super call interception

Sample code:

public aspect WSPortFixerInterceptor {
ÂÂÂ pointcut wsGetPortCall() :
ÂÂÂ ÂÂÂ call(Object javax.xml.ws.Service+.getPort(..));
ÂÂÂ
ÂÂÂ Object around() : wsGetPortCall() {
ÂÂÂ ÂÂÂ return WsClientTool.getInstance().fixWebServicePort(proceed());ÂÂ // never mind this line
ÂÂÂ }

ÂÂÂ
ÂÂÂ /** private inner class to verify correct interception */
ÂÂÂ @SuppressWarnings("unused")
ÂÂÂ private static class TestFixer {
ÂÂÂ ÂÂÂ {
ÂÂÂ ÂÂÂ ÂÂÂ new Service(null, null) {

ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ @SuppressWarnings("unused")
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ public void boo() {
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ super.getPort(null);ÂÂÂ // (1)
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ getPort(null);ÂÂÂÂÂÂÂÂÂÂÂÂ // (2)
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ }
ÂÂÂ ÂÂÂ ÂÂÂ };
ÂÂÂ ÂÂÂ }
ÂÂÂ }
}

To my best knowledge, the two calls at (1) and (2) does the very same in Java, but appearently (2) gets intercepted by this aspect and (1) does not.. what's the explanation for this behaviour?

thanks,
K