[libpostgresql-jdbc-java] 08/09: 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:20:08 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to tag REL8_1_411
in repository libpostgresql-jdbc-java.
commit 12ec7e8c23e316a225c35722a3632ae15ae177fb
Author: Kris Jurka <books at ejurka.com>
Date: Sat Dec 1 09:17:59 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 07a9a8a..f2ca327 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Connection.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
@@ -363,13 +363,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