From 939d7fc4c96ac49078d44b99dcf0b2555e40fc11 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Sat, 11 Feb 2012 14:26:31 +0000 Subject: [PATCH] Remove defenses against non-JDBC4 class existance --- .../hibernate/internal/CoreMessageLogger.java | 4 ---- .../type/descriptor/java/DataHelper.java | 16 ++-------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java index 130e1a542c..1b0908a3a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java @@ -1135,10 +1135,6 @@ public interface CoreMessageLogger extends BasicLogger { @Message(value = "Unable to locate MBeanServer on JMX service shutdown", id = 332) void unableToLocateMBeanServer(); - @LogMessage(level = INFO) - @Message(value = "Could not locate 'java.sql.NClob' class; assuming JDBC 3", id = 333) - void unableToLocateNClobClass(); - @LogMessage(level = WARN) @Message(value = "Unable to locate requested UUID generation strategy class : %s", id = 334) void unableToLocateUuidGenerationStrategy(String strategyClassName); diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DataHelper.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DataHelper.java index 21a894c592..5543a727cb 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DataHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DataHelper.java @@ -33,7 +33,6 @@ import org.jboss.logging.Logger; import org.hibernate.HibernateException; import org.hibernate.internal.CoreMessageLogger; -import org.hibernate.internal.util.ReflectHelper; import org.hibernate.type.descriptor.BinaryStream; /** @@ -45,19 +44,8 @@ public class DataHelper { private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, DataHelper.class.getName() ); - private static Class nClobClass; - static { - try { - // NClobs are only JDBC 4 (JDK 1.6) and higher - nClobClass = ReflectHelper.classForName( "java.sql.NClob", DataHelper.class ); - } - catch ( ClassNotFoundException e ) { - LOG.unableToLocateNClobClass(); - } - } - - public static boolean isNClob(Class type) { - return nClobClass != null && nClobClass.isAssignableFrom( type ); + public static boolean isNClob(final Class type) { + return java.sql.NClob.class.isAssignableFrom( type ); } /**