tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1417021 - /tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java
Date Tue, 04 Dec 2012 16:30:37 GMT
Author: kkolinko
Date: Tue Dec  4 16:30:36 2012
New Revision: 1417021

URL: http://svn.apache.org/viewvc?rev=1417021&view=rev
Log:
Simplify a loop

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

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java?rev=1417021&r1=1417020&r2=1417021&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java Tue Dec  4 16:30:36
2012
@@ -47,17 +47,16 @@ public class PojoMethodMapping {
         Method open = null;
         Method close = null;
         Method error = null;
-        Method[] methods = clazzPojo.getMethods();
-        for (int i = 0; i < methods.length; i++) {
+        for (Method method: clazzPojo.getMethods()) {
             if (open == null &&
-                    methods[i].getAnnotation(WebSocketOpen.class) != null) {
-                open = methods[i];
+                    method.getAnnotation(WebSocketOpen.class) != null) {
+                open = method;
             } else if (close == null &&
-                    methods[i].getAnnotation(WebSocketClose.class) != null) {
-                close = methods[i];
+                    method.getAnnotation(WebSocketClose.class) != null) {
+                close = method;
             } else if (error == null &&
-                    methods[i].getAnnotation(WebSocketError.class) != null) {
-                error = methods[i];
+                    method.getAnnotation(WebSocketError.class) != null) {
+                error = method;
             }
         }
         this.onOpen = open;



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


Mime
View raw message