On 14/12/2014 11:52, ma...@apache.org wrote: > Author: markt > Date: Sun Dec 14 11:52:04 2014 > New Revision: 1645440 > > URL: http://svn.apache.org/r1645440 > Log: > Code clean-up > - no functional change > - use longer line length > - use 'new' for loops
Hmm. This appears to have broken a whole pile of stuff. Looking more carefully at the diff to figure out why now... Mark > > 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=1645440&r1=1645439&r2=1645440&view=diff > ============================================================================== > --- tomcat/trunk/java/javax/el/CompositeELResolver.java (original) > +++ tomcat/trunk/java/javax/el/CompositeELResolver.java Sun Dec 14 11:52:04 > 2014 > @@ -14,7 +14,6 @@ > * See the License for the specific language governing permissions and > * limitations under the License. > */ > - > package javax.el; > > import java.beans.FeatureDescriptor; > @@ -27,8 +26,7 @@ public class CompositeELResolver extends > static { > Class<?> clazz = null; > try { > - clazz = > - > Class.forName("javax.servlet.jsp.el.ScopedAttributeELResolver"); > + clazz = > Class.forName("javax.servlet.jsp.el.ScopedAttributeELResolver"); > } catch (ClassNotFoundException e) { > // Ignore. This is expected if using the EL stand-alone > } > @@ -60,10 +58,8 @@ public class CompositeELResolver extends > @Override > public Object getValue(ELContext context, Object base, Object property) { > context.setPropertyResolved(false); > - int sz = this.size; > - Object result = null; > - for (int i = 0; i < sz; i++) { > - result = this.resolvers[i].getValue(context, base, property); > + for (ELResolver resolver : resolvers) { > + Object result = resolver.getValue(context, base, property); > if (context.isPropertyResolved()) { > return result; > } > @@ -75,14 +71,11 @@ public class CompositeELResolver extends > * @since EL 2.2 > */ > @Override > - public Object invoke(ELContext context, Object base, Object method, > - Class<?>[] paramTypes, Object[] params) { > + 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); > + for (ELResolver resolver : resolvers) { > + Object obj = resolver.invoke(context, base, method, paramTypes, > params); > if (context.isPropertyResolved()) { > return obj; > } > @@ -93,19 +86,15 @@ public class CompositeELResolver extends > @Override > public Class<?> getType(ELContext context, Object base, Object property) > { > context.setPropertyResolved(false); > - int sz = this.size; > - Class<?> type; > - for (int i = 0; i < sz; i++) { > - type = this.resolvers[i].getType(context, base, property); > + for (ELResolver resolver : resolvers) { > + Class<?> type = resolver.getType(context, base, property); > if (context.isPropertyResolved()) { > if (SCOPED_ATTRIBUTE_EL_RESOLVER != null && > - SCOPED_ATTRIBUTE_EL_RESOLVER.isAssignableFrom( > - resolvers[i].getClass())) { > + > SCOPED_ATTRIBUTE_EL_RESOLVER.isAssignableFrom(resolver.getClass())) { > // Special case since > // javax.servlet.jsp.el.ScopedAttributeELResolver will > // always return Object.class for type > - Object value = > - resolvers[i].getValue(context, base, property); > + Object value = resolver.getValue(context, base, > property); > if (value != null) { > return value.getClass(); > } > @@ -117,12 +106,10 @@ public class CompositeELResolver extends > } > > @Override > - public void setValue(ELContext context, Object base, Object property, > - Object value) { > + public void setValue(ELContext context, Object base, Object property, > Object value) { > context.setPropertyResolved(false); > - int sz = this.size; > - for (int i = 0; i < sz; i++) { > - this.resolvers[i].setValue(context, base, property, value); > + for (ELResolver resolver : resolvers) { > + resolver.setValue(context, base, property, value); > if (context.isPropertyResolved()) { > return; > } > @@ -132,10 +119,8 @@ public class CompositeELResolver extends > @Override > public boolean isReadOnly(ELContext context, Object base, Object > property) { > context.setPropertyResolved(false); > - int sz = this.size; > - boolean readOnly = false; > - for (int i = 0; i < sz; i++) { > - readOnly = this.resolvers[i].isReadOnly(context, base, property); > + for (ELResolver resolver : resolvers) { > + boolean readOnly = resolver.isReadOnly(context, base, property); > if (context.isPropertyResolved()) { > return readOnly; > } > @@ -150,12 +135,10 @@ public class CompositeELResolver extends > > @Override > public Class<?> getCommonPropertyType(ELContext context, Object base) { > - int sz = this.size; > - Class<?> commonType = null, type = null; > - for (int i = 0; i < sz; i++) { > - type = this.resolvers[i].getCommonPropertyType(context, base); > - if (type != null && > - (commonType == null || > commonType.isAssignableFrom(type))) { > + Class<?> commonType = null; > + for (ELResolver resolver : resolvers) { > + Class<?> type = resolver.getCommonPropertyType(context, base); > + if (type != null && (commonType == null || > commonType.isAssignableFrom(type))) { > commonType = type; > } > } > @@ -165,10 +148,8 @@ public class CompositeELResolver extends > @Override > public Object convertToType(ELContext context, Object obj, Class<?> > type) { > context.setPropertyResolved(false); > - int sz = this.size; > - Object result = null; > - for (int i = 0; i < sz; i++) { > - result = this.resolvers[i].convertToType(context, obj, type); > + for (ELResolver resolver : resolvers) { > + Object result = resolver.convertToType(context, obj, type); > if (context.isPropertyResolved()) { > return result; > } > @@ -192,8 +173,7 @@ public class CompositeELResolver extends > > private FeatureDescriptor next; > > - public FeatureIterator(ELContext context, Object base, > - ELResolver[] resolvers, int size) { > + public FeatureIterator(ELContext context, Object base, ELResolver[] > resolvers, int size) { > this.context = context; > this.base = base; > this.resolvers = resolvers; > @@ -205,8 +185,7 @@ public class CompositeELResolver extends > > private void guaranteeIterator() { > while (this.itr == null && this.idx < this.size) { > - this.itr = this.resolvers[this.idx].getFeatureDescriptors( > - this.context, this.base); > + this.itr = > this.resolvers[this.idx].getFeatureDescriptors(this.context, this.base); > this.idx++; > } > } > @@ -215,7 +194,7 @@ public class CompositeELResolver extends > public boolean hasNext() { > if (this.next != null) > return true; > - if (this.itr != null){ > + if (this.itr != null) { > while (this.next == null && itr.hasNext()) { > this.next = itr.next(); > } > @@ -231,8 +210,9 @@ public class CompositeELResolver extends > > @Override > public FeatureDescriptor next() { > - if (!hasNext()) > + if (!hasNext()) { > throw new NoSuchElementException(); > + } > FeatureDescriptor result = this.next; > this.next = null; > return result; > @@ -244,5 +224,4 @@ public class CompositeELResolver extends > throw new UnsupportedOperationException(); > } > } > - > } > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org