diff --git a/hibernate-c3p0/src/main/java/org/hibernate/service/jdbc/connections/internal/C3P0ConnectionProvider.java b/hibernate-c3p0/src/main/java/org/hibernate/service/jdbc/connections/internal/C3P0ConnectionProvider.java index 49a8c3f30c..12dc31e2ae 100644 --- a/hibernate-c3p0/src/main/java/org/hibernate/service/jdbc/connections/internal/C3P0ConnectionProvider.java +++ b/hibernate-c3p0/src/main/java/org/hibernate/service/jdbc/connections/internal/C3P0ConnectionProvider.java @@ -212,8 +212,8 @@ public class C3P0ConnectionProvider implements ConnectionProvider, Configurable, String i = (String) props.get( Environment.ISOLATION ); if (i == null) isolation = null; else { - isolation = new Integer( i ); - LOG.jdbcIsolationLevel(Environment.isolationLevelToString(isolation.intValue())); + isolation = Integer.valueOf( i ); + LOG.jdbcIsolationLevel(Environment.isolationLevelToString(isolation)); } } diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/instrumentation/internal/javassist/FieldInterceptorImpl.java b/hibernate-core/src/main/java/org/hibernate/bytecode/instrumentation/internal/javassist/FieldInterceptorImpl.java index 8407b62715..c593a53e75 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/instrumentation/internal/javassist/FieldInterceptorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/instrumentation/internal/javassist/FieldInterceptorImpl.java @@ -57,7 +57,7 @@ public final class FieldInterceptorImpl extends AbstractFieldInterceptor impleme // FieldHandler impl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public boolean readBoolean(Object target, String name, boolean oldValue) { - return ( ( Boolean ) intercept( target, name, oldValue ? Boolean.TRUE : Boolean.FALSE ) ) + return ( ( Boolean ) intercept( target, name, oldValue ) ) .booleanValue(); } @@ -107,7 +107,7 @@ public final class FieldInterceptorImpl extends AbstractFieldInterceptor impleme public boolean writeBoolean(Object target, String name, boolean oldValue, boolean newValue) { dirty(); - intercept( target, name, oldValue ? Boolean.TRUE : Boolean.FALSE ); + intercept( target, name, oldValue ); return newValue; } diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/internal/javassist/ProxyFactoryFactoryImpl.java b/hibernate-core/src/main/java/org/hibernate/bytecode/internal/javassist/ProxyFactoryFactoryImpl.java index 5fce7a5887..73db828ef9 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/internal/javassist/ProxyFactoryFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/internal/javassist/ProxyFactoryFactoryImpl.java @@ -118,10 +118,10 @@ public class ProxyFactoryFactoryImpl implements ProxyFactoryFactory { return proxiedClassName + "@" + System.identityHashCode( object ); } else if ( "equals".equals( name ) ) { - return proxiedObject == object ? Boolean.TRUE : Boolean.FALSE; + return proxiedObject == object; } else if ( "hashCode".equals( name ) ) { - return new Integer( System.identityHashCode( object ) ); + return System.identityHashCode( object ); } boolean hasGetterSignature = method.getParameterTypes().length == 0 && method.getReturnType() != null; boolean hasSetterSignature = method.getParameterTypes().length == 1 && ( method.getReturnType() == null || method.getReturnType() == void.class ); diff --git a/hibernate-core/src/main/java/org/hibernate/cache/internal/StandardQueryCache.java b/hibernate-core/src/main/java/org/hibernate/cache/internal/StandardQueryCache.java index a36089f41a..c80e8853ba 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/internal/StandardQueryCache.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/internal/StandardQueryCache.java @@ -91,7 +91,7 @@ public class StandardQueryCache implements QueryCache { boolean isNaturalKeyLookup, SessionImplementor session) throws HibernateException { if (isNaturalKeyLookup && result.size() == 0) return false; - Long ts = new Long(session.getFactory().getSettings().getRegionFactory().nextTimestamp()); + Long ts = session.getFactory().getSettings().getRegionFactory().nextTimestamp(); LOG.debugf( "Caching query results in region: %s; timestamp=%s", cacheRegion.getName(), ts ); diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/UpdateTimestampsCache.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/UpdateTimestampsCache.java index c8d21999e4..6b47692f6b 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/UpdateTimestampsCache.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/UpdateTimestampsCache.java @@ -73,7 +73,7 @@ public class UpdateTimestampsCache { readWriteLock.writeLock().lock(); try { - Long ts = new Long( region.nextTimestamp() + region.getTimeout() ); + Long ts = region.nextTimestamp() + region.getTimeout(); for ( Serializable space : spaces ) { LOG.debugf( "Pre-invalidating space [%s]", space ); //put() has nowait semantics, is this really appropriate? @@ -94,7 +94,7 @@ public class UpdateTimestampsCache { readWriteLock.writeLock().lock(); try { - Long ts = new Long( region.nextTimestamp() ); + Long ts = region.nextTimestamp(); for (Serializable space : spaces) { LOG.debugf( "Invalidating space [%s], timestamp: %s", space, ts ); //put() has nowait semantics, is this really appropriate? diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/entry/StructuredCacheEntry.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/entry/StructuredCacheEntry.java index 040bc3ac06..095f91606c 100755 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/entry/StructuredCacheEntry.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/entry/StructuredCacheEntry.java @@ -61,7 +61,7 @@ public class StructuredCacheEntry implements CacheEntryStructure { Map map = new HashMap(names.length+2); map.put( "_subclass", entry.getSubclass() ); map.put( "_version", entry.getVersion() ); - map.put( "_lazyPropertiesUnfetched", entry.areLazyPropertiesUnfetched() ? Boolean.TRUE : Boolean.FALSE ); + map.put( "_lazyPropertiesUnfetched", entry.areLazyPropertiesUnfetched() ); for ( int i=0; i arraySize ) { - for ( int i=arraySize; i list.size() ) { for ( int i=list.size(); i implements TypedQuery { else if ( SPEC_HINT_TIMEOUT.equals( hintName ) ) { // convert milliseconds to seconds int timeout = (int)Math.round(ConfigurationHelper.getInteger( value ).doubleValue() / 1000.0 ); - applyTimeout( new Integer(timeout) ); + applyTimeout( timeout ); } else if ( HINT_COMMENT.equals( hintName ) ) { applyComment( (String) value ); diff --git a/hibernate-entitymanager/src/main/java/org/hibernate/ejb/Ejb3Configuration.java b/hibernate-entitymanager/src/main/java/org/hibernate/ejb/Ejb3Configuration.java index 1144591026..054bac22f4 100644 --- a/hibernate-entitymanager/src/main/java/org/hibernate/ejb/Ejb3Configuration.java +++ b/hibernate-entitymanager/src/main/java/org/hibernate/ejb/Ejb3Configuration.java @@ -660,7 +660,7 @@ public class Ejb3Configuration implements Serializable, Referenceable { } if ( ! overridenDatasource && ( info.getJtaDataSource() != null || info.getNonJtaDataSource() != null ) ) { - isJTA = info.getJtaDataSource() != null ? Boolean.TRUE : Boolean.FALSE; + isJTA = info.getJtaDataSource() != null; this.setDataSource( isJTA ? info.getJtaDataSource() : info.getNonJtaDataSource() );