commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmi...@apache.org
Subject svn commit: r158012 - jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java
Date Fri, 18 Mar 2005 03:03:33 GMT
Author: dmitri
Date: Thu Mar 17 19:03:32 2005
New Revision: 158012

URL: http://svn.apache.org/viewcvs?view=rev&rev=158012
Log:
Correctly re-applied Vasiliy Stashuk's patch.

Modified:
    jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java

Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java?view=diff&r1=158011&r2=158012
==============================================================================
--- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java
(original)
+++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ValueUtils.java
Thu Mar 17 19:03:32 2005
@@ -549,18 +549,29 @@
 
         // If the declaring class is public, we are done
         Class clazz = method.getDeclaringClass();
-        while (clazz != null) {
-            if (Modifier.isPublic(clazz.getModifiers())) {
-                return (method);
-            }
+        if (Modifier.isPublic(clazz.getModifiers())) {
+            return (method);
+        }
 
+        String name = method.getName();
+        Class[] parameterTypes = method.getParameterTypes();
+        while (clazz != null) {
             // Check the implemented interfaces and subinterfaces
             Method aMethod = getAccessibleMethodFromInterfaceNest(clazz, 
-                    method.getName(), method.getParameterTypes());
+                    name, parameterTypes);
             if (aMethod != null) {
                 return aMethod;
             }
+            
             clazz = clazz.getSuperclass();
+            if (Modifier.isPublic(clazz.getModifiers())) {
+                try {
+                    return clazz.getDeclaredMethod(name, parameterTypes);
+                } 
+                catch (NoSuchMethodException e) {
+                    ;
+                }
+            }
         }
         return null;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message