Author: markt
Date: Wed Jul 3 08:14:11 2013
New Revision: 1499249
URL: http://svn.apache.org/r1499249
Log:
Re-order to simplify checking against EL spec
Modified:
tomcat/trunk/java/javax/el/CompositeELResolver.java
Modified: tomcat/trunk/java/javax/el/CompositeELResolver.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/CompositeELResolver.java?rev=1499249&r1=1499248&r2=1499249&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/CompositeELResolver.java (original)
+++ tomcat/trunk/java/javax/el/CompositeELResolver.java Wed Jul 3 08:14:11 2013
@@ -72,6 +72,52 @@ public class CompositeELResolver extends
return null;
}
+ /**
+ * @since EL 2.2
+ */
+ @Override
+ public Object invoke(ELContext context, Object base, Object method,
+ Class<?>[] paramTypes, Object[] params) {
+ context.setPropertyResolved(false);
+ int sz = this.size;
+ Object obj;
+ for (int i = 0; i < sz; i++) {
+ obj = this.resolvers[i].invoke(context, base, method, paramTypes,
+ params);
+ if (context.isPropertyResolved()) {
+ return obj;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Class<?> getType(ELContext context, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException,
ELException {
+ context.setPropertyResolved(false);
+ int sz = this.size;
+ Class<?> type;
+ for (int i = 0; i < sz; i++) {
+ type = this.resolvers[i].getType(context, base, property);
+ if (context.isPropertyResolved()) {
+ if (SCOPED_ATTRIBUTE_EL_RESOLVER != null &&
+ SCOPED_ATTRIBUTE_EL_RESOLVER.isAssignableFrom(
+ resolvers[i].getClass())) {
+ // Special case since
+ // javax.servlet.jsp.el.ScopedAttributeELResolver will
+ // always return Object.class for type
+ Object value =
+ resolvers[i].getValue(context, base, property);
+ if (value != null) {
+ return value.getClass();
+ }
+ }
+ return type;
+ }
+ }
+ return null;
+ }
+
@Override
public void setValue(ELContext context, Object base, Object property,
Object value) throws NullPointerException,
@@ -121,52 +167,6 @@ public class CompositeELResolver extends
return commonType;
}
- @Override
- public Class<?> getType(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException,
ELException {
- context.setPropertyResolved(false);
- int sz = this.size;
- Class<?> type;
- for (int i = 0; i < sz; i++) {
- type = this.resolvers[i].getType(context, base, property);
- if (context.isPropertyResolved()) {
- if (SCOPED_ATTRIBUTE_EL_RESOLVER != null &&
- SCOPED_ATTRIBUTE_EL_RESOLVER.isAssignableFrom(
- resolvers[i].getClass())) {
- // Special case since
- // javax.servlet.jsp.el.ScopedAttributeELResolver will
- // always return Object.class for type
- Object value =
- resolvers[i].getValue(context, base, property);
- if (value != null) {
- return value.getClass();
- }
- }
- return type;
- }
- }
- return null;
- }
-
- /**
- * @since EL 2.2
- */
- @Override
- public Object invoke(ELContext context, Object base, Object method,
- Class<?>[] paramTypes, Object[] params) {
- context.setPropertyResolved(false);
- int sz = this.size;
- Object obj;
- for (int i = 0; i < sz; i++) {
- obj = this.resolvers[i].invoke(context, base, method, paramTypes,
- params);
- if (context.isPropertyResolved()) {
- return obj;
- }
- }
- return null;
- }
-
private static final class FeatureIterator implements
Iterator<FeatureDescriptor> {
private final ELContext context;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]