[libpostgresql-jdbc-java] 07/14: Update getObject and getArray methods that take a map to only bail out with a not implemented exception if the supplied map is not null and not empty. Apparently Sun's WebRowSet implementation passes empty Maps to these methods.

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:19:51 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to tag REL8_1_405
in repository libpostgresql-jdbc-java.

commit f367d8d85d77605b17728354bec7a61bbb297062
Author: Kris Jurka <books at ejurka.com>
Date:   Sun Dec 4 21:41:21 2005 +0000

    Update getObject and getArray methods that take a map to only
    bail out with a not implemented exception if the supplied map is
    not null and not empty.  Apparently Sun's WebRowSet implementation
    passes empty Maps to these methods.
    
    Report and analysis by Gunnar Stefansson.
---
 org/postgresql/jdbc2/AbstractJdbc2Array.java     | 4 ++--
 org/postgresql/jdbc2/AbstractJdbc2ResultSet.java | 5 ++++-
 org/postgresql/jdbc2/AbstractJdbc2Statement.java | 5 ++++-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/org/postgresql/jdbc2/AbstractJdbc2Array.java b/org/postgresql/jdbc2/AbstractJdbc2Array.java
index afaf122..4bb1445 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Array.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Array.java
@@ -3,7 +3,7 @@
 * Copyright (c) 2004-2005, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Array.java,v 1.14 2005/02/15 08:56:25 jurka Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Array.java,v 1.15 2005/08/01 06:54:14 oliver Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -84,7 +84,7 @@ public class AbstractJdbc2Array
 
     public Object getArrayImpl(long index, int count, Map map) throws SQLException
     {
-        if ( map != null ) // For now maps aren't supported.
+        if ( map != null && !map.isEmpty()) // For now maps aren't supported.
             throw org.postgresql.Driver.notImplemented(this.getClass(), "getArrayImpl(long,int,Map)");
 
         if (index < 1)
diff --git a/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java b/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
index 25f1e9d..d0a9b0a 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
@@ -3,7 +3,7 @@
 * Copyright (c) 2003-2005, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v 1.79 2005/10/25 22:44:27 davec Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v 1.80 2005/11/05 09:24:15 jurka Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -459,6 +459,9 @@ public abstract class AbstractJdbc2ResultSet implements BaseResultSet, org.postg
     public Object getObjectImpl(int i, java.util.Map map) throws SQLException
     {
         checkClosed();
+        if (map == null || map.isEmpty()) {
+            return getObject(i);
+        }
         throw org.postgresql.Driver.notImplemented(this.getClass(), "getObjectImpl(int,Map)");
     }
 
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java
index 8d82569..83e4c4d 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Statement.java
@@ -3,7 +3,7 @@
 * Copyright (c) 2004-2005, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.83 2005/09/29 20:49:22 jurka Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.84 2005/10/03 17:27:31 jurka Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -2976,6 +2976,9 @@ public abstract class AbstractJdbc2Statement implements BaseStatement
 
     public Object getObjectImpl(int i, java.util.Map map) throws SQLException
     {
+        if (map == null || map.isEmpty()) {
+            return getObject(i);
+        }
         throw Driver.notImplemented(this.getClass(), "getObjectImpl(int,Map)");
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list