You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bval.apache.org by si...@apache.org on 2010/03/31 21:47:36 UTC

svn commit: r929688 - /incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/PropertyAccess.java

Author: simonetripodi
Date: Wed Mar 31 19:47:35 2010
New Revision: 929688

URL: http://svn.apache.org/viewvc?rev=929688&view=rev
Log:
added generics parameters

Modified:
    incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/PropertyAccess.java

Modified: incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/PropertyAccess.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/PropertyAccess.java?rev=929688&r1=929687&r2=929688&view=diff
==============================================================================
--- incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/PropertyAccess.java (original)
+++ incubator/bval/trunk/bval-core/src/main/java/org/apache/bval/util/PropertyAccess.java Wed Mar 31 19:47:35 2010
@@ -34,11 +34,11 @@ import java.util.Map;
  * Copyright: Agimatec GmbH
  */
 public class PropertyAccess extends AccessStrategy {
-    private final Class beanClass;
+    private final Class<?> beanClass;
     private final String propertyName;
     private Field rememberField;
 
-    public PropertyAccess(Class clazz, String propertyName) {
+    public PropertyAccess(Class<?> clazz, String propertyName) {
         this.beanClass = clazz;
         this.propertyName = propertyName;
     }
@@ -49,8 +49,8 @@ public class PropertyAccess extends Acce
 
     public static Object getProperty(Object bean, String property) throws
           InvocationTargetException, NoSuchMethodException, IllegalAccessException {
-        if (bean instanceof Map) {
-            return ((Map) bean).get(property);
+        if (bean instanceof Map<?, ?>) {
+            return ((Map<?, ?>) bean).get(property);
         } else { // supports DynaBean and standard Objects
             return PropertyUtils.getSimpleProperty(bean, property);
         }
@@ -76,7 +76,7 @@ public class PropertyAccess extends Acce
             return beanClass.getField(propertyName).getGenericType();
         } catch (NoSuchFieldException ex2) {
             // search for private/protected field up the hierarchy
-            Class theClass = beanClass;
+            Class<?> theClass = beanClass;
             while (theClass != null) {
                 try {
                     return theClass.getDeclaredField(propertyName).getGenericType();
@@ -110,7 +110,7 @@ public class PropertyAccess extends Acce
                     return value;
                 } catch (NoSuchFieldException ex2) {
                     // search for private/protected field up the hierarchy
-                    Class theClass = bean.getClass();
+                    Class<?> theClass = bean.getClass();
                     while (theClass != null) {
                         try {
                             Field aField = theClass