commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject commons-dbutils git commit: [DBUTILS-136] CaseInsensitiveHashMap cannot be accessed by subclasses of BasicRowProcessor; add org.apache.commons.dbutils.BasicRowProcessor.createCaseInsensitiveHashMap(int).
Date Sun, 24 Dec 2017 19:06:01 GMT
Repository: commons-dbutils
Updated Branches:
  refs/heads/master 001e87db6 -> 8ba8691a9


[DBUTILS-136] CaseInsensitiveHashMap cannot be accessed by subclasses of
BasicRowProcessor; add
org.apache.commons.dbutils.BasicRowProcessor.createCaseInsensitiveHashMap(int).

Project: http://git-wip-us.apache.org/repos/asf/commons-dbutils/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbutils/commit/8ba8691a
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbutils/tree/8ba8691a
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbutils/diff/8ba8691a

Branch: refs/heads/master
Commit: 8ba8691a90997d540a31d5a5f16c62fc84bd4bb9
Parents: 001e87d
Author: Gary Gregory <ggregory@apache.org>
Authored: Sun Dec 24 12:05:59 2017 -0700
Committer: Gary Gregory <ggregory@apache.org>
Committed: Sun Dec 24 12:05:59 2017 -0700

----------------------------------------------------------------------
 src/changes/changes.xml                                       | 3 +++
 .../java/org/apache/commons/dbutils/BasicRowProcessor.java    | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-dbutils/blob/8ba8691a/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 06c36c7..cd84411 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -51,6 +51,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action dev="ggregory" type="update" issue="DBUTILS-137" due-to="Gary Gregory">
         Inefficient allocation of Maps in org.apache.commons.dbutils.BasicRowProcessor.toMap(ResultSet).
       </action>
+      <action dev="ggregory" type="add" issue="DBUTILS-136" due-to="Matthew Hall, Gary
Gregory">
+        CaseInsensitiveHashMap cannot be accessed by subclasses of BasicRowProcessor; add
org.apache.commons.dbutils.BasicRowProcessor.createCaseInsensitiveHashMap(int).
+      </action>
     </release>
     
     <release version="1.7" date="2017-07-20" description="Bug fixes and separate column
&amp; property handlers using SPI">

http://git-wip-us.apache.org/repos/asf/commons-dbutils/blob/8ba8691a/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java b/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
index c596a8c..f5a5bc8 100644
--- a/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
+++ b/src/main/java/org/apache/commons/dbutils/BasicRowProcessor.java
@@ -47,6 +47,10 @@ public class BasicRowProcessor implements RowProcessor {
      */
     private static final BasicRowProcessor instance = new BasicRowProcessor();
 
+    protected static LinkedHashMap<String, Object> createCaseInsensitiveHashMap(int
cols) {
+        return new CaseInsensitiveHashMap(cols);
+    }
+
     /**
      * Returns the Singleton instance of this class.
      *
@@ -159,7 +163,7 @@ public class BasicRowProcessor implements RowProcessor {
     public Map<String, Object> toMap(ResultSet rs) throws SQLException {
         ResultSetMetaData rsmd = rs.getMetaData();
         int cols = rsmd.getColumnCount();
-        Map<String, Object> result = new CaseInsensitiveHashMap(cols);
+        Map<String, Object> result = createCaseInsensitiveHashMap(cols);
 
         for (int i = 1; i <= cols; i++) {
             String columnName = rsmd.getColumnLabel(i);
@@ -172,6 +176,7 @@ public class BasicRowProcessor implements RowProcessor {
         return result;
     }
 
+
     /**
      * A Map that converts all keys to lowercase Strings for case insensitive
      * lookups.  This is needed for the toMap() implementation because


Mime
View raw message