Author: lukaszlenart Date: Tue Jan 8 07:40:04 2013 New Revision: 1430159 URL: http://svn.apache.org/viewvc?rev=1430159&view=rev Log: Replaces for() with foreach()
Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/PropertyDescriptorCacheEntryFactory.java Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/PropertyDescriptorCacheEntryFactory.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/PropertyDescriptorCacheEntryFactory.java?rev=1430159&r1=1430158&r2=1430159&view=diff ============================================================================== --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/PropertyDescriptorCacheEntryFactory.java (original) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/PropertyDescriptorCacheEntryFactory.java Tue Jan 8 07:40:04 2013 @@ -49,23 +49,20 @@ public class PropertyDescriptorCacheEntr { pda = Introspector.getBeanInfo( targetClass ).getPropertyDescriptors(); - for ( int i = 0, icount = pda.length; i < icount; i++ ) - { + for (PropertyDescriptor aPda : pda) { // workaround for Introspector bug 6528714 (bugs.sun.com) - if ( pda[i].getReadMethod() != null && !OgnlRuntime.isMethodCallable( pda[i].getReadMethod() ) ) - { - pda[i].setReadMethod( - findClosestMatchingMethod( targetClass, pda[i].getReadMethod(), pda[i].getName(), - pda[i].getPropertyType(), true ) ); - } - if ( pda[i].getWriteMethod() != null && !OgnlRuntime.isMethodCallable( pda[i].getWriteMethod() ) ) - { - pda[i].setWriteMethod( - findClosestMatchingMethod( targetClass, pda[i].getWriteMethod(), pda[i].getName(), - pda[i].getPropertyType(), false ) ); + if (aPda.getReadMethod() != null && !OgnlRuntime.isMethodCallable(aPda.getReadMethod())) { + aPda.setReadMethod( + findClosestMatchingMethod(targetClass, aPda.getReadMethod(), aPda.getName(), + aPda.getPropertyType(), true)); + } + if (aPda.getWriteMethod() != null && !OgnlRuntime.isMethodCallable(aPda.getWriteMethod())) { + aPda.setWriteMethod( + findClosestMatchingMethod(targetClass, aPda.getWriteMethod(), aPda.getName(), + aPda.getPropertyType(), false)); } - result.put( pda[i].getName(), pda[i] ); + result.put(aPda.getName(), aPda); } findObjectIndexedPropertyDescriptors( targetClass, result );