struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbened...@apache.org
Subject svn commit: r744821 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher: AbstractMethodResolver.java servlet/ServletMethodResolver.java
Date Mon, 16 Feb 2009 06:51:37 GMT
Author: pbenedict
Date: Mon Feb 16 06:51:36 2009
New Revision: 744821

URL: http://svn.apache.org/viewvc?rev=744821&view=rev
Log:
STR-3168: Prefer getMethod() to getDeclaredMethod() so inherited methods can be invoked

Modified:
    struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/AbstractMethodResolver.java
    struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/servlet/ServletMethodResolver.java

Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/AbstractMethodResolver.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/AbstractMethodResolver.java?rev=744821&r1=744820&r2=744821&view=diff
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/AbstractMethodResolver.java
(original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/AbstractMethodResolver.java
Mon Feb 16 06:51:36 2009
@@ -79,13 +79,13 @@
 
         // Does the method accept nothing?
         try {
-            return actionClass.getDeclaredMethod(methodName, EMPTY_ARGUMENT_TYPES);
+            return actionClass.getMethod(methodName, EMPTY_ARGUMENT_TYPES);
         } catch (NoSuchMethodException e) {
             // continue
         }
 
         // Does the method accept the action context?
-        return actionClass.getDeclaredMethod(methodName, ACTION_CONTEXT_ARGUMENT_TYPES);
+        return actionClass.getMethod(methodName, ACTION_CONTEXT_ARGUMENT_TYPES);
     }
 
 }

Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/servlet/ServletMethodResolver.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/servlet/ServletMethodResolver.java?rev=744821&r1=744820&r2=744821&view=diff
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/servlet/ServletMethodResolver.java
(original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/dispatcher/servlet/ServletMethodResolver.java
Mon Feb 16 06:51:36 2009
@@ -119,7 +119,7 @@
         if (context instanceof ServletActionContext) {
             try {
                 Class actionClass = context.getAction().getClass();
-                return actionClass.getDeclaredMethod(methodName, new Class[] { ServletActionContext.class
});
+                return actionClass.getMethod(methodName, new Class[] { ServletActionContext.class
});
             } catch (NoSuchMethodException e) {
                 // continue
             }



Mime
View raw message