don't write @SuppressWarnings({ "unchecked" })

This commit is contained in:
Gavin King 2022-02-05 20:02:31 +01:00
parent 4b1cd56218
commit a25758f519
135 changed files with 209 additions and 209 deletions

View File

@ -66,7 +66,7 @@ public class AnnotationsIllustrationTest extends TestCase {
} }
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testBasicUsage() { public void testBasicUsage() {
// create a couple of events... // create a couple of events...
Session session = sessionFactory.openSession(); Session session = sessionFactory.openSession();

View File

@ -48,7 +48,7 @@ public class BitSetJavaType extends AbstractClassJavaType<BitSet> {
return BitSetHelper.stringToBitSet(string.toString()); return BitSetHelper.stringToBitSet(string.toString());
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public <X> X unwrap(BitSet value, Class<X> type, WrapperOptions options) { public <X> X unwrap(BitSet value, Class<X> type, WrapperOptions options) {
if (value == null) { if (value == null) {
return null; return null;

View File

@ -92,7 +92,7 @@ public class C3P0ConnectionProvider
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> unwrapType) { public <T> T unwrap(Class<T> unwrapType) {
if ( ConnectionProvider.class.equals( unwrapType ) || if ( ConnectionProvider.class.equals( unwrapType ) ||
C3P0ConnectionProvider.class.isAssignableFrom( unwrapType ) ) { C3P0ConnectionProvider.class.isAssignableFrom( unwrapType ) ) {

View File

@ -160,7 +160,7 @@ public class UnresolvedEntityInsertActions {
return dependenciesByAction.isEmpty(); return dependenciesByAction.isEmpty();
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
private void addDependenciesByTransientEntity(AbstractEntityInsertAction insert, NonNullableTransientDependencies dependencies) { private void addDependenciesByTransientEntity(AbstractEntityInsertAction insert, NonNullableTransientDependencies dependencies) {
for ( Object transientEntity : dependencies.getNonNullableTransientEntities() ) { for ( Object transientEntity : dependencies.getNonNullableTransientEntities() ) {
Set<AbstractEntityInsertAction> dependentActions = dependentActionsByTransientEntity.get( transientEntity ); Set<AbstractEntityInsertAction> dependentActions = dependentActionsByTransientEntity.get( transientEntity );
@ -182,7 +182,7 @@ public class UnresolvedEntityInsertActions {
* *
* @throws IllegalArgumentException if {@code managedEntity} did not have managed or read-only status. * @throws IllegalArgumentException if {@code managedEntity} did not have managed or read-only status.
*/ */
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public Set<AbstractEntityInsertAction> resolveDependentActions(Object managedEntity, SessionImplementor session) { public Set<AbstractEntityInsertAction> resolveDependentActions(Object managedEntity, SessionImplementor session) {
final EntityEntry entityEntry = session.getPersistenceContextInternal().getEntry( managedEntity ); final EntityEntry entityEntry = session.getPersistenceContextInternal().getEntry( managedEntity );
if ( entityEntry.getStatus() != Status.MANAGED && entityEntry.getStatus() != Status.READ_ONLY ) { if ( entityEntry.getStatus() != Status.MANAGED && entityEntry.getStatus() != Status.READ_ONLY ) {

View File

@ -1344,7 +1344,7 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void addUniqueConstraints(Table table, List uniqueConstraints) { public void addUniqueConstraints(Table table, List uniqueConstraints) {
List<UniqueConstraintHolder> constraintHolders = new ArrayList<>( uniqueConstraints.size() ); List<UniqueConstraintHolder> constraintHolders = new ArrayList<>( uniqueConstraints.size() );

View File

@ -28,7 +28,7 @@ public class ValueConverterTypeAdapter<J> extends AbstractSingleColumnStandardBa
private final ValueBinder<Object> valueBinder; private final ValueBinder<Object> valueBinder;
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public ValueConverterTypeAdapter( public ValueConverterTypeAdapter(
String description, String description,
BasicValueConverter<J, ?> converter, BasicValueConverter<J, ?> converter,

View File

@ -99,7 +99,7 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
* @deprecated No longer used/supported! * @deprecated No longer used/supported!
*/ */
@Deprecated @Deprecated
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public static ClassLoaderServiceImpl fromConfigSettings(Map configValues) { public static ClassLoaderServiceImpl fromConfigSettings(Map configValues) {
final List<ClassLoader> providedClassLoaders = new ArrayList<>(); final List<ClassLoader> providedClassLoaders = new ArrayList<>();
@ -112,7 +112,7 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public <T> Class<T> classForName(String className) { public <T> Class<T> classForName(String className) {
try { try {
return (Class<T>) Class.forName( className, true, getAggregatedClassLoader() ); return (Class<T>) Class.forName( className, true, getAggregatedClassLoader() );

View File

@ -54,7 +54,7 @@ public abstract class AbstractMultiTenantConnectionProvider implements MultiTena
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> unwrapType) { public <T> T unwrap(Class<T> unwrapType) {
if ( MultiTenantConnectionProvider.class.isAssignableFrom( unwrapType ) ) { if ( MultiTenantConnectionProvider.class.isAssignableFrom( unwrapType ) ) {
return (T) this; return (T) this;

View File

@ -318,7 +318,7 @@ public class JdbcCoordinatorImpl implements JdbcCoordinator {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void registerLastQuery(Statement statement) { public void registerLastQuery(Statement statement) {
LOG.tracev( "Registering last query statement [{0}]", statement ); LOG.tracev( "Registering last query statement [{0}]", statement );
if ( statement instanceof JdbcWrapper ) { if ( statement instanceof JdbcWrapper ) {
@ -359,7 +359,7 @@ public class JdbcCoordinatorImpl implements JdbcCoordinator {
releasesEnabled = false; releasesEnabled = false;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
protected void close(Statement statement) { protected void close(Statement statement) {
LOG.tracev( "Closing prepared statement [{0}]", statement ); LOG.tracev( "Closing prepared statement [{0}]", statement );
@ -408,7 +408,7 @@ public class JdbcCoordinatorImpl implements JdbcCoordinator {
LOG.tracev( "Closing result set [{0}]", resultSet ); LOG.tracev( "Closing result set [{0}]", resultSet );
if ( resultSet instanceof InvalidatableWrapper ) { if ( resultSet instanceof InvalidatableWrapper ) {
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
final InvalidatableWrapper<ResultSet> wrapper = (InvalidatableWrapper<ResultSet>) resultSet; final InvalidatableWrapper<ResultSet> wrapper = (InvalidatableWrapper<ResultSet>) resultSet;
close( wrapper.getWrappedObject() ); close( wrapper.getWrappedObject() );
wrapper.invalidate(); wrapper.invalidate();

View File

@ -97,7 +97,7 @@ public class EventListenerRegistryImpl implements EventListenerRegistry {
this.eventListeners = eventListeners; this.eventListeners = eventListeners;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <T> EventListenerGroup<T> getEventListenerGroup(EventType<T> eventType) { public <T> EventListenerGroup<T> getEventListenerGroup(EventType<T> eventType) {
if ( eventListeners.length < eventType.ordinal() + 1 ) { if ( eventListeners.length < eventType.ordinal() + 1 ) {
// eventTpe is a custom EventType that has not been registered. // eventTpe is a custom EventType that has not been registered.

View File

@ -179,7 +179,7 @@ public final class ArrayHelper {
return result; return result;
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public static <T> T[] join(T[] x, T... y) { public static <T> T[] join(T[] x, T... y) {
T[] result = (T[]) Array.newInstance( x.getClass().getComponentType(), x.length + y.length ); T[] result = (T[]) Array.newInstance( x.getClass().getComponentType(), x.length + y.length );
System.arraycopy( x, 0, result, 0, x.length ); System.arraycopy( x, 0, result, 0, x.length );

View File

@ -87,7 +87,7 @@ public final class IdentityMap<K,V> implements Map<K,V> {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public boolean containsKey(Object key) { public boolean containsKey(Object key) {
return map.containsKey( new IdentityKey( key ) ); return map.containsKey( new IdentityKey( key ) );
} }

View File

@ -19,7 +19,7 @@ public final class RowVersionComparator implements Comparator<byte[]> {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public int compare(byte[] o1, byte[] o2) { public int compare(byte[] o1, byte[] o2) {
final int lengthToCheck = Math.min( o1.length, o2.length ); final int lengthToCheck = Math.min( o1.length, o2.length );

View File

@ -261,7 +261,7 @@ public final class ConfigurationHelper {
* *
* @return The clone * @return The clone
*/ */
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public static Map clone(Map<?,?> configurationValues) { public static Map clone(Map<?,?> configurationValues) {
if ( configurationValues == null ) { if ( configurationValues == null ) {
return null; return null;

View File

@ -147,7 +147,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeIndicators, Resol
super.setJpaAttributeConverterDescriptor( descriptor ); super.setJpaAttributeConverterDescriptor( descriptor );
} }
@SuppressWarnings({"rawtypes"}) @SuppressWarnings("rawtypes")
public void setExplicitJavaTypeAccess(Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess) { public void setExplicitJavaTypeAccess(Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess) {
this.explicitJavaTypeAccess = explicitJavaTypeAccess; this.explicitJavaTypeAccess = explicitJavaTypeAccess;
} }

View File

@ -94,7 +94,7 @@ public class AttributeFactory {
return buildAttribute( ownerType, property, context ); return buildAttribute( ownerType, property, context );
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public static <X, Y> PersistentAttribute<X, Y> buildAttribute( public static <X, Y> PersistentAttribute<X, Y> buildAttribute(
ManagedDomainType<X> ownerType, ManagedDomainType<X> ownerType,
Property property, Property property,

View File

@ -108,7 +108,7 @@ public abstract class AbstractIdentifiableType<J>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <Y> SingularPersistentAttribute<? super J, Y> getId(Class<Y> javaType) { public <Y> SingularPersistentAttribute<? super J, Y> getId(Class<Y> javaType) {
ensureNoIdClass(); ensureNoIdClass();
SingularPersistentAttribute<J, ?> id = findIdAttribute(); SingularPersistentAttribute<J, ?> id = findIdAttribute();
@ -163,7 +163,7 @@ public abstract class AbstractIdentifiableType<J>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <Y> SingularPersistentAttribute<J, Y> getDeclaredId(Class<Y> javaType) { public <Y> SingularPersistentAttribute<J, Y> getDeclaredId(Class<Y> javaType) {
ensureNoIdClass(); ensureNoIdClass();
if ( id == null ) { if ( id == null ) {
@ -287,7 +287,7 @@ public abstract class AbstractIdentifiableType<J>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <Y> SingularPersistentAttribute<J, Y> getDeclaredVersion(Class<Y> javaType) { public <Y> SingularPersistentAttribute<J, Y> getDeclaredVersion(Class<Y> javaType) {
checkDeclaredVersion(); checkDeclaredVersion();
checkType( versionAttribute, javaType ); checkType( versionAttribute, javaType );

View File

@ -259,7 +259,7 @@ public abstract class AbstractManagedType<J>
// Singular attributes // Singular attributes
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public Set<SingularAttribute<? super J, ?>> getSingularAttributes() { public Set<SingularAttribute<? super J, ?>> getSingularAttributes() {
HashSet attributes = new HashSet<>( declaredSingularAttributes.values() ); HashSet attributes = new HashSet<>( declaredSingularAttributes.values() );
if ( getSuperType() != null ) { if ( getSuperType() != null ) {
@ -292,7 +292,7 @@ public abstract class AbstractManagedType<J>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <Y> SingularPersistentAttribute<? super J, Y> getSingularAttribute(String name, Class<Y> type) { public <Y> SingularPersistentAttribute<? super J, Y> getSingularAttribute(String name, Class<Y> type) {
SingularAttribute attribute = findSingularAttribute( name ); SingularAttribute attribute = findSingularAttribute( name );
checkTypeForSingleAttribute( attribute, name, type ); checkTypeForSingleAttribute( attribute, name, type );
@ -462,7 +462,7 @@ public abstract class AbstractManagedType<J>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <E> BagPersistentAttribute<? super J, E> getCollection(String name, Class<E> elementType) { public <E> BagPersistentAttribute<? super J, E> getCollection(String name, Class<E> elementType) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name ); PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
checkCollectionElementType( attribute, name, elementType ); checkCollectionElementType( attribute, name, elementType );
@ -486,7 +486,7 @@ public abstract class AbstractManagedType<J>
// Set attributes // Set attributes
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public SetPersistentAttribute<? super J, ?> getSet(String name) { public SetPersistentAttribute<? super J, ?> getSet(String name) {
final PluralAttribute attribute = findPluralAttribute( name ); final PluralAttribute attribute = findPluralAttribute( name );
basicSetCheck( attribute, name ); basicSetCheck( attribute, name );
@ -509,7 +509,7 @@ public abstract class AbstractManagedType<J>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <E> SetAttribute<? super J, E> getSet(String name, Class<E> elementType) { public <E> SetAttribute<? super J, E> getSet(String name, Class<E> elementType) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name ); PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
checkSetElementType( attribute, name, elementType ); checkSetElementType( attribute, name, elementType );
@ -533,7 +533,7 @@ public abstract class AbstractManagedType<J>
// List attributes // List attributes
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public ListPersistentAttribute<? super J, ?> getList(String name) { public ListPersistentAttribute<? super J, ?> getList(String name) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name ); PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
basicListCheck( attribute, name ); basicListCheck( attribute, name );
@ -556,7 +556,7 @@ public abstract class AbstractManagedType<J>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <E> ListAttribute<? super J, E> getList(String name, Class<E> elementType) { public <E> ListAttribute<? super J, E> getList(String name, Class<E> elementType) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name ); PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
checkListElementType( attribute, name, elementType ); checkListElementType( attribute, name, elementType );
@ -580,7 +580,7 @@ public abstract class AbstractManagedType<J>
// Map attributes // Map attributes
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public MapPersistentAttribute<? super J, ?, ?> getMap(String name) { public MapPersistentAttribute<? super J, ?, ?> getMap(String name) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name ); PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
basicMapCheck( attribute, name ); basicMapCheck( attribute, name );
@ -603,7 +603,7 @@ public abstract class AbstractManagedType<J>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <K, V> MapAttribute<? super J, K, V> getMap(String name, Class<K> keyType, Class<V> valueType) { public <K, V> MapAttribute<? super J, K, V> getMap(String name, Class<K> keyType, Class<V> valueType) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name ); PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
checkMapValueType( attribute, name, valueType ); checkMapValueType( attribute, name, valueType );

View File

@ -42,7 +42,7 @@ public class ByteBuddyProxyHelper implements Serializable {
this.byteBuddyState = byteBuddyState; this.byteBuddyState = byteBuddyState;
} }
@SuppressWarnings({ "rawtypes" }) @SuppressWarnings("rawtypes")
public Class buildProxy( public Class buildProxy(
final Class<?> persistentClass, final Class<?> persistentClass,
final Class<?>[] interfaces) { final Class<?>[] interfaces) {

View File

@ -806,7 +806,7 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public SqmExpression<Number> quot(Number x, Expression<? extends Number> y) { public SqmExpression<Number> quot(Number x, Expression<? extends Number> y) {
return createSqmArithmeticNode( return createSqmArithmeticNode(
BinaryArithmeticOperator.QUOT, BinaryArithmeticOperator.QUOT,
@ -1669,7 +1669,7 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <Y extends Comparable<? super Y>> SqmPredicate between(Expression<? extends Y> value, Y lower, Y upper) { public <Y extends Comparable<? super Y>> SqmPredicate between(Expression<? extends Y> value, Y lower, Y upper) {
final SqmExpression<? extends Y> valueExpression = (SqmExpression<? extends Y>) value; final SqmExpression<? extends Y> valueExpression = (SqmExpression<? extends Y>) value;
return new SqmBetweenPredicate( return new SqmBetweenPredicate(

View File

@ -159,7 +159,7 @@ public final class ResourceRegistryStandardImpl implements ResourceRegistry {
close( s ); close( s );
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
private static void close(final ResultSet resultSet) { private static void close(final ResultSet resultSet) {
log.tracef( "Closing result set [%s]", resultSet ); log.tracef( "Closing result set [%s]", resultSet );
@ -175,7 +175,7 @@ public final class ResourceRegistryStandardImpl implements ResourceRegistry {
} }
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public static void close(Statement statement) { public static void close(Statement statement) {
log.tracef( "Closing prepared statement [%s]", statement ); log.tracef( "Closing prepared statement [%s]", statement );

View File

@ -154,13 +154,13 @@ public abstract class AbstractStandardBasicType<T>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public boolean isEqual(Object one, Object another) { public boolean isEqual(Object one, Object another) {
return javaType.areEqual( (T) one, (T) another ); return javaType.areEqual( (T) one, (T) another );
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final int getHashCode(Object x) { public final int getHashCode(Object x) {
return javaType.extractHashCode( (T) x ); return javaType.extractHashCode( (T) x );
} }
@ -171,7 +171,7 @@ public abstract class AbstractStandardBasicType<T>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final int compare(Object x, Object y) { public final int compare(Object x, Object y) {
return javaType.getComparator().compare( (T) x, (T) y ); return javaType.getComparator().compare( (T) x, (T) y );
} }
@ -214,7 +214,7 @@ public abstract class AbstractStandardBasicType<T>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final String toLoggableString(Object value, SessionFactoryImplementor factory) { public final String toLoggableString(Object value, SessionFactoryImplementor factory) {
if ( value == LazyPropertyInitializer.UNFETCHED_PROPERTY || !Hibernate.isInitialized( value ) ) { if ( value == LazyPropertyInitializer.UNFETCHED_PROPERTY || !Hibernate.isInitialized( value ) ) {
return "<uninitialized>"; return "<uninitialized>";
@ -228,7 +228,7 @@ public abstract class AbstractStandardBasicType<T>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final Object deepCopy(Object value, SessionFactoryImplementor factory) { public final Object deepCopy(Object value, SessionFactoryImplementor factory) {
return deepCopy( (T) value ); return deepCopy( (T) value );
} }
@ -238,7 +238,7 @@ public abstract class AbstractStandardBasicType<T>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final Serializable disassemble(Object value, SharedSessionContractImplementor session, Object owner) throws HibernateException { public final Serializable disassemble(Object value, SharedSessionContractImplementor session, Object owner) throws HibernateException {
return getMutabilityPlan().disassemble( (T) value, session ); return getMutabilityPlan().disassemble( (T) value, session );
} }
@ -253,7 +253,7 @@ public abstract class AbstractStandardBasicType<T>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final Object replace(Object original, Object target, SharedSessionContractImplementor session, Object owner, Map<Object, Object> copyCache) { public final Object replace(Object original, Object target, SharedSessionContractImplementor session, Object owner, Map<Object, Object> copyCache) {
if ( original == null && target == null ) { if ( original == null && target == null ) {
return null; return null;
@ -263,7 +263,7 @@ public abstract class AbstractStandardBasicType<T>
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public Object replace( public Object replace(
Object original, Object original,
Object target, Object target,

View File

@ -208,13 +208,13 @@ public class SerializableToBlobType<T extends Serializable> implements BasicType
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public boolean isEqual(Object one, Object another) { public boolean isEqual(Object one, Object another) {
return javaType.areEqual( (T) one, (T) another ); return javaType.areEqual( (T) one, (T) another );
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final int getHashCode(Object x) { public final int getHashCode(Object x) {
return javaType.extractHashCode( (T) x ); return javaType.extractHashCode( (T) x );
} }
@ -225,7 +225,7 @@ public class SerializableToBlobType<T extends Serializable> implements BasicType
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final int compare(Object x, Object y) { public final int compare(Object x, Object y) {
return javaType.getComparator().compare( (T) x, (T) y ); return javaType.getComparator().compare( (T) x, (T) y );
} }
@ -268,7 +268,7 @@ public class SerializableToBlobType<T extends Serializable> implements BasicType
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final String toLoggableString(Object value, SessionFactoryImplementor factory) { public final String toLoggableString(Object value, SessionFactoryImplementor factory) {
if ( value == LazyPropertyInitializer.UNFETCHED_PROPERTY || !Hibernate.isInitialized( value ) ) { if ( value == LazyPropertyInitializer.UNFETCHED_PROPERTY || !Hibernate.isInitialized( value ) ) {
return "<uninitialized>"; return "<uninitialized>";
@ -282,7 +282,7 @@ public class SerializableToBlobType<T extends Serializable> implements BasicType
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final Object deepCopy(Object value, SessionFactoryImplementor factory) { public final Object deepCopy(Object value, SessionFactoryImplementor factory) {
return deepCopy( (T) value ); return deepCopy( (T) value );
} }
@ -292,7 +292,7 @@ public class SerializableToBlobType<T extends Serializable> implements BasicType
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public final Serializable disassemble(Object value, SharedSessionContractImplementor session, Object owner) throws HibernateException { public final Serializable disassemble(Object value, SharedSessionContractImplementor session, Object owner) throws HibernateException {
return getMutabilityPlan().disassemble( (T) value, session ); return getMutabilityPlan().disassemble( (T) value, session );
} }
@ -317,7 +317,7 @@ public class SerializableToBlobType<T extends Serializable> implements BasicType
} }
@Override @Override
// @SuppressWarnings({ "unchecked" }) // @SuppressWarnings("unchecked")
public Object replace( public Object replace(
Object original, Object original,
Object target, Object target,

View File

@ -45,7 +45,7 @@ public abstract class AbstractClassJavaType<T> implements BasicJavaType<T>, Seri
* @param type The Java type. * @param type The Java type.
* @param mutabilityPlan The plan for handling mutability aspects of the java type. * @param mutabilityPlan The plan for handling mutability aspects of the java type.
*/ */
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
protected AbstractClassJavaType(Class<? extends T> type, MutabilityPlan<? extends T> mutabilityPlan) { protected AbstractClassJavaType(Class<? extends T> type, MutabilityPlan<? extends T> mutabilityPlan) {
this( this(
type, type,

View File

@ -44,7 +44,7 @@ public class BigDecimalJavaType extends AbstractClassJavaType<BigDecimal> {
return value.intValue(); return value.intValue();
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(BigDecimal value, Class<X> type, WrapperOptions options) { public <X> X unwrap(BigDecimal value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -47,7 +47,7 @@ public class BigIntegerJavaType extends AbstractClassJavaType<BigInteger> {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(BigInteger value, Class<X> type, WrapperOptions options) { public <X> X unwrap(BigInteger value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -102,7 +102,7 @@ public class BlobJavaType extends AbstractClassJavaType<Blob> {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(Blob value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Blob value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -51,7 +51,7 @@ public class BooleanJavaType extends AbstractClassJavaType<Boolean> implements
return Boolean.valueOf( string.toString() ); return Boolean.valueOf( string.toString() );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Boolean value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Boolean value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -25,7 +25,7 @@ import org.hibernate.type.descriptor.WrapperOptions;
public class ByteArrayJavaType extends AbstractClassJavaType<Byte[]> { public class ByteArrayJavaType extends AbstractClassJavaType<Byte[]> {
public static final ByteArrayJavaType INSTANCE = new ByteArrayJavaType(); public static final ByteArrayJavaType INSTANCE = new ByteArrayJavaType();
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public ByteArrayJavaType() { public ByteArrayJavaType() {
super( Byte[].class, ArrayMutabilityPlan.INSTANCE, IncomparableComparator.INSTANCE ); super( Byte[].class, ArrayMutabilityPlan.INSTANCE, IncomparableComparator.INSTANCE );
} }
@ -71,7 +71,7 @@ public class ByteArrayJavaType extends AbstractClassJavaType<Byte[]> {
return bytes; return bytes;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Byte[] value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Byte[] value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -40,7 +40,7 @@ public class ByteJavaType extends AbstractClassJavaType<Byte>
return Byte.valueOf( string.toString() ); return Byte.valueOf( string.toString() );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Byte value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Byte value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -93,7 +93,7 @@ public class CalendarDateJavaType extends AbstractTemporalJavaType<Calendar> {
return hashCode; return hashCode;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(Calendar value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Calendar value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -109,7 +109,7 @@ public class CalendarJavaType extends AbstractTemporalJavaType<Calendar> impleme
return hashCode; return hashCode;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(Calendar value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Calendar value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -93,7 +93,7 @@ public class CalendarTimeJavaType extends AbstractTemporalJavaType<Calendar> {
return hashCode; return hashCode;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(Calendar value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Calendar value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -23,7 +23,7 @@ import org.hibernate.type.descriptor.WrapperOptions;
public class CharacterArrayJavaType extends AbstractClassJavaType<Character[]> { public class CharacterArrayJavaType extends AbstractClassJavaType<Character[]> {
public static final CharacterArrayJavaType INSTANCE = new CharacterArrayJavaType(); public static final CharacterArrayJavaType INSTANCE = new CharacterArrayJavaType();
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public CharacterArrayJavaType() { public CharacterArrayJavaType() {
super( Character[].class, ArrayMutabilityPlan.INSTANCE, IncomparableComparator.INSTANCE ); super( Character[].class, ArrayMutabilityPlan.INSTANCE, IncomparableComparator.INSTANCE );
} }
@ -53,7 +53,7 @@ public class CharacterArrayJavaType extends AbstractClassJavaType<Character[]> {
return hashCode; return hashCode;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Character[] value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Character[] value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -37,7 +37,7 @@ public class CharacterJavaType extends AbstractClassJavaType<Character> implemen
return string.charAt( 0 ); return string.charAt( 0 );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Character value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Character value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -38,7 +38,7 @@ public class ClassJavaType extends AbstractClassJavaType<Class> {
} }
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(Class value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Class value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -79,7 +79,7 @@ public class ClobJavaType extends AbstractClassJavaType<Clob> {
return session.getJdbcServices().getJdbcEnvironment().getDialect().getLobMergeStrategy().mergeClob( original, target, session ); return session.getJdbcServices().getJdbcEnvironment().getDialect().getLobMergeStrategy().mergeClob( original, target, session );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(final Clob value, Class<X> type, WrapperOptions options) { public <X> X unwrap(final Clob value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -32,7 +32,7 @@ public class CurrencyJavaType extends AbstractClassJavaType<Currency> {
return Currency.getInstance( string.toString() ); return Currency.getInstance( string.toString() );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(Currency value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Currency value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -108,7 +108,7 @@ public class DateJavaType extends AbstractTemporalJavaType<Date> implements Vers
return CalendarJavaType.INSTANCE.extractHashCode( calendar ); return CalendarJavaType.INSTANCE.extractHashCode( calendar );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Date value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Date value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -44,7 +44,7 @@ public class DoubleJavaType extends AbstractClassJavaType<Double> implements
return Double.valueOf( string.toString() ); return Double.valueOf( string.toString() );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Double value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Double value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -43,7 +43,7 @@ public class FloatTypeDescriptor extends AbstractClassJavaType<Float> implements
return Float.valueOf( string.toString() ); return Float.valueOf( string.toString() );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Float value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Float value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -39,7 +39,7 @@ public class ImmutableMutabilityPlan<T> implements MutabilityPlan<T> {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public T assemble(Serializable cached, SharedSessionContract session) { public T assemble(Serializable cached, SharedSessionContract session) {
return (T) cached; return (T) cached;
} }

View File

@ -48,7 +48,7 @@ public class InetAddressJavaType extends AbstractClassJavaType<InetAddress> {
return indicators.getTypeConfiguration().getJdbcTypeRegistry().getDescriptor( SqlTypes.INET ); return indicators.getTypeConfiguration().getJdbcTypeRegistry().getDescriptor( SqlTypes.INET );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(InetAddress value, Class<X> type, WrapperOptions options) { public <X> X unwrap(InetAddress value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -39,7 +39,7 @@ public class IntegerJavaType extends AbstractClassJavaType<Integer>
return string == null ? null : Integer.valueOf( string.toString() ); return string == null ? null : Integer.valueOf( string.toString() );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Integer value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Integer value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -86,7 +86,7 @@ public class LocaleJavaType extends AbstractClassJavaType<Locale> {
} }
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(Locale value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Locale value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -39,7 +39,7 @@ public class LongJavaType extends AbstractClassJavaType<Long>
return Long.valueOf( string.toString() ); return Long.valueOf( string.toString() );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Long value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Long value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -35,7 +35,7 @@ public abstract class MutableMutabilityPlan<T> implements MutabilityPlan<T> {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public T assemble(Serializable cached, SharedSessionContract session) { public T assemble(Serializable cached, SharedSessionContract session) {
return deepCopy( (T) cached ); return deepCopy( (T) cached );
} }

View File

@ -84,7 +84,7 @@ public class NClobJavaType extends AbstractClassJavaType<NClob> {
return session.getJdbcServices().getJdbcEnvironment().getDialect().getLobMergeStrategy().mergeNClob( original, target, session ); return session.getJdbcServices().getJdbcEnvironment().getDialect().getLobMergeStrategy().mergeNClob( original, target, session );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(final NClob value, Class<X> type, WrapperOptions options) { public <X> X unwrap(final NClob value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -64,7 +64,7 @@ public class ObjectArrayJavaType extends AbstractClassJavaType<Object[]> {
return hashCode; return hashCode;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Object[] value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Object[] value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -29,7 +29,7 @@ public class PrimitiveByteArrayJavaType extends AbstractClassJavaType<byte[]>
implements VersionJavaType<byte[]> { implements VersionJavaType<byte[]> {
public static final PrimitiveByteArrayJavaType INSTANCE = new PrimitiveByteArrayJavaType(); public static final PrimitiveByteArrayJavaType INSTANCE = new PrimitiveByteArrayJavaType();
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public PrimitiveByteArrayJavaType() { public PrimitiveByteArrayJavaType() {
super( byte[].class, ArrayMutabilityPlan.INSTANCE, RowVersionComparator.INSTANCE ); super( byte[].class, ArrayMutabilityPlan.INSTANCE, RowVersionComparator.INSTANCE );
} }
@ -86,7 +86,7 @@ public class PrimitiveByteArrayJavaType extends AbstractClassJavaType<byte[]>
return bytes; return bytes;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(byte[] value, Class<X> type, WrapperOptions options) { public <X> X unwrap(byte[] value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -23,7 +23,7 @@ import org.hibernate.type.descriptor.WrapperOptions;
public class PrimitiveCharacterArrayJavaType extends AbstractClassJavaType<char[]> { public class PrimitiveCharacterArrayJavaType extends AbstractClassJavaType<char[]> {
public static final PrimitiveCharacterArrayJavaType INSTANCE = new PrimitiveCharacterArrayJavaType(); public static final PrimitiveCharacterArrayJavaType INSTANCE = new PrimitiveCharacterArrayJavaType();
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
protected PrimitiveCharacterArrayJavaType() { protected PrimitiveCharacterArrayJavaType() {
super( char[].class, ArrayMutabilityPlan.INSTANCE, IncomparableComparator.INSTANCE ); super( char[].class, ArrayMutabilityPlan.INSTANCE, IncomparableComparator.INSTANCE );
} }
@ -51,7 +51,7 @@ public class PrimitiveCharacterArrayJavaType extends AbstractClassJavaType<char[
return hashCode; return hashCode;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(char[] value, Class<X> type, WrapperOptions options) { public <X> X unwrap(char[] value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -29,7 +29,7 @@ public class RowVersionJavaType extends AbstractClassJavaType<byte[]>
implements VersionJavaType<byte[]> { implements VersionJavaType<byte[]> {
public static final RowVersionJavaType INSTANCE = new RowVersionJavaType(); public static final RowVersionJavaType INSTANCE = new RowVersionJavaType();
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public RowVersionJavaType() { public RowVersionJavaType() {
super( byte[].class, ArrayMutabilityPlan.INSTANCE, RowVersionComparator.INSTANCE ); super( byte[].class, ArrayMutabilityPlan.INSTANCE, RowVersionComparator.INSTANCE );
} }
@ -81,7 +81,7 @@ public class RowVersionJavaType extends AbstractClassJavaType<byte[]>
return bytes; return bytes;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(byte[] value, Class<X> type, WrapperOptions options) { public <X> X unwrap(byte[] value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -39,7 +39,7 @@ public class SerializableJavaType<T extends Serializable> extends AbstractClassJ
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public S deepCopyNotNull(S value) { public S deepCopyNotNull(S value) {
return (S) SerializationHelper.clone( value ); return (S) SerializationHelper.clone( value );
} }
@ -94,7 +94,7 @@ public class SerializableJavaType<T extends Serializable> extends AbstractClassJ
return PrimitiveByteArrayJavaType.INSTANCE.extractHashCode( toBytes( value ) ); return PrimitiveByteArrayJavaType.INSTANCE.extractHashCode( toBytes( value ) );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(T value, Class<X> type, WrapperOptions options) { public <X> X unwrap(T value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;
@ -147,7 +147,7 @@ public class SerializableJavaType<T extends Serializable> extends AbstractClassJ
return SerializationHelper.serialize( value ); return SerializationHelper.serialize( value );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
protected T fromBytes(byte[] bytes) { protected T fromBytes(byte[] bytes) {
return (T) SerializationHelper.deserialize( bytes, getJavaTypeClass().getClassLoader() ); return (T) SerializationHelper.deserialize( bytes, getJavaTypeClass().getClassLoader() );
} }

View File

@ -49,7 +49,7 @@ public class ShortJavaType extends AbstractClassJavaType<Short>
} }
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(Short value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Short value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {

View File

@ -56,7 +56,7 @@ public class StringJavaType extends AbstractClassJavaType<String> {
return super.getRecommendedJdbcType( stdIndicators ); return super.getRecommendedJdbcType( stdIndicators );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(String value, Class<X> type, WrapperOptions options) { public <X> X unwrap(String value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -39,7 +39,7 @@ public class TimeZoneJavaType extends AbstractClassJavaType<TimeZone> {
return TimeZone.getTimeZone( string.toString() ); return TimeZone.getTimeZone( string.toString() );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(TimeZone value, Class<X> type, WrapperOptions options) { public <X> X unwrap(TimeZone value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -52,7 +52,7 @@ public class UUIDJavaType extends AbstractClassJavaType<UUID> {
return super.getDefaultSqlLength( dialect, jdbcType ); return super.getDefaultSqlLength( dialect, jdbcType );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(UUID value, Class<X> type, WrapperOptions options) { public <X> X unwrap(UUID value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -45,7 +45,7 @@ public class UrlJavaType extends AbstractClassJavaType<URL> {
} }
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(URL value, Class<X> type, WrapperOptions options) { public <X> X unwrap(URL value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -48,7 +48,7 @@ public class ZoneOffsetJavaType extends AbstractClassJavaType<ZoneOffset> {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(ZoneOffset value, Class<X> type, WrapperOptions wrapperOptions) { public <X> X unwrap(ZoneOffset value, Class<X> type, WrapperOptions wrapperOptions) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -57,7 +57,7 @@ public class UserTypeSqlTypeAdapter<J> implements JdbcType {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> ValueBinder<X> getBinder(JavaType<X> javaType) { public <X> ValueBinder<X> getBinder(JavaType<X> javaType) {
assert javaType.getJavaTypeClass() == null assert javaType.getJavaTypeClass() == null
|| jtd.getJavaTypeClass().isAssignableFrom( javaType.getJavaTypeClass() ); || jtd.getJavaTypeClass().isAssignableFrom( javaType.getJavaTypeClass() );
@ -65,7 +65,7 @@ public class UserTypeSqlTypeAdapter<J> implements JdbcType {
} }
@Override @Override
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> ValueExtractor<X> getExtractor(JavaType<X> javaType) { public <X> ValueExtractor<X> getExtractor(JavaType<X> javaType) {
assert javaType.getJavaTypeClass() == null assert javaType.getJavaTypeClass() == null
|| javaType.getJavaTypeClass().isAssignableFrom( jtd.getJavaTypeClass() ); || javaType.getJavaTypeClass().isAssignableFrom( jtd.getJavaTypeClass() );

View File

@ -46,7 +46,7 @@ public class IdClassGeneratedValueTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testBaseLine(SessionFactoryScope scope) { public void testBaseLine(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {
@ -69,7 +69,7 @@ public class IdClassGeneratedValueTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testBaseLine2(SessionFactoryScope scope) { public void testBaseLine2(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {
@ -89,7 +89,7 @@ public class IdClassGeneratedValueTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testSingleGeneratedValue(SessionFactoryScope scope) { public void testSingleGeneratedValue(SessionFactoryScope scope) {
Long s1Id1 = scope.fromTransaction( Long s1Id1 = scope.fromTransaction(
session -> { session -> {
@ -113,7 +113,7 @@ public class IdClassGeneratedValueTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testMultipleGeneratedValue(SessionFactoryScope scope) { public void testMultipleGeneratedValue(SessionFactoryScope scope) {
List<Long> m1Ids = scope.fromTransaction( List<Long> m1Ids = scope.fromTransaction(
session -> { session -> {

View File

@ -43,7 +43,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
) )
public class BatchFetchTest { public class BatchFetchTest {
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Test @Test
public void testBatchFetch(SessionFactoryScope scope) { public void testBatchFetch(SessionFactoryScope scope) {
ProductLine ossProductLine = new ProductLine(); ProductLine ossProductLine = new ProductLine();
@ -134,7 +134,7 @@ public class BatchFetchTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testBatchFetch2(SessionFactoryScope scope) { public void testBatchFetch2(SessionFactoryScope scope) {
int size = 32 + 14; int size = 32 + 14;
scope.inTransaction( scope.inTransaction(

View File

@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class AuctionTest { public class AuctionTest {
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testLazy(SessionFactoryScope scope) { public void testLazy(SessionFactoryScope scope) {
Auction auction = new Auction(); Auction auction = new Auction();
auction.setEnd( new Date() ); auction.setEnd( new Date() );

View File

@ -59,7 +59,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class PersistentMapTest { public class PersistentMapTest {
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testWriteMethodDirtying(SessionFactoryScope scope) { public void testWriteMethodDirtying(SessionFactoryScope scope) {
Parent parent = new Parent( "p1" ); Parent parent = new Parent( "p1" );
Child child = new Child( "c1" ); Child child = new Child( "c1" );

View File

@ -67,7 +67,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase {
void perform(TestData data); void perform(TestData data);
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
private void performWithStandardData(TestCode testCode) { private void performWithStandardData(TestCode testCode) {
final Department literatureDepartment = new Department( "lit", "Literature" ); final Department literatureDepartment = new Department( "lit", "Literature" );
final Student me = new Student( "Steve" ); final Student me = new Student( "Steve" );

View File

@ -715,7 +715,7 @@ public class BulkManipulationTest extends BaseCoreFunctionalTestCase {
s.close(); s.close();
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Test @Test
public void testUpdateWithWhereExistsSubquery() { public void testUpdateWithWhereExistsSubquery() {
// multi-table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // multi-table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -46,7 +46,7 @@ public class InetJavaType extends AbstractClassJavaType<Inet> {
return value.hashCode(); return value.hashCode();
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(Inet value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Inet value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -38,7 +38,7 @@ public class JsonJavaType extends AbstractClassJavaType<Json> {
return value.hashCode(); return value.hashCode();
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public <X> X unwrap(Json value, Class<X> type, WrapperOptions options) { public <X> X unwrap(Json value, Class<X> type, WrapperOptions options) {
if ( value == null ) { if ( value == null ) {
return null; return null;

View File

@ -40,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertSame;
public class MergeMultipleEntityCopiesAllowedTest { public class MergeMultipleEntityCopiesAllowedTest {
@AfterEach @AfterEach
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
void cleanup(EntityManagerFactoryScope scope) { void cleanup(EntityManagerFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
entityManager -> { entityManager -> {

View File

@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class MergeMultipleEntityCopiesDisallowedByDefaultTest { public class MergeMultipleEntityCopiesDisallowedByDefaultTest {
@AfterEach @AfterEach
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
void cleanup(EntityManagerFactoryScope scope) { void cleanup(EntityManagerFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
entityManager -> { entityManager -> {

View File

@ -104,7 +104,7 @@ public class MetadataTest {
} }
@Test @Test
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public void testBuildingMetamodelWithParameterizedCollection() { public void testBuildingMetamodelWithParameterizedCollection() {
Metadata metadata = new MetadataSources() Metadata metadata = new MetadataSources()
.addAnnotatedClass(WithGenericCollection.class) .addAnnotatedClass(WithGenericCollection.class)

View File

@ -121,7 +121,7 @@ public class MapIndexFormulaTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testSQLQuery(SessionFactoryScope scope) { public void testSQLQuery(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {

View File

@ -52,7 +52,7 @@ public class MapElementFormulaTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testManyToManyFormula(SessionFactoryScope scope) { public void testManyToManyFormula(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {

View File

@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.fail;
public class CreateTest extends AbstractOperationTestCase { public class CreateTest extends AbstractOperationTestCase {
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testNoUpdatesOnCreateVersionedWithCollection(SessionFactoryScope scope) { public void testNoUpdatesOnCreateVersionedWithCollection(SessionFactoryScope scope) {
clearCounts( scope ); clearCounts( scope );
@ -212,7 +212,7 @@ public class CreateTest extends AbstractOperationTestCase {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@SkipForDialect(dialectClass = AbstractHANADialect.class, reason = " HANA doesn't support tables consisting of only a single auto-generated column") @SkipForDialect(dialectClass = AbstractHANADialect.class, reason = " HANA doesn't support tables consisting of only a single auto-generated column")
public void testBasic(SessionFactoryScope scope) throws Exception { public void testBasic(SessionFactoryScope scope) throws Exception {
Employer er = new Employer(); Employer er = new Employer();

View File

@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test;
public class DeleteTest extends AbstractOperationTestCase { public class DeleteTest extends AbstractOperationTestCase {
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testDeleteVersionedWithCollectionNoUpdate(SessionFactoryScope scope) { public void testDeleteVersionedWithCollectionNoUpdate(SessionFactoryScope scope) {
// test adapted from HHH-1564... // test adapted from HHH-1564...
scope.inTransaction( scope.inTransaction(
@ -66,7 +66,7 @@ public class DeleteTest extends AbstractOperationTestCase {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testNoUpdateOnDeleteWithCollection(SessionFactoryScope scope) { public void testNoUpdateOnDeleteWithCollection(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {

View File

@ -466,7 +466,7 @@ public class MergeMultipleEntityCopiesAllowedOrphanDeleteTest {
cleanup( scope ); cleanup( scope );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
private void cleanup(SessionFactoryScope scope) { private void cleanup(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {

View File

@ -1162,7 +1162,7 @@ public class MergeMultipleEntityCopiesAllowedTest {
cleanup( scope ); cleanup( scope );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
private void cleanup(SessionFactoryScope scope) { private void cleanup(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {

View File

@ -164,7 +164,7 @@ public class MergeMultipleEntityCopiesCustomTest {
cleanup( scope ); cleanup( scope );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
private void cleanup(SessionFactoryScope scope) { private void cleanup(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {

View File

@ -116,7 +116,7 @@ public class MergeMultipleEntityCopiesDisallowedByDefaultTest {
cleanup( scope ); cleanup( scope );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
private void cleanup(SessionFactoryScope scope) { private void cleanup(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {

View File

@ -180,7 +180,7 @@ public class MergeTest extends AbstractOperationTestCase {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testNoExtraUpdatesOnMergeWithCollection(SessionFactoryScope scope) { public void testNoExtraUpdatesOnMergeWithCollection(SessionFactoryScope scope) {
Node parent = new Node( "parent" ); Node parent = new Node( "parent" );
scope.inTransaction( scope.inTransaction(
@ -259,7 +259,7 @@ public class MergeTest extends AbstractOperationTestCase {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testNoExtraUpdatesOnMergeVersionedWithCollection(SessionFactoryScope scope) { public void testNoExtraUpdatesOnMergeVersionedWithCollection(SessionFactoryScope scope) {
VersionedEntity parent = new VersionedEntity( "parent", "parent" ); VersionedEntity parent = new VersionedEntity( "parent", "parent" );
VersionedEntity child = new VersionedEntity( "child", "child" ); VersionedEntity child = new VersionedEntity( "child", "child" );
@ -730,7 +730,7 @@ public class MergeTest extends AbstractOperationTestCase {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@SkipForDialect(dialectClass = AbstractHANADialect.class, reason = " HANA doesn't support tables consisting of only a single auto-generated column") @SkipForDialect(dialectClass = AbstractHANADialect.class, reason = " HANA doesn't support tables consisting of only a single auto-generated column")
public void testRecursiveMergeTransient(SessionFactoryScope scope) { public void testRecursiveMergeTransient(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
@ -776,7 +776,7 @@ public class MergeTest extends AbstractOperationTestCase {
cleanup( scope ); cleanup( scope );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@Test @Test
@SkipForDialect(dialectClass = AbstractHANADialect.class, reason = " HANA doesn't support tables consisting of only a single auto-generated column") @SkipForDialect(dialectClass = AbstractHANADialect.class, reason = " HANA doesn't support tables consisting of only a single auto-generated column")
public void testMergeManyToManyWithCollectionDeference(SessionFactoryScope scope) { public void testMergeManyToManyWithCollectionDeference(SessionFactoryScope scope) {

View File

@ -43,7 +43,7 @@ public class OrderByTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrderBy(SessionFactoryScope scope) { public void testOrderBy(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(

View File

@ -41,7 +41,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrphanDeleteOnDelete(SessionFactoryScope scope) { public void testOrphanDeleteOnDelete(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {
@ -75,7 +75,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrphanDeleteAfterPersist(SessionFactoryScope scope) { public void testOrphanDeleteAfterPersist(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {
@ -105,7 +105,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrphanDeleteAfterPersistAndFlush(SessionFactoryScope scope) { public void testOrphanDeleteAfterPersistAndFlush(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {
@ -136,7 +136,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrphanDeleteAfterLock(SessionFactoryScope scope) { public void testOrphanDeleteAfterLock(SessionFactoryScope scope) {
Product prod = new Product(); Product prod = new Product();
Part part = new Part(); Part part = new Part();
@ -172,7 +172,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrphanDeleteOnSaveOrUpdate(SessionFactoryScope scope) { public void testOrphanDeleteOnSaveOrUpdate(SessionFactoryScope scope) {
Product prod = new Product(); Product prod = new Product();
Part part = new Part(); Part part = new Part();
@ -207,7 +207,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrphanDeleteOnSaveOrUpdateAfterSerialization(SessionFactoryScope scope) { public void testOrphanDeleteOnSaveOrUpdateAfterSerialization(SessionFactoryScope scope) {
Product prod = new Product(); Product prod = new Product();
Part part = new Part(); Part part = new Part();
@ -244,7 +244,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrphanDelete(SessionFactoryScope scope) { public void testOrphanDelete(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
session -> { session -> {
@ -285,7 +285,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrphanDeleteOnMerge(SessionFactoryScope scope) { public void testOrphanDeleteOnMerge(SessionFactoryScope scope) {
Product prod = new Product(); Product prod = new Product();
Part part = new Part(); Part part = new Part();
@ -321,7 +321,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testOrphanDeleteOnMergeRemoveElementMerge(SessionFactoryScope scope) { public void testOrphanDeleteOnMergeRemoveElementMerge(SessionFactoryScope scope) {
Product prod = new Product(); Product prod = new Product();
Part part = new Part(); Part part = new Part();
@ -352,7 +352,7 @@ public class OrphanTest {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
@TestForIssue(jiraKey = "HHH-9171") @TestForIssue(jiraKey = "HHH-9171")
public void testOrphanDeleteOnAddElementMergeRemoveElementMerge(SessionFactoryScope scope) { public void testOrphanDeleteOnAddElementMergeRemoveElementMerge(SessionFactoryScope scope) {
Product prod = new Product(); Product prod = new Product();

View File

@ -167,7 +167,7 @@ public class QueryParametersValidationArrayTest {
return null; return null;
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
@Override @Override
public <X> X unwrap(String[] value, Class<X> type, WrapperOptions options) { public <X> X unwrap(String[] value, Class<X> type, WrapperOptions options) {
return (X) value; return (X) value;

View File

@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class DiscrimSubclassFilterTest { public class DiscrimSubclassFilterTest {
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testFiltersWithSubclass(SessionFactoryScope scope) { public void testFiltersWithSubclass(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
s -> { s -> {
@ -92,7 +92,7 @@ public class DiscrimSubclassFilterTest {
); );
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
private void prepareTestData(Session s) { private void prepareTestData(Session s) {
Employee john = new Employee( "John Doe" ); Employee john = new Employee( "John Doe" );
john.setCompany( "JBoss" ); john.setCompany( "JBoss" );

View File

@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class UnionSubclassFilterTest { public class UnionSubclassFilterTest {
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testFiltersWithUnionSubclass(SessionFactoryScope scope) { public void testFiltersWithUnionSubclass(SessionFactoryScope scope) {
scope.inTransaction( scope.inTransaction(
@ -93,7 +93,7 @@ public class UnionSubclassFilterTest {
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
private void prepareTestData(Session s) { private void prepareTestData(Session s) {
Employee john = new Employee( "John Doe" ); Employee john = new Employee( "John Doe" );
john.setCompany( "JBoss" ); john.setCompany( "JBoss" );

View File

@ -36,7 +36,7 @@ public class SubselectTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public void testEntitySubselect() { public void testEntitySubselect() {
inTransaction( inTransaction(
s -> { s -> {

View File

@ -37,7 +37,7 @@ public class PreparedStatementProxy<T> implements InvocationHandler {
return cl; return cl;
} }
@SuppressWarnings({ "unchecked" }) @SuppressWarnings("unchecked")
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if ( value == null ) { if ( value == null ) {
assertEquals( "setNull", method.getName(), "Expecting setNull call" ); assertEquals( "setNull", method.getName(), "Expecting setNull call" );

View File

@ -59,7 +59,7 @@ public class TestConsole {
} }
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
private void printPersons(StringBuilder sb) { private void printPersons(StringBuilder sb) {
List<Person> persons = entityManager.createQuery( List<Person> persons = entityManager.createQuery(
"select p from Person p order by p.id").getResultList(); "select p from Person p order by p.id").getResultList();
@ -196,7 +196,7 @@ public class TestConsole {
sb.append(")"); sb.append(")");
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
private void printAddresses(StringBuilder sb) { private void printAddresses(StringBuilder sb) {
List<Address> addresses = entityManager.createQuery( List<Address> addresses = entityManager.createQuery(
"select a from Address a order by a.id").getResultList(); "select a from Address a order by a.id").getResultList();

View File

@ -143,7 +143,7 @@ public final class AuditMetadataGenerator extends AbstractMetadataGenerator {
return true; return true;
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
private void createJoins(PersistentClass persistentClass, JoinAwarePersistentEntity entity, ClassAuditingData auditingData) { private void createJoins(PersistentClass persistentClass, JoinAwarePersistentEntity entity, ClassAuditingData auditingData) {
final Iterator<org.hibernate.mapping.Join> joins = persistentClass.getJoinIterator(); final Iterator<org.hibernate.mapping.Join> joins = persistentClass.getJoinIterator();
final Map<org.hibernate.mapping.Join, Join> joinElements = new HashMap<>(); final Map<org.hibernate.mapping.Join, Join> joinElements = new HashMap<>();
@ -190,7 +190,7 @@ public final class AuditMetadataGenerator extends AbstractMetadataGenerator {
} }
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
private void addJoins( private void addJoins(
PersistentClass persistentClass, PersistentClass persistentClass,
CompositeMapperBuilder currentMapper, CompositeMapperBuilder currentMapper,

View File

@ -36,7 +36,7 @@ public final class ComponentMetadataGenerator extends AbstractMetadataGenerator
this.valueGenerator = valueGenerator; this.valueGenerator = valueGenerator;
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public void addComponent( public void addComponent(
AttributeContainer attributeContainer, AttributeContainer attributeContainer,
PropertyAuditingData propertyAuditingData, PropertyAuditingData propertyAuditingData,

View File

@ -100,7 +100,7 @@ public class EntityInstantiator {
return ret; return ret;
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
private void replaceNonAuditIdProxies(Map versionsEntity, Number revision) { private void replaceNonAuditIdProxies(Map versionsEntity, Number revision) {
final Map originalId = (Map) versionsEntity.get( enversService.getConfig().getOriginalIdPropertyName() ); final Map originalId = (Map) versionsEntity.get( enversService.getConfig().getOriginalIdPropertyName() );
for ( Object key : originalId.keySet() ) { for ( Object key : originalId.keySet() ) {
@ -141,7 +141,7 @@ public class EntityInstantiator {
} }
} }
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public void addInstancesFromVersionsEntities( public void addInstancesFromVersionsEntities(
String entityName, String entityName,
Collection addTo, Collection addTo,

View File

@ -130,7 +130,7 @@ public abstract class AbstractCollectionMapper<T> extends AbstractPropertyMapper
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public List<PersistentCollectionChangeData> mapCollectionChanges( public List<PersistentCollectionChangeData> mapCollectionChanges(
SessionImplementor session, SessionImplementor session,
String referencingPropertyName, String referencingPropertyName,

View File

@ -69,7 +69,7 @@ public final class ListCollectionMapper extends AbstractCollectionMapper<List> i
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
protected Collection getNewCollectionContent(PersistentCollection newCollection) { protected Collection getNewCollectionContent(PersistentCollection newCollection) {
if ( newCollection == null ) { if ( newCollection == null ) {
return null; return null;
@ -80,7 +80,7 @@ public final class ListCollectionMapper extends AbstractCollectionMapper<List> i
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
protected Collection getOldCollectionContent(Serializable oldCollection) { protected Collection getOldCollectionContent(Serializable oldCollection) {
if ( oldCollection == null ) { if ( oldCollection == null ) {
return null; return null;
@ -91,7 +91,7 @@ public final class ListCollectionMapper extends AbstractCollectionMapper<List> i
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
protected void mapToMapFromObject( protected void mapToMapFromObject(
SessionImplementor session, SessionImplementor session,
Map<String, Object> idData, Map<String, Object> idData,

View File

@ -36,7 +36,7 @@ public class MiddleMapElementNotKeyComponentMapper extends AbstractMiddleCompone
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public Object mapToObjectFromFullMap( public Object mapToObjectFromFullMap(
EntityInstantiator entityInstantiator, EntityInstantiator entityInstantiator,
Map<String, Object> data, Map<String, Object> data,

View File

@ -27,7 +27,7 @@ public final class MiddleSimpleComponentMapper extends AbstractMiddleComponentMa
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public Object mapToObjectFromFullMap( public Object mapToObjectFromFullMap(
EntityInstantiator entityInstantiator, Map<String, Object> data, EntityInstantiator entityInstantiator, Map<String, Object> data,
Object dataObject, Number revision) { Object dataObject, Number revision) {

View File

@ -26,7 +26,7 @@ public final class MiddleStraightComponentMapper extends AbstractMiddleComponent
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
public Object mapToObjectFromFullMap( public Object mapToObjectFromFullMap(
EntityInstantiator entityInstantiator, Map<String, Object> data, EntityInstantiator entityInstantiator, Map<String, Object> data,
Object dataObject, Number revision) { Object dataObject, Number revision) {

View File

@ -42,7 +42,7 @@ public class ArrayCollectionInitializor extends AbstractCollectionInitializor<Ob
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
protected void addToCollection(Object[] collection, Object collectionRow) { protected void addToCollection(Object[] collection, Object collectionRow) {
final Object elementData = ( (List) collectionRow ).get( elementComponentData.getComponentIndex() ); final Object elementData = ( (List) collectionRow ).get( elementComponentData.getComponentIndex() );
final Object element = elementComponentData.getComponentMapper().mapToObjectFromFullMap( final Object element = elementComponentData.getComponentMapper().mapToObjectFromFullMap(

View File

@ -44,7 +44,7 @@ public class BasicCollectionInitializor<T extends Collection> extends AbstractCo
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
protected void addToCollection(T collection, Object collectionRow) { protected void addToCollection(T collection, Object collectionRow) {
// collectionRow will be the actual object if retrieved from audit relation or middle table // collectionRow will be the actual object if retrieved from audit relation or middle table
// otherwise it will be a List // otherwise it will be a List

View File

@ -41,7 +41,7 @@ public class ListCollectionInitializor extends AbstractCollectionInitializor<Lis
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
protected List initializeCollection(int size) { protected List initializeCollection(int size) {
// There are two types of List collections that this class may generate // There are two types of List collections that this class may generate
// //
@ -61,7 +61,7 @@ public class ListCollectionInitializor extends AbstractCollectionInitializor<Lis
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
protected void addToCollection(List collection, Object collectionRow) { protected void addToCollection(List collection, Object collectionRow) {
// collectionRow will be the actual object if retrieved from audit relation or middle table // collectionRow will be the actual object if retrieved from audit relation or middle table
// otherwise it will be a List // otherwise it will be a List

View File

@ -46,7 +46,7 @@ public class MapCollectionInitializor<T extends Map> extends AbstractCollectionI
} }
@Override @Override
@SuppressWarnings({"unchecked"}) @SuppressWarnings("unchecked")
protected void addToCollection(T collection, Object collectionRow) { protected void addToCollection(T collection, Object collectionRow) {
// collectionRow will be the actual object if retrieved from audit relation or middle table // collectionRow will be the actual object if retrieved from audit relation or middle table
// otherwise it will be a List // otherwise it will be a List

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