Skip to content

Commit

Permalink
don't write @SuppressWarnings({ "unchecked" })
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Feb 5, 2022
1 parent 4b1cd56 commit a25758f
Show file tree
Hide file tree
Showing 135 changed files with 209 additions and 209 deletions.
Expand Up @@ -66,7 +66,7 @@ protected void tearDown() throws Exception {
}
}

@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public void testBasicUsage() {
// create a couple of events...
Session session = sessionFactory.openSession();
Expand Down
Expand Up @@ -48,7 +48,7 @@ public BitSet fromString(CharSequence string) {
return BitSetHelper.stringToBitSet(string.toString());
}

@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public <X> X unwrap(BitSet value, Class<X> type, WrapperOptions options) {
if (value == null) {
return null;
Expand Down
Expand Up @@ -92,7 +92,7 @@ public boolean isUnwrappableAs(Class<?> unwrapType) {
}

@Override
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> unwrapType) {
if ( ConnectionProvider.class.equals( unwrapType ) ||
C3P0ConnectionProvider.class.isAssignableFrom( unwrapType ) ) {
Expand Down
Expand Up @@ -160,7 +160,7 @@ public boolean isEmpty() {
return dependenciesByAction.isEmpty();
}

@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
private void addDependenciesByTransientEntity(AbstractEntityInsertAction insert, NonNullableTransientDependencies dependencies) {
for ( Object transientEntity : dependencies.getNonNullableTransientEntities() ) {
Set<AbstractEntityInsertAction> dependentActions = dependentActionsByTransientEntity.get( transientEntity );
Expand All @@ -182,7 +182,7 @@ private void addDependenciesByTransientEntity(AbstractEntityInsertAction insert,
*
* @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) {
final EntityEntry entityEntry = session.getPersistenceContextInternal().getEntry( managedEntity );
if ( entityEntry.getStatus() != Status.MANAGED && entityEntry.getStatus() != Status.READ_ONLY ) {
Expand Down
Expand Up @@ -1344,7 +1344,7 @@ public void addUniquePropertyReference(String referencedClass, String propertyNa
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public void addUniqueConstraints(Table table, List uniqueConstraints) {
List<UniqueConstraintHolder> constraintHolders = new ArrayList<>( uniqueConstraints.size() );

Expand Down
Expand Up @@ -28,7 +28,7 @@ public class ValueConverterTypeAdapter<J> extends AbstractSingleColumnStandardBa

private final ValueBinder<Object> valueBinder;

@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public ValueConverterTypeAdapter(
String description,
BasicValueConverter<J, ?> converter,
Expand Down
Expand Up @@ -99,7 +99,7 @@ public AggregatedClassLoader run() {
* @deprecated No longer used/supported!
*/
@Deprecated
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public static ClassLoaderServiceImpl fromConfigSettings(Map configValues) {
final List<ClassLoader> providedClassLoaders = new ArrayList<>();

Expand All @@ -112,7 +112,7 @@ public static ClassLoaderServiceImpl fromConfigSettings(Map configValues) {
}

@Override
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public <T> Class<T> classForName(String className) {
try {
return (Class<T>) Class.forName( className, true, getAggregatedClassLoader() );
Expand Down
Expand Up @@ -54,7 +54,7 @@ public boolean isUnwrappableAs(Class<?> unwrapType) {
}

@Override
@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> unwrapType) {
if ( MultiTenantConnectionProvider.class.isAssignableFrom( unwrapType ) ) {
return (T) this;
Expand Down
Expand Up @@ -318,7 +318,7 @@ public boolean isReadyForSerialization() {
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public void registerLastQuery(Statement statement) {
LOG.tracev( "Registering last query statement [{0}]", statement );
if ( statement instanceof JdbcWrapper ) {
Expand Down Expand Up @@ -359,7 +359,7 @@ public void disableReleases() {
releasesEnabled = false;
}

@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
protected void close(Statement statement) {
LOG.tracev( "Closing prepared statement [{0}]", statement );

Expand Down Expand Up @@ -408,7 +408,7 @@ protected void close(ResultSet resultSet) {
LOG.tracev( "Closing result set [{0}]", resultSet );

if ( resultSet instanceof InvalidatableWrapper ) {
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
final InvalidatableWrapper<ResultSet> wrapper = (InvalidatableWrapper<ResultSet>) resultSet;
close( wrapper.getWrappedObject() );
wrapper.invalidate();
Expand Down
Expand Up @@ -97,7 +97,7 @@ private EventListenerRegistryImpl(EventListenerGroup[] eventListeners) {
this.eventListeners = eventListeners;
}

@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public <T> EventListenerGroup<T> getEventListenerGroup(EventType<T> eventType) {
if ( eventListeners.length < eventType.ordinal() + 1 ) {
// eventTpe is a custom EventType that has not been registered.
Expand Down
Expand Up @@ -179,7 +179,7 @@ public static int[] join(int[] x, int[] y) {
return result;
}

@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public static <T> T[] join(T[] x, T... y) {
T[] result = (T[]) Array.newInstance( x.getClass().getComponentType(), x.length + y.length );
System.arraycopy( x, 0, result, 0, x.length );
Expand Down
Expand Up @@ -87,7 +87,7 @@ public boolean isEmpty() {
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public boolean containsKey(Object key) {
return map.containsKey( new IdentityKey( key ) );
}
Expand Down
Expand Up @@ -19,7 +19,7 @@ private RowVersionComparator() {
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public int compare(byte[] o1, byte[] o2) {
final int lengthToCheck = Math.min( o1.length, o2.length );

Expand Down
Expand Up @@ -261,7 +261,7 @@ public static long getLong(String name, Map values, int defaultValue) {
*
* @return The clone
*/
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public static Map clone(Map<?,?> configurationValues) {
if ( configurationValues == null ) {
return null;
Expand Down
Expand Up @@ -147,7 +147,7 @@ public void setJpaAttributeConverterDescriptor(ConverterDescriptor descriptor) {
super.setJpaAttributeConverterDescriptor( descriptor );
}

@SuppressWarnings({"rawtypes"})
@SuppressWarnings("rawtypes")
public void setExplicitJavaTypeAccess(Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess) {
this.explicitJavaTypeAccess = explicitJavaTypeAccess;
}
Expand Down
Expand Up @@ -94,7 +94,7 @@ public <X, Y> PersistentAttribute<X, Y> buildAttribute(ManagedDomainType<X> owne
return buildAttribute( ownerType, property, context );
}

@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public static <X, Y> PersistentAttribute<X, Y> buildAttribute(
ManagedDomainType<X> ownerType,
Property property,
Expand Down
Expand Up @@ -108,7 +108,7 @@ public IdentifiableDomainType<? super J> getSupertype() {
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public <Y> SingularPersistentAttribute<? super J, Y> getId(Class<Y> javaType) {
ensureNoIdClass();
SingularPersistentAttribute<J, ?> id = findIdAttribute();
Expand Down Expand Up @@ -163,7 +163,7 @@ private void checkType(SingularPersistentAttribute<?, ?> attribute, Class<?> jav
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public <Y> SingularPersistentAttribute<J, Y> getDeclaredId(Class<Y> javaType) {
ensureNoIdClass();
if ( id == null ) {
Expand Down Expand Up @@ -287,7 +287,7 @@ public <Y> SingularPersistentAttribute<? super J, Y> getVersion(Class<Y> javaTyp
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public <Y> SingularPersistentAttribute<J, Y> getDeclaredVersion(Class<Y> javaType) {
checkDeclaredVersion();
checkType( versionAttribute, javaType );
Expand Down
Expand Up @@ -259,7 +259,7 @@ public String getTypeName() {
// Singular attributes

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public Set<SingularAttribute<? super J, ?>> getSingularAttributes() {
HashSet attributes = new HashSet<>( declaredSingularAttributes.values() );
if ( getSuperType() != null ) {
Expand Down Expand Up @@ -292,7 +292,7 @@ public String getTypeName() {
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public <Y> SingularPersistentAttribute<? super J, Y> getSingularAttribute(String name, Class<Y> type) {
SingularAttribute attribute = findSingularAttribute( name );
checkTypeForSingleAttribute( attribute, name, type );
Expand Down Expand Up @@ -462,7 +462,7 @@ private void basicCollectionCheck(PluralAttribute<? super J, ?, ?> attribute, St
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public <E> BagPersistentAttribute<? super J, E> getCollection(String name, Class<E> elementType) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
checkCollectionElementType( attribute, name, elementType );
Expand All @@ -486,7 +486,7 @@ public <E> CollectionAttribute<J, E> getDeclaredCollection(String name, Class<E>
// Set attributes

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public SetPersistentAttribute<? super J, ?> getSet(String name) {
final PluralAttribute attribute = findPluralAttribute( name );
basicSetCheck( attribute, name );
Expand All @@ -509,7 +509,7 @@ private void basicSetCheck(PluralAttribute<? super J, ?, ?> attribute, String na
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public <E> SetAttribute<? super J, E> getSet(String name, Class<E> elementType) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
checkSetElementType( attribute, name, elementType );
Expand All @@ -533,7 +533,7 @@ public <E> SetAttribute<J, E> getDeclaredSet(String name, Class<E> elementType)
// List attributes

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public ListPersistentAttribute<? super J, ?> getList(String name) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
basicListCheck( attribute, name );
Expand All @@ -556,7 +556,7 @@ private void basicListCheck(PluralAttribute<? super J, ?, ?> attribute, String n
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public <E> ListAttribute<? super J, E> getList(String name, Class<E> elementType) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
checkListElementType( attribute, name, elementType );
Expand All @@ -580,7 +580,7 @@ public <E> ListAttribute<J, E> getDeclaredList(String name, Class<E> elementType
// Map attributes

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public MapPersistentAttribute<? super J, ?, ?> getMap(String name) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
basicMapCheck( attribute, name );
Expand All @@ -603,7 +603,7 @@ private void basicMapCheck(PluralAttribute<? super J, ?, ?> attribute, String na
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public <K, V> MapAttribute<? super J, K, V> getMap(String name, Class<K> keyType, Class<V> valueType) {
PluralAttribute<? super J, ?, ?> attribute = findPluralAttribute( name );
checkMapValueType( attribute, name, valueType );
Expand Down
Expand Up @@ -42,7 +42,7 @@ public ByteBuddyProxyHelper(ByteBuddyState byteBuddyState) {
this.byteBuddyState = byteBuddyState;
}

@SuppressWarnings({ "rawtypes" })
@SuppressWarnings("rawtypes")
public Class buildProxy(
final Class<?> persistentClass,
final Class<?>[] interfaces) {
Expand Down
Expand Up @@ -806,7 +806,7 @@ public SqmExpression<Number> quot(Expression<? extends Number> x, Number y) {
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
public SqmExpression<Number> quot(Number x, Expression<? extends Number> y) {
return createSqmArithmeticNode(
BinaryArithmeticOperator.QUOT,
Expand Down Expand Up @@ -1669,7 +1669,7 @@ public <Y extends Comparable<? super Y>> SqmPredicate between(Expression<? exten
}

@Override
@SuppressWarnings({ "unchecked" })
@SuppressWarnings("unchecked")
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;
return new SqmBetweenPredicate(
Expand Down
Expand Up @@ -159,7 +159,7 @@ private static void releaseXref(final Statement s, final HashMap<ResultSet, Obje
close( s );
}

@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
private static void close(final ResultSet resultSet) {
log.tracef( "Closing result set [%s]", resultSet );

Expand All @@ -175,7 +175,7 @@ private static void close(final ResultSet resultSet) {
}
}

@SuppressWarnings({"unchecked"})
@SuppressWarnings("unchecked")
public static void close(Statement statement) {
log.tracef( "Closing prepared statement [%s]", statement );

Expand Down

0 comments on commit a25758f

Please sign in to comment.