Author: markt
Date: Sun Mar 17 11:59:55 2013
New Revision: 1457429

URL: http://svn.apache.org/r1457429
Log:
Renames to make code clearer
Fix a bug - only look for a Throwable for onError methods

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java?rev=1457429&r1=1457428&r2=1457429&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java 
Sun Mar 17 11:59:55 2013
@@ -170,11 +170,11 @@ public class PojoMethodMapping {
     }
 
 
-    private static PojoPathParam[] getPathParams(Method m, boolean isError) {
+    private static PojoPathParam[] getPathParams(Method m, boolean isOnError) {
         if (m == null) {
             return new PojoPathParam[0];
         }
-        boolean foundError = !isError;
+        boolean foundThrowable = !isOnError;
         Class<?>[] types = m.getParameterTypes();
         Annotation[][] paramsAnnotations = m.getParameterAnnotations();
         PojoPathParam[] result = new PojoPathParam[types.length];
@@ -182,8 +182,8 @@ public class PojoMethodMapping {
             Class<?> type = types[i];
             if (type.equals(Session.class)) {
                 result[i] = new PojoPathParam(type, null);
-            } else if (type.equals(Throwable.class)) {
-                foundError = true;
+            } else if (isOnError && type.equals(Throwable.class)) {
+                foundThrowable = true;
                 result[i] = new PojoPathParam(type, null);
             } else {
                 Annotation[] paramAnnotations = paramsAnnotations[i];
@@ -201,7 +201,7 @@ public class PojoMethodMapping {
                 }
             }
         }
-        if (!foundError) {
+        if (!foundThrowable) {
             // TODO i18n
             throw new IllegalArgumentException();
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to