HHH-8211 Checkstyle and FindBugs fix-ups

This commit is contained in:
Strong Liu 2013-07-13 10:59:41 +08:00
parent 0433a539b4
commit 1825a4762c
447 changed files with 723 additions and 855 deletions

View File

@ -46,7 +46,6 @@ import org.hibernate.proxy.LazyInitializer;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@SuppressWarnings( {"UnnecessaryUnboxing", "UnnecessaryBoxing"})
final class FieldInterceptorImpl extends AbstractFieldInterceptor implements FieldHandler, Serializable { final class FieldInterceptorImpl extends AbstractFieldInterceptor implements FieldHandler, Serializable {
FieldInterceptorImpl(SessionImplementor session, Set uninitializedFields, String entityName) { FieldInterceptorImpl(SessionImplementor session, Set uninitializedFields, String entityName) {
@ -55,39 +54,39 @@ final class FieldInterceptorImpl extends AbstractFieldInterceptor implements Fie
// FieldHandler impl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // FieldHandler impl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
public boolean readBoolean(Object target, String name, boolean oldValue) { public boolean readBoolean(Object target, String name, boolean oldValue) {
return ( (Boolean) intercept( target, name, oldValue ) ).booleanValue(); return (Boolean) intercept( target, name, oldValue );
} }
@Override
public byte readByte(Object target, String name, byte oldValue) { public byte readByte(Object target, String name, byte oldValue) {
return ( (Byte) intercept( target, name, Byte.valueOf( oldValue ) ) ).byteValue(); return (Byte) intercept( target, name, oldValue );
} }
@Override
public char readChar(Object target, String name, char oldValue) { public char readChar(Object target, String name, char oldValue) {
return ( (Character) intercept( target, name, Character.valueOf( oldValue ) ) ).charValue(); return (Character) intercept( target, name, oldValue );
} }
@Override
public double readDouble(Object target, String name, double oldValue) { public double readDouble(Object target, String name, double oldValue) {
return ( (Double) intercept( target, name, Double.valueOf( oldValue ) ) ).doubleValue(); return (Double) intercept( target, name, oldValue );
} }
@Override
public float readFloat(Object target, String name, float oldValue) { public float readFloat(Object target, String name, float oldValue) {
return ( (Float) intercept( target, name, Float.valueOf( oldValue ) ) ).floatValue(); return (Float) intercept( target, name, oldValue );
} }
@Override
public int readInt(Object target, String name, int oldValue) { public int readInt(Object target, String name, int oldValue) {
return ( (Integer) intercept( target, name, Integer.valueOf( oldValue ) ) ); return (Integer) intercept( target, name, oldValue );
} }
@Override
public long readLong(Object target, String name, long oldValue) { public long readLong(Object target, String name, long oldValue) {
return ( (Long) intercept( target, name, Long.valueOf( oldValue ) ) ).longValue(); return (Long) intercept( target, name, oldValue );
} }
@Override
public short readShort(Object target, String name, short oldValue) { public short readShort(Object target, String name, short oldValue) {
return ( (Short) intercept( target, name, Short.valueOf( oldValue ) ) ).shortValue(); return (Short) intercept( target, name, oldValue );
} }
@Override
public Object readObject(Object target, String name, Object oldValue) { public Object readObject(Object target, String name, Object oldValue) {
Object value = intercept( target, name, oldValue ); Object value = intercept( target, name, oldValue );
if ( value instanceof HibernateProxy ) { if ( value instanceof HibernateProxy ) {
@ -98,61 +97,61 @@ final class FieldInterceptorImpl extends AbstractFieldInterceptor implements Fie
} }
return value; return value;
} }
@Override
public boolean writeBoolean(Object target, String name, boolean oldValue, boolean newValue) { public boolean writeBoolean(Object target, String name, boolean oldValue, boolean newValue) {
dirty(); dirty();
intercept( target, name, oldValue ); intercept( target, name, oldValue );
return newValue; return newValue;
} }
@Override
public byte writeByte(Object target, String name, byte oldValue, byte newValue) { public byte writeByte(Object target, String name, byte oldValue, byte newValue) {
dirty(); dirty();
intercept( target, name, Byte.valueOf( oldValue ) ); intercept( target, name, oldValue );
return newValue; return newValue;
} }
@Override
public char writeChar(Object target, String name, char oldValue, char newValue) { public char writeChar(Object target, String name, char oldValue, char newValue) {
dirty(); dirty();
intercept( target, name, Character.valueOf( oldValue ) ); intercept( target, name, oldValue );
return newValue; return newValue;
} }
@Override
public double writeDouble(Object target, String name, double oldValue, double newValue) { public double writeDouble(Object target, String name, double oldValue, double newValue) {
dirty(); dirty();
intercept( target, name, Double.valueOf( oldValue ) ); intercept( target, name, oldValue );
return newValue; return newValue;
} }
@Override
public float writeFloat(Object target, String name, float oldValue, float newValue) { public float writeFloat(Object target, String name, float oldValue, float newValue) {
dirty(); dirty();
intercept( target, name, Float.valueOf( oldValue ) ); intercept( target, name, oldValue );
return newValue; return newValue;
} }
@Override
public int writeInt(Object target, String name, int oldValue, int newValue) { public int writeInt(Object target, String name, int oldValue, int newValue) {
dirty(); dirty();
intercept( target, name, Integer.valueOf( oldValue ) ); intercept( target, name, oldValue );
return newValue; return newValue;
} }
@Override
public long writeLong(Object target, String name, long oldValue, long newValue) { public long writeLong(Object target, String name, long oldValue, long newValue) {
dirty(); dirty();
intercept( target, name, Long.valueOf( oldValue ) ); intercept( target, name, oldValue );
return newValue; return newValue;
} }
@Override
public short writeShort(Object target, String name, short oldValue, short newValue) { public short writeShort(Object target, String name, short oldValue, short newValue) {
dirty(); dirty();
intercept( target, name, Short.valueOf( oldValue ) ); intercept( target, name, oldValue );
return newValue; return newValue;
} }
@Override
public Object writeObject(Object target, String name, Object oldValue, Object newValue) { public Object writeObject(Object target, String name, Object oldValue, Object newValue) {
dirty(); dirty();
intercept( target, name, oldValue ); intercept( target, name, oldValue );
return newValue; return newValue;
} }
@Override
public String toString() { public String toString() {
return "FieldInterceptorImpl(entityName=" + getEntityName() + return "FieldInterceptorImpl(entityName=" + getEntityName() +
",dirty=" + isDirty() + ",dirty=" + isDirty() +

View File

@ -153,7 +153,7 @@ public class StandardQueryCache implements QueryCache {
final QueryKey key, final QueryKey key,
final Type[] returnTypes, final Type[] returnTypes,
final boolean isNaturalKeyLookup, final boolean isNaturalKeyLookup,
final Set spaces, final Set<Serializable> spaces,
final SessionImplementor session) throws HibernateException { final SessionImplementor session) throws HibernateException {
if ( DEBUGGING ) { if ( DEBUGGING ) {
LOG.debugf( "Checking cached query results in region: %s", cacheRegion.getName() ); LOG.debugf( "Checking cached query results in region: %s", cacheRegion.getName() );
@ -223,7 +223,7 @@ public class StandardQueryCache implements QueryCache {
return result; return result;
} }
protected boolean isUpToDate(final Set spaces, final Long timestamp) { protected boolean isUpToDate(final Set<Serializable> spaces, final Long timestamp) {
if ( DEBUGGING ) { if ( DEBUGGING ) {
LOG.debugf( "Checking query spaces are up-to-date: %s", spaces ); LOG.debugf( "Checking query spaces are up-to-date: %s", spaces );
} }

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.cache.spi; package org.hibernate.cache.spi;
import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -75,7 +76,7 @@ public interface QueryCache {
* *
* @throws HibernateException Indicates a problem delegating to the underlying cache. * @throws HibernateException Indicates a problem delegating to the underlying cache.
*/ */
public List get(QueryKey key, Type[] returnTypes, boolean isNaturalKeyLookup, Set spaces, SessionImplementor session) throws HibernateException; public List get(QueryKey key, Type[] returnTypes, boolean isNaturalKeyLookup, Set<Serializable> spaces, SessionImplementor session) throws HibernateException;
/** /**
* Destroy the cache. * Destroy the cache.

View File

@ -46,7 +46,7 @@ import org.hibernate.internal.CoreMessageLogger;
*/ */
public class UpdateTimestampsCache { public class UpdateTimestampsCache {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, UpdateTimestampsCache.class.getName() ); private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, UpdateTimestampsCache.class.getName() );
private static final boolean DEBUG_ENABLED = LOG.isDebugEnabled();
/** /**
* The region name of the update-timestamps cache. * The region name of the update-timestamps cache.
*/ */
@ -90,15 +90,13 @@ public class UpdateTimestampsCache {
* *
* @throws CacheException Indicated problem delegating to underlying region. * @throws CacheException Indicated problem delegating to underlying region.
*/ */
@SuppressWarnings({"UnnecessaryBoxing"})
public void preinvalidate(Serializable[] spaces) throws CacheException { public void preinvalidate(Serializable[] spaces) throws CacheException {
final boolean debug = LOG.isDebugEnabled();
final boolean stats = factory != null && factory.getStatistics().isStatisticsEnabled(); final boolean stats = factory != null && factory.getStatistics().isStatisticsEnabled();
final Long ts = region.nextTimestamp() + region.getTimeout(); final Long ts = region.nextTimestamp() + region.getTimeout();
for ( Serializable space : spaces ) { for ( Serializable space : spaces ) {
if ( debug ) { if ( DEBUG_ENABLED ) {
LOG.debugf( "Pre-invalidating space [%s], timestamp: %s", space, ts ); LOG.debugf( "Pre-invalidating space [%s], timestamp: %s", space, ts );
} }
//put() has nowait semantics, is this really appropriate? //put() has nowait semantics, is this really appropriate?
@ -117,15 +115,13 @@ public class UpdateTimestampsCache {
* *
* @throws CacheException Indicated problem delegating to underlying region. * @throws CacheException Indicated problem delegating to underlying region.
*/ */
@SuppressWarnings({"UnnecessaryBoxing"})
public void invalidate(Serializable[] spaces) throws CacheException { public void invalidate(Serializable[] spaces) throws CacheException {
final boolean debug = LOG.isDebugEnabled();
final boolean stats = factory != null && factory.getStatistics().isStatisticsEnabled(); final boolean stats = factory != null && factory.getStatistics().isStatisticsEnabled();
final Long ts = region.nextTimestamp(); final Long ts = region.nextTimestamp();
for (Serializable space : spaces) { for (Serializable space : spaces) {
if ( debug ) { if ( DEBUG_ENABLED ) {
LOG.debugf( "Invalidating space [%s], timestamp: %s", space, ts ); LOG.debugf( "Invalidating space [%s], timestamp: %s", space, ts );
} }
//put() has nowait semantics, is this really appropriate? //put() has nowait semantics, is this really appropriate?
@ -147,12 +143,10 @@ public class UpdateTimestampsCache {
* *
* @throws CacheException Indicated problem delegating to underlying region. * @throws CacheException Indicated problem delegating to underlying region.
*/ */
@SuppressWarnings({"unchecked", "UnnecessaryUnboxing"}) public boolean isUpToDate(Set<Serializable> spaces, Long timestamp) throws CacheException {
public boolean isUpToDate(Set spaces, Long timestamp) throws CacheException {
final boolean debug = LOG.isDebugEnabled();
final boolean stats = factory != null && factory.getStatistics().isStatisticsEnabled(); final boolean stats = factory != null && factory.getStatistics().isStatisticsEnabled();
for ( Serializable space : (Set<Serializable>) spaces ) { for ( Serializable space : spaces ) {
final Long lastUpdate = (Long) region.get( space ); final Long lastUpdate = (Long) region.get( space );
if ( lastUpdate == null ) { if ( lastUpdate == null ) {
if ( stats ) { if ( stats ) {
@ -164,7 +158,7 @@ public class UpdateTimestampsCache {
//result = false; // safer //result = false; // safer
} }
else { else {
if ( debug ) { if ( DEBUG_ENABLED ) {
LOG.debugf( LOG.debugf(
"[%s] last update timestamp: %s", "[%s] last update timestamp: %s",
space, space,

View File

@ -50,10 +50,9 @@ public class StructuredCacheEntry implements CacheEntryStructure {
} }
@Override @Override
@SuppressWarnings("UnnecessaryUnboxing")
public Object destructure(Object structured, SessionFactoryImplementor factory) { public Object destructure(Object structured, SessionFactoryImplementor factory) {
final Map map = (Map) structured; final Map map = (Map) structured;
final boolean lazyPropertiesUnfetched = ( (Boolean) map.get( "_lazyPropertiesUnfetched" ) ).booleanValue(); final boolean lazyPropertiesUnfetched = (Boolean) map.get( "_lazyPropertiesUnfetched" );
final String subclass = (String) map.get( "_subclass" ); final String subclass = (String) map.get( "_subclass" );
final Object version = map.get( "_version" ); final Object version = map.get( "_version" );
final EntityPersister subclassPersister = factory.getEntityPersister( subclass ); final EntityPersister subclassPersister = factory.getEntityPersister( subclass );

View File

@ -81,7 +81,6 @@ import org.hibernate.annotations.common.reflection.java.JavaReflectionManager;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl; import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl;
import org.hibernate.cache.spi.GeneralDataRegion;
import org.hibernate.cfg.annotations.NamedEntityGraphDefinition; import org.hibernate.cfg.annotations.NamedEntityGraphDefinition;
import org.hibernate.cfg.annotations.NamedProcedureCallDefinition; import org.hibernate.cfg.annotations.NamedProcedureCallDefinition;
import org.hibernate.cfg.annotations.reflection.JPAMetadataProvider; import org.hibernate.cfg.annotations.reflection.JPAMetadataProvider;
@ -876,12 +875,14 @@ public class Configuration implements Serializable {
*/ */
public Configuration addDirectory(File dir) throws MappingException { public Configuration addDirectory(File dir) throws MappingException {
File[] files = dir.listFiles(); File[] files = dir.listFiles();
for ( File file : files ) { if ( files != null ) {
if ( file.isDirectory() ) { for ( File file : files ) {
addDirectory( file ); if ( file.isDirectory() ) {
} addDirectory( file );
else if ( file.getName().endsWith( ".hbm.xml" ) ) { }
addFile( file ); else if ( file.getName().endsWith( ".hbm.xml" ) ) {
addFile( file );
}
} }
} }
return this; return this;
@ -1527,10 +1528,8 @@ public class Configuration implements Serializable {
for ( FkSecondPass sp : dependencies ) { for ( FkSecondPass sp : dependencies ) {
String dependentTable = quotedTableName(sp.getValue().getTable()); String dependentTable = quotedTableName(sp.getValue().getTable());
if ( dependentTable.compareTo( startTable ) == 0 ) { if ( dependentTable.compareTo( startTable ) == 0 ) {
StringBuilder sb = new StringBuilder( String sb = "Foreign key circularity dependency involving the following tables: ";
"Foreign key circularity dependency involving the following tables: " throw new AnnotationException( sb );
);
throw new AnnotationException( sb.toString() );
} }
buildRecursiveOrderedFkSecondPasses( orderedFkSecondPasses, isADependencyOf, startTable, dependentTable ); buildRecursiveOrderedFkSecondPasses( orderedFkSecondPasses, isADependencyOf, startTable, dependentTable );
if ( !orderedFkSecondPasses.contains( sp ) ) { if ( !orderedFkSecondPasses.contains( sp ) ) {
@ -3151,7 +3150,7 @@ public class Configuration implements Serializable {
} }
return finalName; return finalName;
} }
@Override
public String getLogicalColumnName(String physicalName, Table table) throws MappingException { public String getLogicalColumnName(String physicalName, Table table) throws MappingException {
String logical = null; String logical = null;
Table currentTable = table; Table currentTable = table;
@ -3172,7 +3171,7 @@ public class Configuration implements Serializable {
currentTable = null; currentTable = null;
} }
} }
while ( logical == null && currentTable != null && description != null ); while ( logical == null && currentTable != null );
if ( logical == null ) { if ( logical == null ) {
throw new MappingException( throw new MappingException(
"Unable to find logical column name from physical name " "Unable to find logical column name from physical name "
@ -3294,41 +3293,38 @@ public class Configuration implements Serializable {
} }
private Boolean useNewGeneratorMappings; private Boolean useNewGeneratorMappings;
@Override
@SuppressWarnings({ "UnnecessaryUnboxing" })
public boolean useNewGeneratorMappings() { public boolean useNewGeneratorMappings() {
if ( useNewGeneratorMappings == null ) { if ( useNewGeneratorMappings == null ) {
final String booleanName = getConfigurationProperties() final String booleanName = getConfigurationProperties()
.getProperty( AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS ); .getProperty( AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS );
useNewGeneratorMappings = Boolean.valueOf( booleanName ); useNewGeneratorMappings = Boolean.valueOf( booleanName );
} }
return useNewGeneratorMappings.booleanValue(); return useNewGeneratorMappings;
} }
private Boolean useNationalizedCharacterData; private Boolean useNationalizedCharacterData;
@Override @Override
@SuppressWarnings( {"UnnecessaryUnboxing"})
public boolean useNationalizedCharacterData() { public boolean useNationalizedCharacterData() {
if ( useNationalizedCharacterData == null ) { if ( useNationalizedCharacterData == null ) {
final String booleanName = getConfigurationProperties() final String booleanName = getConfigurationProperties()
.getProperty( AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA ); .getProperty( AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA );
useNationalizedCharacterData = Boolean.valueOf( booleanName ); useNationalizedCharacterData = Boolean.valueOf( booleanName );
} }
return useNationalizedCharacterData.booleanValue(); return useNationalizedCharacterData;
} }
private Boolean forceDiscriminatorInSelectsByDefault; private Boolean forceDiscriminatorInSelectsByDefault;
@Override @Override
@SuppressWarnings( {"UnnecessaryUnboxing"})
public boolean forceDiscriminatorInSelectsByDefault() { public boolean forceDiscriminatorInSelectsByDefault() {
if ( forceDiscriminatorInSelectsByDefault == null ) { if ( forceDiscriminatorInSelectsByDefault == null ) {
final String booleanName = getConfigurationProperties() final String booleanName = getConfigurationProperties()
.getProperty( AvailableSettings.FORCE_DISCRIMINATOR_IN_SELECTS_BY_DEFAULT ); .getProperty( AvailableSettings.FORCE_DISCRIMINATOR_IN_SELECTS_BY_DEFAULT );
forceDiscriminatorInSelectsByDefault = Boolean.valueOf( booleanName ); forceDiscriminatorInSelectsByDefault = Boolean.valueOf( booleanName );
} }
return forceDiscriminatorInSelectsByDefault.booleanValue(); return forceDiscriminatorInSelectsByDefault;
} }
public IdGenerator getGenerator(String name) { public IdGenerator getGenerator(String name) {
@ -3520,7 +3516,7 @@ public class Configuration implements Serializable {
//Do not cache this value as we lazily set it in Hibernate Annotation (AnnotationConfiguration) //Do not cache this value as we lazily set it in Hibernate Annotation (AnnotationConfiguration)
//TODO use a dedicated protected useQuotedIdentifier flag in Configuration (overriden by AnnotationConfiguration) //TODO use a dedicated protected useQuotedIdentifier flag in Configuration (overriden by AnnotationConfiguration)
String setting = (String) properties.get( Environment.GLOBALLY_QUOTED_IDENTIFIERS ); String setting = (String) properties.get( Environment.GLOBALLY_QUOTED_IDENTIFIERS );
return setting != null && Boolean.valueOf( setting ).booleanValue(); return setting != null && Boolean.valueOf( setting );
} }
public NamingStrategy getNamingStrategy() { public NamingStrategy getNamingStrategy() {

View File

@ -129,4 +129,4 @@ public class DefaultNamingStrategy implements NamingStrategy, Serializable {
public String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn) { public String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn) {
return StringHelper.isNotEmpty( columnName ) ? columnName : propertyName + "_" + referencedColumn; return StringHelper.isNotEmpty( columnName ) ? columnName : propertyName + "_" + referencedColumn;
} }
} }

View File

@ -36,4 +36,4 @@ package org.hibernate.cfg;
*/ */
@Deprecated @Deprecated
public interface ExtendedMappings extends Mappings { public interface ExtendedMappings extends Mappings {
} }

View File

@ -1528,4 +1528,4 @@ public abstract class CollectionBinder {
public void setLocalGenerators(HashMap<String, IdGenerator> localGenerators) { public void setLocalGenerators(HashMap<String, IdGenerator> localGenerators) {
this.localGenerators = localGenerators; this.localGenerators = localGenerators;
} }
} }

View File

@ -284,10 +284,9 @@ public class PersistentBag extends AbstractPersistentCollection implements List
} }
@Override @Override
@SuppressWarnings("UnnecessaryUnboxing")
public boolean contains(Object object) { public boolean contains(Object object) {
final Boolean exists = readElementExistence( object ); final Boolean exists = readElementExistence( object );
return exists == null ? bag.contains( object ) : exists.booleanValue(); return exists == null ? bag.contains( object ) : exists;
} }
@Override @Override

View File

@ -136,12 +136,11 @@ public class PersistentList extends AbstractPersistentCollection implements List
} }
@Override @Override
@SuppressWarnings("UnnecessaryUnboxing")
public boolean contains(Object object) { public boolean contains(Object object) {
final Boolean exists = readElementExistence( object ); final Boolean exists = readElementExistence( object );
return exists == null return exists == null
? list.contains( object ) ? list.contains( object )
: exists.booleanValue(); : exists;
} }
@Override @Override
@ -176,7 +175,6 @@ public class PersistentList extends AbstractPersistentCollection implements List
} }
@Override @Override
@SuppressWarnings("UnnecessaryUnboxing")
public boolean remove(Object value) { public boolean remove(Object value) {
final Boolean exists = isPutQueueEnabled() ? readElementExistence( value ) : null; final Boolean exists = isPutQueueEnabled() ? readElementExistence( value ) : null;
if ( exists == null ) { if ( exists == null ) {
@ -189,7 +187,7 @@ public class PersistentList extends AbstractPersistentCollection implements List
return false; return false;
} }
} }
else if ( exists.booleanValue() ) { else if ( exists ) {
queueOperation( new SimpleRemove( value ) ); queueOperation( new SimpleRemove( value ) );
return true; return true;
} }

View File

@ -146,19 +146,17 @@ public class PersistentMap extends AbstractPersistentCollection implements Map {
} }
@Override @Override
@SuppressWarnings("UnnecessaryUnboxing")
public boolean containsKey(Object key) { public boolean containsKey(Object key) {
final Boolean exists = readIndexExistence( key ); final Boolean exists = readIndexExistence( key );
return exists == null ? map.containsKey( key ) : exists.booleanValue(); return exists == null ? map.containsKey( key ) : exists;
} }
@Override @Override
@SuppressWarnings("UnnecessaryUnboxing")
public boolean containsValue(Object value) { public boolean containsValue(Object value) {
final Boolean exists = readElementExistence( value ); final Boolean exists = readElementExistence( value );
return exists == null return exists == null
? map.containsValue( value ) ? map.containsValue( value )
: exists.booleanValue(); : exists;
} }
@Override @Override

View File

@ -167,12 +167,11 @@ public class PersistentSet extends AbstractPersistentCollection implements java.
} }
@Override @Override
@SuppressWarnings({"unchecked", "UnnecessaryUnboxing"})
public boolean contains(Object object) { public boolean contains(Object object) {
final Boolean exists = readElementExistence( object ); final Boolean exists = readElementExistence( object );
return exists == null return exists == null
? set.contains( object ) ? set.contains( object )
: exists.booleanValue(); : exists;
} }
@Override @Override
@ -197,7 +196,6 @@ public class PersistentSet extends AbstractPersistentCollection implements java.
} }
@Override @Override
@SuppressWarnings({"unchecked", "UnnecessaryUnboxing"})
public boolean add(Object value) { public boolean add(Object value) {
final Boolean exists = isOperationQueueEnabled() ? readElementExistence( value ) : null; final Boolean exists = isOperationQueueEnabled() ? readElementExistence( value ) : null;
if ( exists == null ) { if ( exists == null ) {
@ -210,7 +208,7 @@ public class PersistentSet extends AbstractPersistentCollection implements java.
return false; return false;
} }
} }
else if ( exists.booleanValue() ) { else if ( exists ) {
return false; return false;
} }
else { else {
@ -220,7 +218,6 @@ public class PersistentSet extends AbstractPersistentCollection implements java.
} }
@Override @Override
@SuppressWarnings({"unchecked", "UnnecessaryUnboxing"})
public boolean remove(Object value) { public boolean remove(Object value) {
final Boolean exists = isPutQueueEnabled() ? readElementExistence( value ) : null; final Boolean exists = isPutQueueEnabled() ? readElementExistence( value ) : null;
if ( exists == null ) { if ( exists == null ) {
@ -233,7 +230,7 @@ public class PersistentSet extends AbstractPersistentCollection implements java.
return false; return false;
} }
} }
else if ( exists.booleanValue() ) { else if ( exists ) {
queueOperation( new SimpleRemove( value ) ); queueOperation( new SimpleRemove( value ) );
return true; return true;
} }

View File

@ -77,15 +77,14 @@ public class DerbyDialect extends DB2Dialect {
} }
} }
@SuppressWarnings({"UnnecessaryUnboxing", "unchecked"})
private void determineDriverVersion() { private void determineDriverVersion() {
try { try {
// locate the derby sysinfo class and query its version info // locate the derby sysinfo class and query its version info
final Class sysinfoClass = ReflectHelper.classForName( "org.apache.derby.tools.sysinfo", this.getClass() ); final Class sysinfoClass = ReflectHelper.classForName( "org.apache.derby.tools.sysinfo", this.getClass() );
final Method majorVersionGetter = sysinfoClass.getMethod( "getMajorVersion", ReflectHelper.NO_PARAM_SIGNATURE ); final Method majorVersionGetter = sysinfoClass.getMethod( "getMajorVersion", ReflectHelper.NO_PARAM_SIGNATURE );
final Method minorVersionGetter = sysinfoClass.getMethod( "getMinorVersion", ReflectHelper.NO_PARAM_SIGNATURE ); final Method minorVersionGetter = sysinfoClass.getMethod( "getMinorVersion", ReflectHelper.NO_PARAM_SIGNATURE );
driverVersionMajor = ( (Integer) majorVersionGetter.invoke( null, ReflectHelper.NO_PARAMS ) ).intValue(); driverVersionMajor = (Integer) majorVersionGetter.invoke( null, ReflectHelper.NO_PARAMS );
driverVersionMinor = ( (Integer) minorVersionGetter.invoke( null, ReflectHelper.NO_PARAMS ) ).intValue(); driverVersionMinor = (Integer) minorVersionGetter.invoke( null, ReflectHelper.NO_PARAMS );
} }
catch ( Exception e ) { catch ( Exception e ) {
LOG.unableToLoadDerbyDriver( e.getMessage() ); LOG.unableToLoadDerbyDriver( e.getMessage() );

View File

@ -50,7 +50,6 @@ public class TemplateRenderer {
* *
* @param template The template * @param template The template
*/ */
@SuppressWarnings({ "UnnecessaryUnboxing" })
public TemplateRenderer(String template) { public TemplateRenderer(String template) {
this.template = template; this.template = template;

View File

@ -225,7 +225,6 @@ public final class ForeignKeys {
* *
* @return {@code true} if the given entity is transient (unsaved) * @return {@code true} if the given entity is transient (unsaved)
*/ */
@SuppressWarnings("UnnecessaryUnboxing")
public static boolean isTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session) { public static boolean isTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session) {
if ( entity == LazyPropertyInitializer.UNFETCHED_PROPERTY ) { if ( entity == LazyPropertyInitializer.UNFETCHED_PROPERTY ) {
// an unfetched association can only point to // an unfetched association can only point to
@ -236,20 +235,20 @@ public final class ForeignKeys {
// let the interceptor inspect the instance to decide // let the interceptor inspect the instance to decide
Boolean isUnsaved = session.getInterceptor().isTransient( entity ); Boolean isUnsaved = session.getInterceptor().isTransient( entity );
if ( isUnsaved != null ) { if ( isUnsaved != null ) {
return isUnsaved.booleanValue(); return isUnsaved;
} }
// let the persister inspect the instance to decide // let the persister inspect the instance to decide
final EntityPersister persister = session.getEntityPersister( entityName, entity ); final EntityPersister persister = session.getEntityPersister( entityName, entity );
isUnsaved = persister.isTransient( entity, session ); isUnsaved = persister.isTransient( entity, session );
if ( isUnsaved != null ) { if ( isUnsaved != null ) {
return isUnsaved.booleanValue(); return isUnsaved;
} }
// we use the assumed value, if there is one, to avoid hitting // we use the assumed value, if there is one, to avoid hitting
// the database // the database
if ( assumed != null ) { if ( assumed != null ) {
return assumed.booleanValue(); return assumed;
} }
// hit the database, after checking the session cache for a snapshot // hit the database, after checking the session cache for a snapshot

View File

@ -104,13 +104,12 @@ public class BlobProxy implements InvocationHandler {
* or toString/equals/hashCode are invoked. * or toString/equals/hashCode are invoked.
*/ */
@Override @Override
@SuppressWarnings({ "UnnecessaryBoxing" })
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
final String methodName = method.getName(); final String methodName = method.getName();
final int argCount = method.getParameterTypes().length; final int argCount = method.getParameterTypes().length;
if ( "length".equals( methodName ) && argCount == 0 ) { if ( "length".equals( methodName ) && argCount == 0 ) {
return Long.valueOf( getLength() ); return getLength();
} }
if ( "getUnderlyingStream".equals( methodName ) ) { if ( "getUnderlyingStream".equals( methodName ) ) {
return getUnderlyingStream(); // Reset stream if needed. return getUnderlyingStream(); // Reset stream if needed.
@ -157,7 +156,7 @@ public class BlobProxy implements InvocationHandler {
return this.toString(); return this.toString();
} }
if ( "equals".equals( methodName ) && argCount == 1 ) { if ( "equals".equals( methodName ) && argCount == 1 ) {
return Boolean.valueOf( proxy == args[0] ); return proxy == args[0];
} }
if ( "hashCode".equals( methodName ) && argCount == 0 ) { if ( "hashCode".equals( methodName ) && argCount == 0 ) {
return this.hashCode(); return this.hashCode();

View File

@ -104,13 +104,12 @@ public class ClobProxy implements InvocationHandler {
* {@link Clob#free}, or toString/equals/hashCode are invoked. * {@link Clob#free}, or toString/equals/hashCode are invoked.
*/ */
@Override @Override
@SuppressWarnings({ "UnnecessaryBoxing" })
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
final String methodName = method.getName(); final String methodName = method.getName();
final int argCount = method.getParameterTypes().length; final int argCount = method.getParameterTypes().length;
if ( "length".equals( methodName ) && argCount == 0 ) { if ( "length".equals( methodName ) && argCount == 0 ) {
return Long.valueOf( getLength() ); return getLength();
} }
if ( "getUnderlyingStream".equals( methodName ) ) { if ( "getUnderlyingStream".equals( methodName ) ) {
return getUnderlyingStream(); // Reset stream if needed. return getUnderlyingStream(); // Reset stream if needed.
@ -161,7 +160,7 @@ public class ClobProxy implements InvocationHandler {
return this.toString(); return this.toString();
} }
if ( "equals".equals( methodName ) && argCount == 1 ) { if ( "equals".equals( methodName ) && argCount == 1 ) {
return Boolean.valueOf( proxy == args[0] ); return proxy == args[0];
} }
if ( "hashCode".equals( methodName ) && argCount == 0 ) { if ( "hashCode".equals( methodName ) && argCount == 0 ) {
return this.hashCode(); return this.hashCode();

View File

@ -89,10 +89,9 @@ public class ResultSetWrapperProxy implements InvocationHandler {
} }
@Override @Override
@SuppressWarnings( {"UnnecessaryBoxing"})
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if ( "findColumn".equals( method.getName() ) ) { if ( "findColumn".equals( method.getName() ) ) {
return Integer.valueOf( findColumn( (String) args[0] ) ); return findColumn( (String) args[0] );
} }
if ( isFirstArgColumnLabel( method, args ) ) { if ( isFirstArgColumnLabel( method, args ) ) {
@ -168,10 +167,9 @@ public class ResultSetWrapperProxy implements InvocationHandler {
return columnNameMethod.getDeclaringClass().getMethod( columnNameMethod.getName(), actualParameterTypes ); return columnNameMethod.getDeclaringClass().getMethod( columnNameMethod.getName(), actualParameterTypes );
} }
@SuppressWarnings( {"UnnecessaryBoxing"})
private Object[] buildColumnIndexMethodArgs(Object[] incomingArgs, int columnIndex) { private Object[] buildColumnIndexMethodArgs(Object[] incomingArgs, int columnIndex) {
final Object[] actualArgs = new Object[incomingArgs.length]; final Object[] actualArgs = new Object[incomingArgs.length];
actualArgs[0] = Integer.valueOf( columnIndex ); actualArgs[0] = columnIndex;
System.arraycopy( incomingArgs, 1, actualArgs, 1, incomingArgs.length - 1 ); System.arraycopy( incomingArgs, 1, actualArgs, 1, incomingArgs.length - 1 );
return actualArgs; return actualArgs;
} }

View File

@ -57,7 +57,6 @@ import org.jboss.logging.Logger;
* @author Gavin King * @author Gavin King
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@SuppressWarnings( {"UnnecessaryUnboxing"})
public class DriverManagerConnectionProviderImpl public class DriverManagerConnectionProviderImpl
implements ConnectionProvider, Configurable, Stoppable, ServiceRegistryAwareService { implements ConnectionProvider, Configurable, Stoppable, ServiceRegistryAwareService {
private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, DriverManagerConnectionProviderImpl.class.getName() ); private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, DriverManagerConnectionProviderImpl.class.getName() );
@ -141,7 +140,7 @@ public class DriverManagerConnectionProviderImpl
isolation = ConfigurationHelper.getInteger( AvailableSettings.ISOLATION, configurationValues ); isolation = ConfigurationHelper.getInteger( AvailableSettings.ISOLATION, configurationValues );
if ( isolation != null ) { if ( isolation != null ) {
LOG.jdbcIsolationLevel( Environment.isolationLevelToString( isolation.intValue() ) ); LOG.jdbcIsolationLevel( Environment.isolationLevelToString( isolation ) );
} }
url = (String) configurationValues.get( AvailableSettings.URL ); url = (String) configurationValues.get( AvailableSettings.URL );
@ -195,7 +194,7 @@ public class DriverManagerConnectionProviderImpl
} }
final Connection pooled = pool.remove( last ); final Connection pooled = pool.remove( last );
if ( isolation != null ) { if ( isolation != null ) {
pooled.setTransactionIsolation( isolation.intValue() ); pooled.setTransactionIsolation( isolation );
} }
if ( pooled.getAutoCommit() != autocommit ) { if ( pooled.getAutoCommit() != autocommit ) {
pooled.setAutoCommit( autocommit ); pooled.setAutoCommit( autocommit );
@ -225,7 +224,7 @@ public class DriverManagerConnectionProviderImpl
} }
if ( isolation != null ) { if ( isolation != null ) {
conn.setTransactionIsolation( isolation.intValue() ); conn.setTransactionIsolation( isolation );
} }
if ( conn.getAutoCommit() != autocommit ) { if ( conn.getAutoCommit() != autocommit ) {
conn.setAutoCommit( autocommit ); conn.setAutoCommit( autocommit );

View File

@ -174,12 +174,11 @@ public class StandardRefCursorSupport implements RefCursorSupport {
* *
* @return {@code true} if the metadata indicates that the driver defines REF_CURSOR support * @return {@code true} if the metadata indicates that the driver defines REF_CURSOR support
*/ */
@SuppressWarnings("UnnecessaryUnboxing")
public static boolean supportsRefCursors(DatabaseMetaData meta) { public static boolean supportsRefCursors(DatabaseMetaData meta) {
// Standard JDBC REF_CURSOR support was not added until Java 8, so we need to use reflection to attempt to // Standard JDBC REF_CURSOR support was not added until Java 8, so we need to use reflection to attempt to
// access these fields/methods... // access these fields/methods...
try { try {
return ( (Boolean) meta.getClass().getMethod( "supportsRefCursors" ).invoke( null ) ).booleanValue(); return (Boolean) meta.getClass().getMethod( "supportsRefCursors" ).invoke( null );
} }
catch (NoSuchMethodException e) { catch (NoSuchMethodException e) {
log.trace( "JDBC DatabaseMetaData class does not define supportsRefCursors method..." ); log.trace( "JDBC DatabaseMetaData class does not define supportsRefCursors method..." );
@ -193,7 +192,6 @@ public class StandardRefCursorSupport implements RefCursorSupport {
private static Integer refCursorTypeCode; private static Integer refCursorTypeCode;
@SuppressWarnings("UnnecessaryUnboxing")
private int refCursorTypeCode() { private int refCursorTypeCode() {
if ( refCursorTypeCode == null ) { if ( refCursorTypeCode == null ) {
try { try {

View File

@ -274,13 +274,12 @@ public class BasicFormatterImpl implements Formatter {
} }
} }
@SuppressWarnings( {"UnnecessaryBoxing"})
private void select() { private void select() {
out(); out();
indent++; indent++;
newline(); newline();
parenCounts.addLast( Integer.valueOf( parensSinceSelect ) ); parenCounts.addLast( parensSinceSelect );
afterByOrFromOrSelects.addLast( Boolean.valueOf( afterByOrSetOrFromOrSelect ) ); afterByOrFromOrSelects.addLast( afterByOrSetOrFromOrSelect );
parensSinceSelect = 0; parensSinceSelect = 0;
afterByOrSetOrFromOrSelect = true; afterByOrSetOrFromOrSelect = true;
} }
@ -332,13 +331,12 @@ public class BasicFormatterImpl implements Formatter {
afterValues = true; afterValues = true;
} }
@SuppressWarnings( {"UnnecessaryUnboxing"})
private void closeParen() { private void closeParen() {
parensSinceSelect--; parensSinceSelect--;
if ( parensSinceSelect < 0 ) { if ( parensSinceSelect < 0 ) {
indent--; indent--;
parensSinceSelect = parenCounts.removeLast(); parensSinceSelect = parenCounts.removeLast();
afterByOrSetOrFromOrSelect = afterByOrFromOrSelects.removeLast().booleanValue(); afterByOrSetOrFromOrSelect = afterByOrFromOrSelects.removeLast();
} }
if ( inFunction > 0 ) { if ( inFunction > 0 ) {
inFunction--; inFunction--;

View File

@ -106,7 +106,7 @@ public class HQLQueryPlan implements Serializable {
this.translators = new QueryTranslator[length]; this.translators = new QueryTranslator[length];
final List<String> sqlStringList = new ArrayList<String>(); final List<String> sqlStringList = new ArrayList<String>();
final Set combinedQuerySpaces = new HashSet(); final Set<Serializable> combinedQuerySpaces = new HashSet<Serializable>();
final boolean hasCollectionRole = (collectionRole == null); final boolean hasCollectionRole = (collectionRole == null);
final Map querySubstitutions = factory.getSettings().getQuerySubstitutions(); final Map querySubstitutions = factory.getSettings().getQuerySubstitutions();

View File

@ -129,7 +129,7 @@ public class ParameterMetadata implements Serializable {
* *
* @return The named parameter names * @return The named parameter names
*/ */
public Set getNamedParameterNames() { public Set<String> getNamedParameterNames() {
return namedDescriptorMap.keySet(); return namedDescriptorMap.keySet();
} }

View File

@ -321,7 +321,6 @@ public class QueryPlanCache implements Serializable {
private final Map<String,Integer> parameterMetadata; private final Map<String,Integer> parameterMetadata;
private final int hashCode; private final int hashCode;
@SuppressWarnings({ "UnnecessaryBoxing" })
private DynamicFilterKey(FilterImpl filter) { private DynamicFilterKey(FilterImpl filter) {
this.filterName = filter.getName(); this.filterName = filter.getName();
if ( filter.getParameters().isEmpty() ) { if ( filter.getParameters().isEmpty() ) {

View File

@ -782,7 +782,6 @@ public class ActionQueue {
/** /**
* Sort the insert actions. * Sort the insert actions.
*/ */
@SuppressWarnings({ "unchecked", "UnnecessaryBoxing" })
public void sort() { public void sort() {
// the list of entity names that indicate the batch number // the list of entity names that indicate the batch number
for ( EntityInsertAction action : (List<EntityInsertAction>) insertions ) { for ( EntityInsertAction action : (List<EntityInsertAction>) insertions ) {
@ -831,7 +830,6 @@ public class ActionQueue {
* *
* @return An appropriate batch number; todo document this process better * @return An appropriate batch number; todo document this process better
*/ */
@SuppressWarnings({ "UnnecessaryBoxing", "unchecked" })
private Integer findBatchNumber( private Integer findBatchNumber(
EntityInsertAction action, EntityInsertAction action,
String entityName) { String entityName) {

View File

@ -67,4 +67,4 @@ public final class AssociationKey implements Serializable {
result = 31 * result + propertyName.hashCode(); result = 31 * result + propertyName.hashCode();
return result; return result;
} }
} }

View File

@ -101,4 +101,4 @@ public interface CascadingAction {
* Should this action be performed (or noCascade consulted) in the case of lazy properties. * Should this action be performed (or noCascade consulted) in the case of lazy properties.
*/ */
public boolean performOnLazyProperty(); public boolean performOnLazyProperty();
} }

View File

@ -155,4 +155,4 @@ public final class CollectionKey implements Serializable {
(session == null ? null : session.getFactory()) (session == null ? null : session.getFactory())
); );
} }
} }

View File

@ -148,4 +148,4 @@ public class IdentifierValue implements UnsavedValueStrategy {
public String toString() { public String toString() {
return "identifier unsaved-value: " + value; return "identifier unsaved-value: " + value;
} }
} }

View File

@ -140,4 +140,4 @@ public class NamedQueryDefinitionBuilder {
maxResults maxResults
); );
} }
} }

View File

@ -239,4 +239,4 @@ public class NamedSQLQueryDefinition extends NamedQueryDefinition {
getQueryReturns() getQueryReturns()
); );
} }
} }

View File

@ -181,4 +181,4 @@ public class NamedSQLQueryDefinitionBuilder extends NamedQueryDefinitionBuilder
? null ? null
: new ArrayList<String>( querySpaces ); : new ArrayList<String>( querySpaces );
} }
} }

View File

@ -30,4 +30,4 @@ public interface NonFlushedChanges extends Serializable {
* Remove the non-flushed changes from this NonFlushedChanges object. * Remove the non-flushed changes from this NonFlushedChanges object.
*/ */
void clear(); void clear();
} }

View File

@ -135,4 +135,4 @@ public class VersionValue implements UnsavedValueStrategy {
public String toString() { public String toString() {
return "version unsaved-value: " + value; return "version unsaved-value: " + value;
} }
} }

View File

@ -205,4 +205,4 @@ public class JdbcTransaction extends AbstractTransactionImpl {
public boolean isActive() throws HibernateException { public boolean isActive() throws HibernateException {
return getLocalStatus() == LocalStatus.ACTIVE; return getLocalStatus() == LocalStatus.ACTIVE;
} }
} }

View File

@ -60,4 +60,4 @@ public final class JdbcTransactionFactory implements TransactionFactory<JdbcTran
public boolean isJoinableJtaTransaction(TransactionCoordinator transactionCoordinator, JdbcTransaction transaction) { public boolean isJoinableJtaTransaction(TransactionCoordinator transactionCoordinator, JdbcTransaction transaction) {
return false; return false;
} }
} }

View File

@ -101,4 +101,4 @@ public class JtaTransactionFactory implements TransactionFactory<JtaTransaction>
} }
} }
} }

View File

@ -74,10 +74,9 @@ public class WebSphereExtendedJtaPlatform extends AbstractJtaPlatform {
} }
@Override @Override
@SuppressWarnings( {"UnnecessaryBoxing"})
public Object getTransactionIdentifier(Transaction transaction) { public Object getTransactionIdentifier(Transaction transaction) {
// WebSphere, however, is not a sane JEE/JTA container... // WebSphere, however, is not a sane JEE/JTA container...
return Integer.valueOf( transaction.hashCode() ); return transaction.hashCode();
} }
public class TransactionManagerAdapter implements TransactionManager { public class TransactionManagerAdapter implements TransactionManager {

View File

@ -141,4 +141,4 @@ public interface TransactionCoordinator extends Serializable {
public void sendBeforeTransactionCompletionNotifications(TransactionImplementor hibernateTransaction); public void sendBeforeTransactionCompletionNotifications(TransactionImplementor hibernateTransaction);
public void sendAfterTransactionCompletionNotifications(TransactionImplementor hibernateTransaction, int status); public void sendAfterTransactionCompletionNotifications(TransactionImplementor hibernateTransaction, int status);
} }

View File

@ -363,4 +363,4 @@ class EventCache implements Map {
// Entity was not found in current persistence context. Use Object#toString() method. // Entity was not found in current persistence context. Use Object#toString() method.
return "[" + entity + "]"; return "[" + entity + "]";
} }
} }

View File

@ -58,4 +58,4 @@ public class EventListenerServiceInitiator implements SessionFactoryServiceIniti
ServiceRegistryImplementor registry) { ServiceRegistryImplementor registry) {
return new EventListenerRegistryImpl(); return new EventListenerRegistryImpl();
} }
} }

View File

@ -139,7 +139,7 @@ public class HqlSqlWalker extends HqlSqlBaseWalker implements ErrorReporter, Par
**/ **/
private Map<String, SelectExpression> selectExpressionsByResultVariable = new HashMap<String, SelectExpression>(); private Map<String, SelectExpression> selectExpressionsByResultVariable = new HashMap<String, SelectExpression>();
private Set querySpaces = new HashSet(); private Set<Serializable> querySpaces = new HashSet<Serializable>();
private int parameterCount; private int parameterCount;
private Map namedParameters = new HashMap(); private Map namedParameters = new HashMap();
@ -315,7 +315,7 @@ public class HqlSqlWalker extends HqlSqlBaseWalker implements ErrorReporter, Par
* *
* @return A set of table names (Strings). * @return A set of table names (Strings).
*/ */
public Set getQuerySpaces() { public Set<Serializable> getQuerySpaces() {
return querySpaces; return querySpaces;
} }

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.hql.internal.ast; package org.hibernate.hql.internal.ast;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
@ -342,7 +343,7 @@ public class QueryTranslatorImpl implements FilterTranslator {
return getWalker().getSelectClause().getColumnNames(); return getWalker().getSelectClause().getColumnNames();
} }
@Override @Override
public Set getQuerySpaces() { public Set<Serializable> getQuerySpaces() {
return getWalker().getQuerySpaces(); return getWalker().getQuerySpaces();
} }

View File

@ -45,4 +45,4 @@ public interface TypeDiscriminatorMetadata {
* @return The resolution type. * @return The resolution type.
*/ */
public Type getResolutionType(); public Type getResolutionType();
} }

View File

@ -226,4 +226,4 @@ public class ASTPrinter {
appendEscapedMultibyteChars(text,buf); appendEscapedMultibyteChars(text,buf);
return buf.toString(); return buf.toString();
} }
} }

View File

@ -339,4 +339,4 @@ public class LiteralProcessor implements HqlSqlTokenTypes {
public abstract DecimalFormatter getFormatter(); public abstract DecimalFormatter getFormatter();
} }
} }

View File

@ -31,6 +31,7 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
@ -107,7 +108,7 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator
private final Map joins = new LinkedHashMap(); private final Map joins = new LinkedHashMap();
private final List orderByTokens = new ArrayList(); private final List orderByTokens = new ArrayList();
private final List groupByTokens = new ArrayList(); private final List groupByTokens = new ArrayList();
private final Set querySpaces = new HashSet(); private final Set<Serializable> querySpaces = new HashSet<Serializable>();
private final Set entitiesToFetch = new HashSet(); private final Set entitiesToFetch = new HashSet();
private final Map pathAliases = new HashMap(); private final Map pathAliases = new HashMap();
@ -821,7 +822,7 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator
} }
public final Set getQuerySpaces() { public final Set<Serializable> getQuerySpaces() {
return querySpaces; return querySpaces;
} }
@ -835,9 +836,7 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator
} }
void addQuerySpaces(Serializable[] spaces) { void addQuerySpaces(Serializable[] spaces) {
for ( int i = 0; i < spaces.length; i++ ) { Collections.addAll( querySpaces, spaces );
querySpaces.add( spaces[i] );
}
if ( superQuery != null ) superQuery.addQuerySpaces( spaces ); if ( superQuery != null ) superQuery.addQuerySpaces( spaces );
} }
@ -936,6 +935,7 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator
pathJoins.put( path, joinSequence ); pathJoins.put( path, joinSequence );
} }
@Override
public List list(SessionImplementor session, QueryParameters queryParameters) public List list(SessionImplementor session, QueryParameters queryParameters)
throws HibernateException { throws HibernateException {
return list( session, queryParameters, getQuerySpaces(), actualReturnTypes ); return list( session, queryParameters, getQuerySpaces(), actualReturnTypes );
@ -944,6 +944,7 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator
/** /**
* Return the query results as an iterator * Return the query results as an iterator
*/ */
@Override
public Iterator iterate(QueryParameters queryParameters, EventSource session) public Iterator iterate(QueryParameters queryParameters, EventSource session)
throws HibernateException { throws HibernateException {

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.hql.spi; package org.hibernate.hql.spi;
import java.io.Serializable;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -110,7 +111,7 @@ public interface QueryTranslator {
* *
* @return A set of query spaces (table names). * @return A set of query spaces (table names).
*/ */
Set getQuerySpaces(); Set<Serializable> getQuerySpaces();
/** /**
* Retrieve the query identifier for this translator. The query identifier is * Retrieve the query identifier for this translator. The query identifier is

View File

@ -162,16 +162,14 @@ public class TemporaryTableBulkIdStrategy implements MultiTableBulkIdStrategy {
} }
} }
@SuppressWarnings({ "UnnecessaryUnboxing" })
protected boolean shouldIsolateTemporaryTableDDL(SessionImplementor session) { protected boolean shouldIsolateTemporaryTableDDL(SessionImplementor session) {
Boolean dialectVote = session.getFactory().getDialect().performTemporaryTableDDLInIsolation(); Boolean dialectVote = session.getFactory().getDialect().performTemporaryTableDDLInIsolation();
if ( dialectVote != null ) { if ( dialectVote != null ) {
return dialectVote.booleanValue(); return dialectVote;
} }
return session.getFactory().getSettings().isDataDefinitionImplicitCommit(); return session.getFactory().getSettings().isDataDefinitionImplicitCommit();
} }
@SuppressWarnings({ "UnnecessaryUnboxing" })
protected boolean shouldTransactIsolatedTemporaryTableDDL(SessionImplementor session) { protected boolean shouldTransactIsolatedTemporaryTableDDL(SessionImplementor session) {
// is there ever a time when it makes sense to do this? // is there ever a time when it makes sense to do this?
// return session.getFactory().getSettings().isDataDefinitionInTransactionSupported(); // return session.getFactory().getSettings().isDataDefinitionInTransactionSupported();

View File

@ -67,7 +67,6 @@ public class OptimizerFactory {
* @deprecated Use {@link #buildOptimizer(String, Class, int, long)} instead * @deprecated Use {@link #buildOptimizer(String, Class, int, long)} instead
*/ */
@Deprecated @Deprecated
@SuppressWarnings( {"UnnecessaryBoxing", "unchecked"})
public static Optimizer buildOptimizer(String type, Class returnClass, int incrementSize) { public static Optimizer buildOptimizer(String type, Class returnClass, int incrementSize) {
final Class<? extends Optimizer> optimizerClass; final Class<? extends Optimizer> optimizerClass;
@ -87,7 +86,7 @@ public class OptimizerFactory {
try { try {
final Constructor ctor = optimizerClass.getConstructor( CTOR_SIG ); final Constructor ctor = optimizerClass.getConstructor( CTOR_SIG );
return (Optimizer) ctor.newInstance( returnClass, Integer.valueOf( incrementSize ) ); return (Optimizer) ctor.newInstance( returnClass, incrementSize );
} }
catch( Throwable ignore ) { catch( Throwable ignore ) {
LOG.unableToInstantiateOptimizer( type ); LOG.unableToInstantiateOptimizer( type );
@ -110,7 +109,6 @@ public class OptimizerFactory {
* *
* @return The built optimizer * @return The built optimizer
*/ */
@SuppressWarnings({ "UnnecessaryBoxing", "deprecation" })
public static Optimizer buildOptimizer(String type, Class returnClass, int incrementSize, long explicitInitialValue) { public static Optimizer buildOptimizer(String type, Class returnClass, int incrementSize, long explicitInitialValue) {
final Optimizer optimizer = buildOptimizer( type, returnClass, incrementSize ); final Optimizer optimizer = buildOptimizer( type, returnClass, incrementSize );
if ( InitialValueAwareOptimizer.class.isInstance( optimizer ) ) { if ( InitialValueAwareOptimizer.class.isInstance( optimizer ) ) {

View File

@ -91,7 +91,7 @@ public abstract class AbstractQueryImpl implements Query {
private List values = new ArrayList(4); private List values = new ArrayList(4);
private List types = new ArrayList(4); private List types = new ArrayList(4);
private Map<String,TypedValue> namedParameters = new HashMap<String, TypedValue>(4); private Map<String,TypedValue> namedParameters = new HashMap<String, TypedValue>(4);
private Map namedParameterLists = new HashMap(4); private Map<String, TypedValue> namedParameterLists = new HashMap<String, TypedValue>(4);
private Object optionalObject; private Object optionalObject;
private Serializable optionalId; private Serializable optionalId;
@ -256,24 +256,20 @@ public abstract class AbstractQueryImpl implements Query {
return this; return this;
} }
/** @Override
* {@inheritDoc}
*/
public boolean isReadOnly() { public boolean isReadOnly() {
return ( readOnly == null ? return ( readOnly == null ?
getSession().getPersistenceContext().isDefaultReadOnly() : getSession().getPersistenceContext().isDefaultReadOnly() :
readOnly.booleanValue() readOnly
); );
} }
/** @Override
* {@inheritDoc}
*/
public Query setReadOnly(boolean readOnly) { public Query setReadOnly(boolean readOnly) {
this.readOnly = Boolean.valueOf( readOnly ); this.readOnly = readOnly;
return this; return this;
} }
@Override
public Query setResultTransformer(ResultTransformer transformer) { public Query setResultTransformer(ResultTransformer transformer) {
this.resultTransformer = transformer; this.resultTransformer = transformer;
return this; return this;
@ -294,7 +290,7 @@ public abstract class AbstractQueryImpl implements Query {
SessionImplementor getSession() { SessionImplementor getSession() {
return session; return session;
} }
@Override
public abstract LockOptions getLockOptions(); public abstract LockOptions getLockOptions();
@ -305,8 +301,8 @@ public abstract class AbstractQueryImpl implements Query {
* *
* @return Shallow copy of the named parameter value map * @return Shallow copy of the named parameter value map
*/ */
protected Map getNamedParams() { protected Map<String, TypedValue> getNamedParams() {
return new HashMap( namedParameters ); return new HashMap<String, TypedValue>( namedParameters );
} }
/** /**
@ -323,6 +319,7 @@ public abstract class AbstractQueryImpl implements Query {
* @return Array of named parameter names. * @return Array of named parameter names.
* @throws HibernateException * @throws HibernateException
*/ */
@Override
public String[] getNamedParameters() throws HibernateException { public String[] getNamedParameters() throws HibernateException {
return ArrayHelper.toStringArray( parameterMetadata.getNamedParameterNames() ); return ArrayHelper.toStringArray( parameterMetadata.getNamedParameterNames() );
} }
@ -343,7 +340,7 @@ public abstract class AbstractQueryImpl implements Query {
* *
* @return The parameter list value map. * @return The parameter list value map.
*/ */
protected Map getNamedParameterLists() { protected Map<String, TypedValue> getNamedParameterLists() {
return namedParameterLists; return namedParameterLists;
} }
@ -387,7 +384,7 @@ public abstract class AbstractQueryImpl implements Query {
*/ */
protected void verifyParameters(boolean reserveFirstParameter) throws HibernateException { protected void verifyParameters(boolean reserveFirstParameter) throws HibernateException {
if ( parameterMetadata.getNamedParameterNames().size() != namedParameters.size() + namedParameterLists.size() ) { if ( parameterMetadata.getNamedParameterNames().size() != namedParameters.size() + namedParameterLists.size() ) {
Set missingParams = new HashSet( parameterMetadata.getNamedParameterNames() ); Set<String> missingParams = new HashSet<String>( parameterMetadata.getNamedParameterNames() );
missingParams.removeAll( namedParameterLists.keySet() ); missingParams.removeAll( namedParameterLists.keySet() );
missingParams.removeAll( namedParameters.keySet() ); missingParams.removeAll( namedParameters.keySet() );
throw new QueryException( "Not all named parameters have been set: " + missingParams, getQueryString() ); throw new QueryException( "Not all named parameters have been set: " + missingParams, getQueryString() );
@ -776,6 +773,7 @@ public abstract class AbstractQueryImpl implements Query {
return this; return this;
} }
@Override
public Query setParameterList(String name, Collection vals, Type type) throws HibernateException { public Query setParameterList(String name, Collection vals, Type type) throws HibernateException {
if ( !parameterMetadata.getNamedParameterNames().contains( name ) ) { if ( !parameterMetadata.getNamedParameterNames().contains( name ) ) {
throw new IllegalArgumentException("Parameter " + name + " does not exist as a named parameter in [" + getQueryString() + "]"); throw new IllegalArgumentException("Parameter " + name + " does not exist as a named parameter in [" + getQueryString() + "]");
@ -790,9 +788,8 @@ public abstract class AbstractQueryImpl implements Query {
*/ */
protected String expandParameterLists(Map namedParamsCopy) { protected String expandParameterLists(Map namedParamsCopy) {
String query = this.queryString; String query = this.queryString;
Iterator iter = namedParameterLists.entrySet().iterator(); for ( Map.Entry<String, TypedValue> stringTypedValueEntry : namedParameterLists.entrySet() ) {
while ( iter.hasNext() ) { Map.Entry me = (Map.Entry) stringTypedValueEntry;
Map.Entry me = (Map.Entry) iter.next();
query = expandParameterList( query, (String) me.getKey(), (TypedValue) me.getValue(), namedParamsCopy ); query = expandParameterList( query, (String) me.getKey(), (TypedValue) me.getValue(), namedParamsCopy );
} }
return query; return query;

View File

@ -27,7 +27,6 @@ import java.io.Serializable;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
@ -187,7 +186,6 @@ public abstract class AbstractSessionImpl
return query; return query;
} }
@SuppressWarnings("UnnecessaryUnboxing")
private void initQuery(Query query, NamedQueryDefinition nqd) { private void initQuery(Query query, NamedQueryDefinition nqd) {
// todo : cacheable and readonly should be Boolean rather than boolean... // todo : cacheable and readonly should be Boolean rather than boolean...
query.setCacheable( nqd.isCacheable() ); query.setCacheable( nqd.isCacheable() );

View File

@ -92,4 +92,4 @@ public class FilterConfiguration {
} }
return ret; return ret;
} }
} }

View File

@ -72,4 +72,4 @@ public final class NonFlushedChangesImpl implements NonFlushedChanges, Serializa
actionQueue.serialize( oos ); actionQueue.serialize( oos );
} }
} }

View File

@ -2461,4 +2461,4 @@ public class BoundedConcurrentHashMap<K, V> extends AbstractMap<K, V>
put(key, value); put(key, value);
} }
} }
} }

View File

@ -267,4 +267,4 @@ public final class IdentityMap<K,V> implements Map<K,V> {
} }
} }
} }

View File

@ -2325,7 +2325,7 @@ public abstract class Loader {
protected List list( protected List list(
final SessionImplementor session, final SessionImplementor session,
final QueryParameters queryParameters, final QueryParameters queryParameters,
final Set querySpaces, final Set<Serializable> querySpaces,
final Type[] resultTypes) throws HibernateException { final Type[] resultTypes) throws HibernateException {
final boolean cacheable = factory.getSettings().isQueryCacheEnabled() && final boolean cacheable = factory.getSettings().isQueryCacheEnabled() &&
@ -2346,7 +2346,7 @@ public abstract class Loader {
private List listUsingQueryCache( private List listUsingQueryCache(
final SessionImplementor session, final SessionImplementor session,
final QueryParameters queryParameters, final QueryParameters queryParameters,
final Set querySpaces, final Set<Serializable> querySpaces,
final Type[] resultTypes) { final Type[] resultTypes) {
QueryCache queryCache = factory.getQueryCache( queryParameters.getCacheRegion() ); QueryCache queryCache = factory.getQueryCache( queryParameters.getCacheRegion() );
@ -2423,7 +2423,7 @@ public abstract class Loader {
private List getResultFromQueryCache( private List getResultFromQueryCache(
final SessionImplementor session, final SessionImplementor session,
final QueryParameters queryParameters, final QueryParameters queryParameters,
final Set querySpaces, final Set<Serializable> querySpaces,
final Type[] resultTypes, final Type[] resultTypes,
final QueryCache queryCache, final QueryCache queryCache,
final QueryKey key) { final QueryKey key) {

View File

@ -23,6 +23,7 @@
* *
*/ */
package org.hibernate.loader.criteria; package org.hibernate.loader.criteria;
import java.io.Serializable;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap; import java.util.HashMap;
@ -68,7 +69,7 @@ public class CriteriaLoader extends OuterJoinLoader {
// multithreaded, or cacheable!! // multithreaded, or cacheable!!
private final CriteriaQueryTranslator translator; private final CriteriaQueryTranslator translator;
private final Set querySpaces; private final Set<Serializable> querySpaces;
private final Type[] resultTypes; private final Type[] resultTypes;
//the user visible aliases, which are unknown to the superclass, //the user visible aliases, which are unknown to the superclass,
//these are not the actual "physical" SQL aliases //these are not the actual "physical" SQL aliases

View File

@ -23,6 +23,7 @@
*/ */
package org.hibernate.loader.custom; package org.hibernate.loader.custom;
import java.io.Serializable;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.ResultSetMetaData; import java.sql.ResultSetMetaData;
import java.sql.SQLException; import java.sql.SQLException;
@ -71,7 +72,7 @@ public class CustomLoader extends Loader {
// Currently *not* cachable if autodiscover types is in effect (e.g. "select * ...") // Currently *not* cachable if autodiscover types is in effect (e.g. "select * ...")
private final String sql; private final String sql;
private final Set querySpaces = new HashSet(); private final Set<Serializable> querySpaces = new HashSet<Serializable>();
private final Map namedParameterBindPoints; private final Map namedParameterBindPoints;
private final Queryable[] entityPersisters; private final Queryable[] entityPersisters;

View File

@ -132,4 +132,4 @@ public class CollectionElementLoader extends OuterJoinLoader {
protected boolean isSingleRowLoader() { protected boolean isSingleRowLoader() {
return true; return true;
} }
} }

View File

@ -255,4 +255,4 @@ public class EntityJoinWalker extends AbstractEntityJoinWalker {
} }
} }
} }

View File

@ -170,4 +170,4 @@ public class EntityLoader extends AbstractEntityLoader {
public int[][] getCompositeKeyManyToOneTargetIndices() { public int[][] getCompositeKeyManyToOneTargetIndices() {
return compositeKeyManyToOneTargetIndices; return compositeKeyManyToOneTargetIndices;
} }
} }

View File

@ -310,4 +310,4 @@ public abstract class AbstractLoadQueryImpl {
association.getJoinable().whereJoinFragment( rhsAlias, false, true ) association.getJoinable().whereJoinFragment( rhsAlias, false, true )
); );
} }
} }

View File

@ -90,4 +90,4 @@ public class CollectionJoinableAssociationImpl extends AbstractJoinableAssociati
protected boolean isOneToOne() { protected boolean isOneToOne() {
return false; return false;
} }
} }

View File

@ -86,4 +86,4 @@ public class EntityJoinableAssociationImpl extends AbstractJoinableAssociationIm
EntityType entityType = (EntityType) joinableType; EntityType entityType = (EntityType) joinableType;
return entityType.isOneToOne() /*&& entityType.isReferenceToPrimaryKey()*/; return entityType.isOneToOne() /*&& entityType.isReferenceToPrimaryKey()*/;
} }
} }

View File

@ -65,4 +65,4 @@ public class EntityLoadQueryImpl extends AbstractEntityLoadQueryImpl {
protected String getComment() { protected String getComment() {
return "load " + getPersister().getEntityName(); return "load " + getPersister().getEntityName();
} }
} }

View File

@ -66,4 +66,4 @@ public interface FetchOwnerDelegate {
* be located. * be located.
*/ */
public FetchMetadata locateFetchMetadata(Fetch fetch); public FetchMetadata locateFetchMetadata(Fetch fetch);
} }

View File

@ -41,4 +41,4 @@ public class ReaderInputStream extends org.hibernate.engine.jdbc.ReaderInputStre
return super.read(); return super.read();
} }
} }

View File

@ -667,4 +667,4 @@ public abstract class Collection implements Fetchable, Value, Filterable {
public String getComparatorClassName() { public String getComparatorClassName() {
return comparatorClassName; return comparatorClassName;
} }
} }

View File

@ -880,4 +880,4 @@ public abstract class PersistentClass implements Serializable, Filterable, MetaA
// End of @Mappedsuperclass support // End of @Mappedsuperclass support
} }

View File

@ -608,4 +608,4 @@ public class SimpleValue implements KeyValue {
return columns; return columns;
} }
} }
} }

View File

@ -55,4 +55,4 @@ public interface Value extends Serializable {
public boolean isValid(Mapping mapping) throws MappingException; public boolean isValid(Mapping mapping) throws MappingException;
public void setTypeUsingReflection(String className, String propertyName) throws MappingException; public void setTypeUsingReflection(String className, String propertyName) throws MappingException;
public Object accept(ValueVisitor visitor); public Object accept(ValueVisitor visitor);
} }

View File

@ -238,4 +238,4 @@ public class ManyToOneAttributeBinding extends BasicAttributeBinding implements
// } // }
// //TODO: validate that the entity reference is resolved // //TODO: validate that the entity reference is resolved
// } // }
} }

View File

@ -62,4 +62,4 @@ public interface SingularAssociationAttributeBinding extends SingularAttributeBi
public boolean isReferenceResolved(); public boolean isReferenceResolved();
public EntityBinding getReferencedEntityBinding(); public EntityBinding getReferencedEntityBinding();
public AttributeBinding getReferencedAttributeBinding(); public AttributeBinding getReferencedAttributeBinding();
} }

View File

@ -305,4 +305,4 @@ public abstract class AbstractAttributeContainer implements AttributeContainer,
this.indexType = indexType; this.indexType = indexType;
} }
} }
} }

View File

@ -25,4 +25,4 @@ package org.hibernate.metamodel.source.annotations.attribute;
/** /**
* This package contains binding code for attributes. * This package contains binding code for attributes.
*/ */

View File

@ -25,4 +25,4 @@ package org.hibernate.metamodel.source.annotations.attribute.type;
/** /**
* This package contains type binding code for basic attributes. * This package contains type binding code for basic attributes.
*/ */

View File

@ -76,4 +76,4 @@ abstract class AbstractAnnotationFilter implements IndexedAnnotationFilter {
protected DotName[] targetAnnotation() { protected DotName[] targetAnnotation() {
return EMPTY_DOTNAME_ARRAY; return EMPTY_DOTNAME_ARRAY;
} }
} }

View File

@ -124,4 +124,4 @@ abstract class AbstractAttributesBuilder {
abstract List<JaxbOneToOne> getOneToOne(); abstract List<JaxbOneToOne> getOneToOne();
abstract JaxbEmbeddedId getEmbeddedId(); abstract JaxbEmbeddedId getEmbeddedId();
} }

View File

@ -284,4 +284,4 @@ public class HibernateMappingProcessor {
} }
} }
} }
} }

View File

@ -96,4 +96,4 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilder {
return entityNotFoundDelegate; return entityNotFoundDelegate;
} }
} }
} }

View File

@ -72,4 +72,4 @@ public class ElementPropertyMapping implements PropertyMapping {
return type; return type;
} }
} }

View File

@ -74,4 +74,4 @@ public final class NamedQueryCollectionInitializer implements CollectionInitiali
.list(); .list();
} }
} }

View File

@ -771,7 +771,7 @@ public abstract class AbstractEntityPersister
iter = definedBySubclass.iterator(); iter = definedBySubclass.iterator();
j = 0; j = 0;
while ( iter.hasNext() ) { while ( iter.hasNext() ) {
propertyDefinedOnSubclass[j++] = ( ( Boolean ) iter.next() ).booleanValue(); propertyDefinedOnSubclass[j++] = (Boolean) iter.next();
} }
// Handle any filters applied to the class level // Handle any filters applied to the class level
@ -4875,12 +4875,11 @@ public abstract class AbstractEntityPersister
return generateEntityIdByNaturalIdSql( valueNullness ); return generateEntityIdByNaturalIdSql( valueNullness );
} }
@SuppressWarnings("UnnecessaryUnboxing")
protected boolean isNaturalIdNonNullable() { protected boolean isNaturalIdNonNullable() {
if ( naturalIdIsNonNullable == null ) { if ( naturalIdIsNonNullable == null ) {
naturalIdIsNonNullable = determineNaturalIdNullability(); naturalIdIsNonNullable = determineNaturalIdNullability();
} }
return naturalIdIsNonNullable.booleanValue(); return naturalIdIsNonNullable;
} }
private boolean determineNaturalIdNullability() { private boolean determineNaturalIdNullability() {

View File

@ -92,4 +92,4 @@ public final class NamedQueryLoader implements UniqueEntityLoader {
return session.getPersistenceContext().getEntity( session.generateEntityKey( id, persister ) ); return session.getPersistenceContext().getEntity( session.generateEntityKey( id, persister ) );
} }
} }

View File

@ -150,4 +150,4 @@ public class EntityIdentifierDefinitionHelper {
return CompositionSingularSubAttributesHelper.getIdentifierSubAttributes( getEntityPersister() ); return CompositionSingularSubAttributesHelper.getIdentifierSubAttributes( getEntityPersister() );
} }
} }
} }

View File

@ -3,4 +3,4 @@ package org.hibernate.persister.walking.spi;
/** /**
* Package for "walking" associations through metadata definition. Ultimately want {@link org.hibernate.persister.walking.spi.AttributeDefinition} and * Package for "walking" associations through metadata definition. Ultimately want {@link org.hibernate.persister.walking.spi.AttributeDefinition} and
* {@link AttributeSource} etc to become part of the persister model. * {@link AttributeSource} etc to become part of the persister model.
*/ */

View File

@ -34,4 +34,4 @@ package org.hibernate.procedure;
* @see org.hibernate.Session#createStoredProcedureCall(String) * @see org.hibernate.Session#createStoredProcedureCall(String)
* @see org.hibernate.Session#createStoredProcedureCall(String, Class[]) * @see org.hibernate.Session#createStoredProcedureCall(String, Class[])
* @see org.hibernate.Session#createStoredProcedureCall(String, String...) * @see org.hibernate.Session#createStoredProcedureCall(String, String...)
*/ */

View File

@ -132,7 +132,7 @@ public abstract class AbstractLazyInitializer implements LazyInitializer {
} }
else { else {
// use the read-only/modifiable setting indicated during deserialization // use the read-only/modifiable setting indicated during deserialization
setReadOnly( readOnlyBeforeAttachedToSession.booleanValue() ); setReadOnly( readOnlyBeforeAttachedToSession );
readOnlyBeforeAttachedToSession = null; readOnlyBeforeAttachedToSession = null;
} }
} }

View File

@ -68,7 +68,6 @@ public abstract class BasicLazyInitializer extends AbstractLazyInitializer {
protected abstract Object serializableProxy(); protected abstract Object serializableProxy();
@SuppressWarnings({ "UnnecessaryBoxing" })
protected final Object invoke(Method method, Object[] args, Object proxy) throws Throwable { protected final Object invoke(Method method, Object[] args, Object proxy) throws Throwable {
String methodName = method.getName(); String methodName = method.getName();
int params = args.length; int params = args.length;
@ -78,7 +77,7 @@ public abstract class BasicLazyInitializer extends AbstractLazyInitializer {
return getReplacement(); return getReplacement();
} }
else if ( !overridesEquals && "hashCode".equals(methodName) ) { else if ( !overridesEquals && "hashCode".equals(methodName) ) {
return Integer.valueOf( System.identityHashCode(proxy) ); return System.identityHashCode(proxy);
} }
else if ( isUninitialized() && method.equals(getIdentifierMethod) ) { else if ( isUninitialized() && method.equals(getIdentifierMethod) ) {
return getIdentifier(); return getIdentifier();

View File

@ -21,4 +21,4 @@ package org.hibernate.result;
* } * }
* } * }
* </code> * </code>
*/ */

View File

@ -2,4 +2,4 @@ package org.hibernate.secure;
/** /**
* Package defining support for declarative security of CRUD operations via JACC. * Package defining support for declarative security of CRUD operations via JACC.
*/ */

View File

@ -37,4 +37,4 @@ public class ServiceDependencyException extends HibernateException {
public ServiceDependencyException(String s) { public ServiceDependencyException(String s) {
super( s ); super( s );
} }
} }

View File

@ -66,4 +66,4 @@ public class DecodeCaseFragment extends CaseFragment {
return buf.toString(); return buf.toString();
} }
} }

View File

@ -272,4 +272,4 @@ public interface Statistics {
* that occurred * that occurred
*/ */
public long getOptimisticFailureCount(); public long getOptimisticFailureCount();
} }

View File

@ -406,9 +406,9 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
} }
} }
@SuppressWarnings({ "UnnecessaryBoxing" }) @Override
public void queryExecuted(String hql, int rows, long time) { public void queryExecuted(String hql, int rows, long time) {
LOG.hql(hql, Long.valueOf(time), Long.valueOf(rows)); LOG.hql(hql, time, (long) rows );
queryExecutionCount.getAndIncrement(); queryExecutionCount.getAndIncrement();
boolean isLongestQuery = false; boolean isLongestQuery = false;
for ( long old = queryExecutionMaxTime.get(); for ( long old = queryExecutionMaxTime.get();
@ -424,7 +424,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
qs.executed( rows, time ); qs.executed( rows, time );
} }
} }
@Override
public void queryCacheHit(String hql, String regionName) { public void queryCacheHit(String hql, String regionName) {
queryCacheHitCount.getAndIncrement(); queryCacheHitCount.getAndIncrement();
if ( hql != null ) { if ( hql != null ) {
@ -436,7 +436,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
); );
slcs.incrementHitCount(); slcs.incrementHitCount();
} }
@Override
public void queryCacheMiss(String hql, String regionName) { public void queryCacheMiss(String hql, String regionName) {
queryCacheMissCount.getAndIncrement(); queryCacheMissCount.getAndIncrement();
if ( hql != null ) { if ( hql != null ) {
@ -448,7 +448,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
); );
slcs.incrementMissCount(); slcs.incrementMissCount();
} }
@Override
public void queryCachePut(String hql, String regionName) { public void queryCachePut(String hql, String regionName) {
queryCachePutCount.getAndIncrement(); queryCachePutCount.getAndIncrement();
if ( hql != null ) { if ( hql != null ) {
@ -483,6 +483,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
* *
* @return QueryStatistics * @return QueryStatistics
*/ */
@Override
public QueryStatistics getQueryStatistics(String queryString) { public QueryStatistics getQueryStatistics(String queryString) {
ConcurrentQueryStatisticsImpl qs = (ConcurrentQueryStatisticsImpl) queryStatistics.get( queryString ); ConcurrentQueryStatisticsImpl qs = (ConcurrentQueryStatisticsImpl) queryStatistics.get( queryString );
if ( qs == null ) { if ( qs == null ) {
@ -500,6 +501,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return entity deletion count * @return entity deletion count
*/ */
@Override
public long getEntityDeleteCount() { public long getEntityDeleteCount() {
return entityDeleteCount.get(); return entityDeleteCount.get();
} }
@ -507,6 +509,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return entity insertion count * @return entity insertion count
*/ */
@Override
public long getEntityInsertCount() { public long getEntityInsertCount() {
return entityInsertCount.get(); return entityInsertCount.get();
} }
@ -514,6 +517,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return entity load (from DB) * @return entity load (from DB)
*/ */
@Override
public long getEntityLoadCount() { public long getEntityLoadCount() {
return entityLoadCount.get(); return entityLoadCount.get();
} }
@ -521,6 +525,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return entity fetch (from DB) * @return entity fetch (from DB)
*/ */
@Override
public long getEntityFetchCount() { public long getEntityFetchCount() {
return entityFetchCount.get(); return entityFetchCount.get();
} }
@ -528,34 +533,35 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return entity update * @return entity update
*/ */
@Override
public long getEntityUpdateCount() { public long getEntityUpdateCount() {
return entityUpdateCount.get(); return entityUpdateCount.get();
} }
@Override
public long getQueryExecutionCount() { public long getQueryExecutionCount() {
return queryExecutionCount.get(); return queryExecutionCount.get();
} }
@Override
public long getQueryCacheHitCount() { public long getQueryCacheHitCount() {
return queryCacheHitCount.get(); return queryCacheHitCount.get();
} }
@Override
public long getQueryCacheMissCount() { public long getQueryCacheMissCount() {
return queryCacheMissCount.get(); return queryCacheMissCount.get();
} }
@Override
public long getQueryCachePutCount() { public long getQueryCachePutCount() {
return queryCachePutCount.get(); return queryCachePutCount.get();
} }
@Override
public long getUpdateTimestampsCacheHitCount() { public long getUpdateTimestampsCacheHitCount() {
return updateTimestampsCacheHitCount.get(); return updateTimestampsCacheHitCount.get();
} }
@Override
public long getUpdateTimestampsCacheMissCount() { public long getUpdateTimestampsCacheMissCount() {
return updateTimestampsCacheMissCount.get(); return updateTimestampsCacheMissCount.get();
} }
@Override
public long getUpdateTimestampsCachePutCount() { public long getUpdateTimestampsCachePutCount() {
return updateTimestampsCachePutCount.get(); return updateTimestampsCachePutCount.get();
} }
@ -563,6 +569,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return flush * @return flush
*/ */
@Override
public long getFlushCount() { public long getFlushCount() {
return flushCount.get(); return flushCount.get();
} }
@ -570,6 +577,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return session connect * @return session connect
*/ */
@Override
public long getConnectCount() { public long getConnectCount() {
return connectCount.get(); return connectCount.get();
} }
@ -577,6 +585,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return second level cache hit * @return second level cache hit
*/ */
@Override
public long getSecondLevelCacheHitCount() { public long getSecondLevelCacheHitCount() {
return secondLevelCacheHitCount.get(); return secondLevelCacheHitCount.get();
} }
@ -584,6 +593,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return second level cache miss * @return second level cache miss
*/ */
@Override
public long getSecondLevelCacheMissCount() { public long getSecondLevelCacheMissCount() {
return secondLevelCacheMissCount.get(); return secondLevelCacheMissCount.get();
} }
@ -591,6 +601,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return second level cache put * @return second level cache put
*/ */
@Override
public long getSecondLevelCachePutCount() { public long getSecondLevelCachePutCount() {
return secondLevelCachePutCount.get(); return secondLevelCachePutCount.get();
} }
@ -628,6 +639,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return session closing * @return session closing
*/ */
@Override
public long getSessionCloseCount() { public long getSessionCloseCount() {
return sessionCloseCount.get(); return sessionCloseCount.get();
} }
@ -635,6 +647,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return session opening * @return session opening
*/ */
@Override
public long getSessionOpenCount() { public long getSessionOpenCount() {
return sessionOpenCount.get(); return sessionOpenCount.get();
} }
@ -642,6 +655,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return collection loading (from DB) * @return collection loading (from DB)
*/ */
@Override
public long getCollectionLoadCount() { public long getCollectionLoadCount() {
return collectionLoadCount.get(); return collectionLoadCount.get();
} }
@ -649,6 +663,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return collection fetching (from DB) * @return collection fetching (from DB)
*/ */
@Override
public long getCollectionFetchCount() { public long getCollectionFetchCount() {
return collectionFetchCount.get(); return collectionFetchCount.get();
} }
@ -656,6 +671,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return collection update * @return collection update
*/ */
@Override
public long getCollectionUpdateCount() { public long getCollectionUpdateCount() {
return collectionUpdateCount.get(); return collectionUpdateCount.get();
} }
@ -664,6 +680,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
* @return collection removal * @return collection removal
* FIXME: even if isInverse="true"? * FIXME: even if isInverse="true"?
*/ */
@Override
public long getCollectionRemoveCount() { public long getCollectionRemoveCount() {
return collectionRemoveCount.get(); return collectionRemoveCount.get();
} }
@ -671,6 +688,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return collection recreation * @return collection recreation
*/ */
@Override
public long getCollectionRecreateCount() { public long getCollectionRecreateCount() {
return collectionRecreateCount.get(); return collectionRecreateCount.get();
} }
@ -678,6 +696,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* @return start time in ms (JVM standards {@link System#currentTimeMillis()}) * @return start time in ms (JVM standards {@link System#currentTimeMillis()})
*/ */
@Override
public long getStartTime() { public long getStartTime() {
return startTime; return startTime;
} }
@ -685,6 +704,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* log in info level the main statistics * log in info level the main statistics
*/ */
@Override
public void logSummary() { public void logSummary() {
LOG.loggingStatistics(); LOG.loggingStatistics();
LOG.startTime( startTime ); LOG.startTime( startTime );
@ -728,6 +748,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* Are statistics logged * Are statistics logged
*/ */
@Override
public boolean isStatisticsEnabled() { public boolean isStatisticsEnabled() {
return isStatisticsEnabled; return isStatisticsEnabled;
} }
@ -735,6 +756,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* Enable statistics logs (this is a dynamic parameter) * Enable statistics logs (this is a dynamic parameter)
*/ */
@Override
public void setStatisticsEnabled(boolean b) { public void setStatisticsEnabled(boolean b) {
isStatisticsEnabled = b; isStatisticsEnabled = b;
} }
@ -743,6 +765,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
* @return Returns the max query execution time, * @return Returns the max query execution time,
* for all queries * for all queries
*/ */
@Override
public long getQueryExecutionMaxTime() { public long getQueryExecutionMaxTime() {
return queryExecutionMaxTime.get(); return queryExecutionMaxTime.get();
} }
@ -750,6 +773,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* Get all executed query strings * Get all executed query strings
*/ */
@Override
public String[] getQueries() { public String[] getQueries() {
return ArrayHelper.toStringArray( queryStatistics.keySet() ); return ArrayHelper.toStringArray( queryStatistics.keySet() );
} }
@ -757,6 +781,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* Get the names of all entities * Get the names of all entities
*/ */
@Override
public String[] getEntityNames() { public String[] getEntityNames() {
if ( sessionFactory == null ) { if ( sessionFactory == null ) {
return ArrayHelper.toStringArray( entityStatistics.keySet() ); return ArrayHelper.toStringArray( entityStatistics.keySet() );
@ -769,6 +794,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* Get the names of all collection roles * Get the names of all collection roles
*/ */
@Override
public String[] getCollectionRoleNames() { public String[] getCollectionRoleNames() {
if ( sessionFactory == null ) { if ( sessionFactory == null ) {
return ArrayHelper.toStringArray( collectionStatistics.keySet() ); return ArrayHelper.toStringArray( collectionStatistics.keySet() );
@ -781,6 +807,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
/** /**
* Get all second-level cache region names * Get all second-level cache region names
*/ */
@Override
public String[] getSecondLevelCacheRegionNames() { public String[] getSecondLevelCacheRegionNames() {
if ( sessionFactory == null ) { if ( sessionFactory == null ) {
return ArrayHelper.toStringArray( secondLevelCacheStatistics.keySet() ); return ArrayHelper.toStringArray( secondLevelCacheStatistics.keySet() );
@ -789,43 +816,43 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
return ArrayHelper.toStringArray( sessionFactory.getAllSecondLevelCacheRegions().keySet() ); return ArrayHelper.toStringArray( sessionFactory.getAllSecondLevelCacheRegions().keySet() );
} }
} }
@Override
public void endTransaction(boolean success) { public void endTransaction(boolean success) {
transactionCount.getAndIncrement(); transactionCount.getAndIncrement();
if ( success ) { if ( success ) {
committedTransactionCount.getAndIncrement(); committedTransactionCount.getAndIncrement();
} }
} }
@Override
public long getSuccessfulTransactionCount() { public long getSuccessfulTransactionCount() {
return committedTransactionCount.get(); return committedTransactionCount.get();
} }
@Override
public long getTransactionCount() { public long getTransactionCount() {
return transactionCount.get(); return transactionCount.get();
} }
@Override
public void closeStatement() { public void closeStatement() {
closeStatementCount.getAndIncrement(); closeStatementCount.getAndIncrement();
} }
@Override
public void prepareStatement() { public void prepareStatement() {
prepareStatementCount.getAndIncrement(); prepareStatementCount.getAndIncrement();
} }
@Override
public long getCloseStatementCount() { public long getCloseStatementCount() {
return closeStatementCount.get(); return closeStatementCount.get();
} }
@Override
public long getPrepareStatementCount() { public long getPrepareStatementCount() {
return prepareStatementCount.get(); return prepareStatementCount.get();
} }
@Override
public void optimisticFailure(String entityName) { public void optimisticFailure(String entityName) {
optimisticFailureCount.getAndIncrement(); optimisticFailureCount.getAndIncrement();
( (ConcurrentEntityStatisticsImpl) getEntityStatistics( entityName ) ).incrementOptimisticFailureCount(); ( (ConcurrentEntityStatisticsImpl) getEntityStatistics( entityName ) ).incrementOptimisticFailureCount();
} }
@Override
public long getOptimisticFailureCount() { public long getOptimisticFailureCount() {
return optimisticFailureCount.get(); return optimisticFailureCount.get();
} }
@ -873,7 +900,7 @@ public class ConcurrentStatisticsImpl implements StatisticsImplementor, Service
.append( ']' ) .append( ']' )
.toString(); .toString();
} }
@Override
public String getQueryExecutionMaxTimeQueryString() { public String getQueryExecutionMaxTimeQueryString() {
return queryExecutionMaxTimeQueryString; return queryExecutionMaxTimeQueryString;
} }

View File

@ -249,4 +249,4 @@ public interface StatisticsImplementor extends Statistics, Service {
* Callback indicating a put to the timestamp cache * Callback indicating a put to the timestamp cache
*/ */
public void updateTimestampsCachePut(); public void updateTimestampsCachePut();
} }

View File

@ -56,4 +56,4 @@ public abstract class AliasedTupleSubsetResultTransformer
} }
return includeInTransform; return includeInTransform;
} }
} }

View File

@ -82,4 +82,4 @@ public interface TupleSubsetResultTransformer extends ResultTransformer {
* element of the tuple is included in the transformed value. * element of the tuple is included in the transformed value.
*/ */
boolean[] includeInTransform(String[] aliases, int tupleLength); boolean[] includeInTransform(String[] aliases, int tupleLength);
} }

Some files were not shown because too many files have changed in this diff Show More