You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/05/23 09:31:30 UTC
svn commit: r1126349 -
/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
Author: simonetripodi
Date: Mon May 23 07:31:29 2011
New Revision: 1126349
URL: http://svn.apache.org/viewvc?rev=1126349&view=rev
Log:
added raw types to the Map that stores properies name/PropertyDescriptor
removed unneeded casts
Modified:
incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
Modified: incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
URL: http://svn.apache.org/viewvc/incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java?rev=1126349&r1=1126348&r2=1126349&view=diff
==============================================================================
--- incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java (original)
+++ incubator/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlRuntime.java Mon May 23 07:31:29 2011
@@ -2197,18 +2197,18 @@ public class OgnlRuntime
* @throws IntrospectionException on errors using {@link Introspector}.
* @throws OgnlException On general errors.
*/
- public static Map getPropertyDescriptors( Class<?> targetClass )
+ public static Map<String, PropertyDescriptor> getPropertyDescriptors( Class<?> targetClass )
throws IntrospectionException, OgnlException
{
- Map result;
+ Map<String, PropertyDescriptor> result;
synchronized ( _propertyDescriptorCache )
{
- if ( ( result = (Map) _propertyDescriptorCache.get( targetClass ) ) == null )
+ if ( ( result = _propertyDescriptorCache.get( targetClass ) ) == null )
{
PropertyDescriptor[] pda = Introspector.getBeanInfo( targetClass ).getPropertyDescriptors();
- result = new HashMap( 101 );
+ result = new HashMap<String, PropertyDescriptor>( 101 );
for ( int i = 0, icount = pda.length; i < icount; i++ )
{
// workaround for Introspector bug 6528714 (bugs.sun.com)
@@ -2246,7 +2246,7 @@ public class OgnlRuntime
if ( targetClass == null )
return null;
- return (PropertyDescriptor) getPropertyDescriptors( targetClass ).get( propertyName );
+ return getPropertyDescriptors( targetClass ).get( propertyName );
}
static Method findClosestMatchingMethod( Class<?> targetClass, Method m, String propertyName, Class<?> propertyType,