Author: markt
Date: Fri Jun 28 19:10:42 2013
New Revision: 1497894

URL: http://svn.apache.org/r1497894
Log:
Re-order to make checking against EL Spec RI easier

Modified:
    tomcat/trunk/java/javax/el/ArrayELResolver.java

Modified: tomcat/trunk/java/javax/el/ArrayELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ArrayELResolver.java?rev=1497894&r1=1497893&r2=1497894&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ArrayELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ArrayELResolver.java Fri Jun 28 19:10:42 2013
@@ -35,7 +35,7 @@ public class ArrayELResolver extends ELR
     }
 
     @Override
-    public Object getValue(ELContext context, Object base, Object property)
+    public Class<?> getType(ELContext context, Object base, Object property)
             throws NullPointerException, PropertyNotFoundException, 
ELException {
         if (context == null) {
             throw new NullPointerException();
@@ -44,17 +44,15 @@ public class ArrayELResolver extends ELR
         if (base != null && base.getClass().isArray()) {
             context.setPropertyResolved(true);
             int idx = coerce(property);
-            if (idx < 0 || idx >= Array.getLength(base)) {
-                return null;
-            }
-            return Array.get(base, idx);
+            checkBounds(base, idx);
+            return base.getClass().getComponentType();
         }
 
         return null;
     }
 
     @Override
-    public Class<?> getType(ELContext context, Object base, Object property)
+    public Object getValue(ELContext context, Object base, Object property)
             throws NullPointerException, PropertyNotFoundException, 
ELException {
         if (context == null) {
             throw new NullPointerException();
@@ -63,8 +61,10 @@ public class ArrayELResolver extends ELR
         if (base != null && base.getClass().isArray()) {
             context.setPropertyResolved(true);
             int idx = coerce(property);
-            checkBounds(base, idx);
-            return base.getClass().getComponentType();
+            if (idx < 0 || idx >= Array.getLength(base)) {
+                return null;
+            }
+            return Array.get(base, idx);
         }
 
         return null;



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

Reply via email to