Skip to main content

[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

Back to the top