[libpostgresql-jdbc-java] 05/06: While custom type maps are not implemented, the code to detect the caller trying to use them threw a ClassCastException. Correctly detect the attempted use of custom types and bail out with a SQLException.

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


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

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

commit a7ba104037a28331270783b0fa2b89790c75ea65
Author: Kris Jurka <books at ejurka.com>
Date:   Sat Dec 1 09:18:06 2007 +0000

    While custom type maps are not implemented, the code to detect the
    caller trying to use them threw a ClassCastException.  Correctly
    detect the attempted use of custom types and bail out with a
    SQLException.
---
 org/postgresql/jdbc2/AbstractJdbc2Connection.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/org/postgresql/jdbc2/AbstractJdbc2Connection.java b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
index 850181b..b8ec4e7 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Connection.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
@@ -357,13 +357,11 @@ public abstract class AbstractJdbc2Connection implements BaseConnection
     {
         if (typemap != null)
         {
-            SQLData d = (SQLData) typemap.get(type);
-            if (d != null)
+            Class c = (Class) typemap.get(type);
+            if (c != null)
             {
                 // Handle the type (requires SQLInput & SQLOutput classes to be implemented)
-                if (Driver.logDebug)
-                    Driver.debug("getObject(String,String) with custom typemap");
-                throw org.postgresql.Driver.notImplemented(this.getClass(), "getObject(String,String)");
+                throw new PSQLException(GT.tr("Custom type maps are not supported."), PSQLState.NOT_IMPLEMENTED);
             }
         }
 

-- 
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