From: Kabir K. <ka...@us...> - 2004-06-23 18:33:47
|
User: kabkhan Date: 04/06/23 11:33:41 Modified: src/main/org/jboss/aop/reflection ReflectionAspect.java Log: added support for optimized field execution invocation. Revision Changes Path 1.4 +8 -4 jboss-aop/src/main/org/jboss/aop/reflection/ReflectionAspect.java Index: ReflectionAspect.java =================================================================== RCS file: /cvsroot/jboss/jboss-aop/src/main/org/jboss/aop/reflection/ReflectionAspect.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ReflectionAspect.java 20 Jun 2004 14:51:38 -0000 1.3 +++ ReflectionAspect.java 23 Jun 2004 18:33:40 -0000 1.4 @@ -651,8 +651,8 @@ Object[] advisedMethods = advisor.getAdvisedMethods().getValues(); ArrayList methods = new ArrayList(advisedMethods.length); - - for (int i = 0 ; i < advisedMethods.length ; i++){ + + for (int i = 0 ; i < advisedMethods.length ; i++){ Method m = (Method)advisedMethods[i]; if (clazz.equals(m.getDeclaringClass()) && isNotAccessMethod(m)){ methods.add(m); @@ -692,14 +692,18 @@ * @return true if this method is static, void, has package access and has a name like access$0, access$1 etc. */ private boolean isNotAccessMethod(Method m){ - if (m.getReturnType().equals(Void.TYPE)){ + + //TODO: Normally access methods should return void, but having optimised field invocation + //it seems that javassist occasionally creates these methods with other return types + + //if (m.getReturnType().equals(Void.TYPE)){ if (Modifier.STATIC == m.getModifiers()){ Matcher match = accessMethodPattern.matcher(m.getName()); if (match.matches()){ return false; } } - } + //} return true; } |