Jaikiran wrote : What is the purpose of this code? I guess, there is some specific
scenario where this comes into picture
Yes, there is a scenario where this comes into picture. If you navigate through the call
hierarchy, you will see that this method is being invoked by both createMethodTables and
populateMethodTables, but you will see that createMethodTables invokes
populateMethodTables for the superclass of the advised classe:
protected void createMethodTables()
| throws Exception
| {
| initAdvisedMethodsMap();
| populateMethodTables(clazz.getSuperclass());
| addDeclaredMethods(clazz);
| }
Plus, populateMethodTables is recursive on the superclass:
private void populateMethodTables(Class<?> superclass)
| throws Exception
| {
| if (superclass == null) return;
| if (superclass.equals(Object.class)) return;
|
| populateMethodTables(superclass.getSuperclass());
| ...
|
So, we will first verify if the superclass has the unadvised method, if it has, we will
use it. There are specific scenarios where the superclass may have the unadvised method,
such as when there is a method in the superclass that matches a pointcut. In this
scenario, the invocation to getDeclaredMethod that you mentioned is not going to fail.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230855#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...