commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1536025 - /commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/JDBCDynaClass.java
Date Sat, 26 Oct 2013 19:41:42 GMT
Author: oheger
Date: Sat Oct 26 19:41:42 2013
New Revision: 1536025

URL: http://svn.apache.org/r1536025
Log:
Generified JDBCDynaClass.

Modified:
    commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/JDBCDynaClass.java

Modified: commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/JDBCDynaClass.java
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/JDBCDynaClass.java?rev=1536025&r1=1536024&r2=1536025&view=diff
==============================================================================
--- commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/JDBCDynaClass.java
(original)
+++ commons/proper/beanutils/branches/java5/src/main/java/org/apache/commons/beanutils/JDBCDynaClass.java
Sat Oct 26 19:41:42 2013
@@ -61,13 +61,13 @@ abstract class JDBCDynaClass implements 
      * instances will be the same instances as those in the
      * <code>properties</code> list.</p>
      */
-    protected Map propertiesMap = new HashMap();
+    protected Map<String, DynaProperty> propertiesMap = new HashMap<String, DynaProperty>();
 
     /**
      * Cross Reference for column name --> dyna property name
      * (needed when lowerCase option is true)
      */
-    private Map columnNameXref;
+    private Map<String, String> columnNameXref;
 
     // ------------------------------------------------------ DynaClass Methods
 
@@ -97,7 +97,7 @@ abstract class JDBCDynaClass implements 
         if (name == null) {
             throw new IllegalArgumentException("No property name specified");
         }
-        return ((DynaProperty) propertiesMap.get(name));
+        return (propertiesMap.get(name));
 
     }
 
@@ -150,7 +150,7 @@ abstract class JDBCDynaClass implements 
      * @exception SQLException if an exception was thrown trying to load
      *  the specified class
      */
-    protected Class loadClass(String className) throws SQLException {
+    protected Class<?> loadClass(String className) throws SQLException {
 
         try {
             ClassLoader cl = Thread.currentThread().getContextClassLoader();
@@ -190,7 +190,7 @@ abstract class JDBCDynaClass implements 
         String name = lowerCase ? columnName.toLowerCase() : columnName;
         if (!name.equals(columnName)) {
             if (columnNameXref == null) {
-                columnNameXref = new HashMap();
+                columnNameXref = new HashMap<String, String>();
             }
             columnNameXref.put(name, columnName);
         }
@@ -214,7 +214,7 @@ abstract class JDBCDynaClass implements 
 
         // Default to Object type if no class name could be retrieved
         // from the metadata
-        Class clazz = Object.class;
+        Class<?> clazz = Object.class;
         if (className != null) {
             clazz = loadClass(className);
         }
@@ -236,7 +236,7 @@ abstract class JDBCDynaClass implements 
     protected void introspect(ResultSet resultSet) throws SQLException {
 
         // Accumulate an ordered list of DynaProperties
-        ArrayList list = new ArrayList();
+        ArrayList<DynaProperty> list = new ArrayList<DynaProperty>();
         ResultSetMetaData metadata = resultSet.getMetaData();
         int n = metadata.getColumnCount();
         for (int i = 1; i <= n; i++) { // JDBC is one-relative!
@@ -248,7 +248,7 @@ abstract class JDBCDynaClass implements 
 
         // Convert this list into the internal data structures we need
         properties =
-            (DynaProperty[]) list.toArray(new DynaProperty[list.size()]);
+            list.toArray(new DynaProperty[list.size()]);
         for (int i = 0; i < properties.length; i++) {
             propertiesMap.put(properties[i].getName(), properties[i]);
         }
@@ -270,7 +270,7 @@ abstract class JDBCDynaClass implements 
             throw new IllegalArgumentException("Invalid name '" + name + "'");
         }
         String columnName = getColumnName(name);
-        Class type = property.getType();
+        Class<?> type = property.getType();
 
         // java.sql.Date
         if (type.equals(Date.class)) {
@@ -299,7 +299,7 @@ abstract class JDBCDynaClass implements 
      */
     protected String getColumnName(String name) {
         if (columnNameXref != null && columnNameXref.containsKey(name)) {
-            return (String)columnNameXref.get(name);
+            return columnNameXref.get(name);
         } else {
             return name;
         }



Mime
View raw message