Skip to content

Commit 52a9de7

Browse files
committed
more @SuppressWarnings cleanups
Signed-off-by: Gavin King <[email protected]>
1 parent 5748376 commit 52a9de7

File tree

8 files changed

+12
-17
lines changed

8 files changed

+12
-17
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/cuk/CompositePropertyRefTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
public class CompositePropertyRefTest {
4242

4343
@Test
44-
@SuppressWarnings({ "unchecked", "UnusedAssignment" })
44+
@SuppressWarnings({ "unchecked", "unused" })
4545
public void testOneToOnePropertyRef(SessionFactoryScope scope) {
4646
scope.inTransaction(
4747
session -> {

hibernate-core/src/test/java/org/hibernate/orm/test/hql/ASTParserLoadingTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,7 +2878,6 @@ public void testExtract() {
28782878

28792879
@Test
28802880
@SkipForDialect(value = CockroachDialect.class, comment = "https://github.com/cockroachdb/cockroach/issues/41943")
2881-
@SuppressWarnings( {"UnusedAssignment", "UnusedDeclaration"})
28822881
public void testSelectExpressions() {
28832882
createTestBaseData();
28842883
Session session = openSession();
@@ -3417,7 +3416,7 @@ public void testDynamicInstantiationWithToOneQueries() throws Exception {
34173416
}
34183417

34193418
@Test
3420-
@SuppressWarnings( {"UnusedAssignment"})
3419+
@SuppressWarnings("unused")
34213420
public void testCachedJoinedAndJoinFetchedManyToOne() throws Exception {
34223421
Animal a = new Animal();
34233422
a.setDescription( "an animal" );
@@ -3469,7 +3468,6 @@ public void testCachedJoinedAndJoinFetchedManyToOne() throws Exception {
34693468
}
34703469

34713470
@Test
3472-
@SuppressWarnings( {"UnusedAssignment", "UnusedDeclaration"})
34733471
public void testCachedJoinedAndJoinFetchedOneToMany() throws Exception {
34743472
Animal a = new Animal();
34753473
a.setDescription( "an animal" );

hibernate-core/src/test/java/org/hibernate/orm/test/mapping/MappedSuperclassWithGenericsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static abstract class IntermediateAbstractMapped<T> extends AbstractGener
9999
private String keyThree;
100100
}
101101

102-
@SuppressWarnings( "UnusedDeclaration" )
102+
@SuppressWarnings("unused")
103103
public static class PK implements Serializable {
104104
private String keyOne;
105105
private String keyTwo;

hibernate-core/src/test/java/org/hibernate/orm/test/nationalized/SimpleNationalizedTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
@BaseUnitTest
4545
public class SimpleNationalizedTest {
4646

47-
@SuppressWarnings({ "UnusedDeclaration", "SpellCheckingInspection" })
47+
@SuppressWarnings("unused")
4848
@Entity(name = "NationalizedEntity")
4949
public static class NationalizedEntity {
5050
@Id

hibernate-core/src/test/java/org/hibernate/orm/test/onetomany/OneToManyTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
@SessionFactory
2626
public class OneToManyTest {
2727

28-
@SuppressWarnings({ "unchecked", "UnusedAssignment" })
28+
@SuppressWarnings("unchecked")
2929
@Test
3030
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsTemporaryTable.class)
3131
public void testOneToManyLinkTable(SessionFactoryScope scope) {
@@ -49,6 +49,7 @@ public void testOneToManyLinkTable(SessionFactoryScope scope) {
4949
}
5050
);
5151

52+
@SuppressWarnings("unused")
5253
Child merged = scope.fromTransaction(
5354
session -> {
5455
c.setParent( null );
@@ -67,6 +68,7 @@ public void testOneToManyLinkTable(SessionFactoryScope scope) {
6768

6869
scope.inTransaction(
6970
session -> {
71+
@SuppressWarnings("unused")
7072
Child child = (Child) session.createQuery( "from Child" ).uniqueResult();
7173
session.createQuery( "from Child c left join fetch c.parent" ).list();
7274
session.createQuery( "from Child c inner join fetch c.parent" ).list();

hibernate-core/src/test/java/org/hibernate/orm/test/ops/MergeTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public void testNoExtraUpdatesOnMergeVersionedWithCollection(SessionFactoryScope
310310
}
311311

312312
@Test
313-
@SuppressWarnings({ "unchecked", "UnusedAssignment", "UnusedDeclaration" })
313+
@SuppressWarnings({"unchecked", "unused"})
314314
public void testNoExtraUpdatesOnPersistentMergeVersionedWithCollection(SessionFactoryScope scope) {
315315
VersionedEntity parent = new VersionedEntity( "parent", "parent" );
316316
VersionedEntity child = new VersionedEntity( "child", "child" );
@@ -337,7 +337,7 @@ public void testNoExtraUpdatesOnPersistentMergeVersionedWithCollection(SessionFa
337337
VersionedEntity persistentChild = (VersionedEntity) persistentParent.getChildren()
338338
.iterator()
339339
.next();
340-
return (VersionedEntity) session.merge( persistentParent ); // <-- This merge leads to failure
340+
return session.merge( persistentParent ); // <-- This merge leads to failure
341341
}
342342
);
343343

hibernate-core/src/test/java/org/hibernate/orm/test/sql/hand/query/NativeSQLQueriesTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.hibernate.QueryException;
2525
import org.hibernate.Transaction;
2626
import org.hibernate.cfg.Environment;
27-
import org.hibernate.dialect.HANADialect;
2827
import org.hibernate.dialect.H2Dialect;
2928
import org.hibernate.dialect.MySQLDialect;
3029
import org.hibernate.orm.test.sql.hand.Dimension;
@@ -79,6 +78,7 @@
7978
xmlMappings = { "org/hibernate/orm/test/sql/hand/query/NativeSQLQueries.hbm.xml" }
8079
)
8180
@SessionFactory
81+
@SuppressWarnings({"deprecation", "unused", "rawtypes", "unchecked"})
8282
public class NativeSQLQueriesTest {
8383

8484
protected String getOrganizationFetchJoinEmploymentSQL() {
@@ -384,7 +384,6 @@ public void testScalarValues(SessionFactoryScope scope) throws Exception {
384384
}
385385

386386
@Test
387-
@SuppressWarnings( {"deprecation", "UnusedDeclaration"})
388387
public void testMappedAliasStrategy(SessionFactoryScope scope) {
389388
Organization ifa = new Organization("IFA");
390389
Organization jboss = new Organization("JBoss");
@@ -466,7 +465,6 @@ public void testMappedAliasStrategy(SessionFactoryScope scope) {
466465
}
467466

468467
@Test
469-
@SuppressWarnings( {"unchecked"})
470468
@FailureExpected( jiraKey = "unknown" )
471469
public void testCompositeIdJoins(SessionFactoryScope scope) {
472470
scope.inTransaction(
@@ -535,7 +533,6 @@ public void testCompositeIdJoins(SessionFactoryScope scope) {
535533
}
536534

537535
@Test
538-
@SuppressWarnings( {"UnusedDeclaration", "deprecation", "UnusedAssignment"})
539536
public void testAutoDetectAliasing(SessionFactoryScope scope) {
540537
Organization ifa = new Organization("IFA");
541538
Organization jboss = new Organization("JBoss");
@@ -676,7 +673,6 @@ public void testAutoDetectAliasing(SessionFactoryScope scope) {
676673
}
677674

678675
@Test
679-
@SuppressWarnings("unused")
680676
public void testExplicitReturnAPI(SessionFactoryScope scope) {
681677
Organization jboss = new Organization( "JBoss" );
682678
Person me = new Person( "Steve" );
@@ -787,7 +783,6 @@ else if ( value instanceof BigDecimal ) {
787783
}
788784

789785
@Test
790-
@SuppressWarnings( {"unchecked", "UnusedDeclaration"})
791786
public void testAddJoinForManyToMany(SessionFactoryScope scope) {
792787
Person gavin = new Person( "Gavin" );
793788
Person max = new Person( "Max" );
@@ -813,7 +808,7 @@ public void testAddJoinForManyToMany(SessionFactoryScope scope) {
813808
session.flush();
814809
session.clear();
815810

816-
// todo : see http://opensource.atlassian.com/projects/hibernate/browse/HHH-3908
811+
// todo : see HHH-3908
817812
// String sqlStr = "SELECT {groupp.*} , {gp.*} " +
818813
// "FROM GROUPP groupp, GROUP_PERSON gp, PERSON person WHERE groupp.ID = gp.GROUP_ID and person.PERID = gp.PERSON_ID";
819814
//

hibernate-core/src/test/java/org/hibernate/orm/test/stats/StatsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
public class StatsTest {
3737

3838
// @Test
39-
// @SuppressWarnings( {"UnusedAssignment"})
39+
// @SuppressWarnings("unused")
4040
// public void testCollectionFetchVsLoad() throws Exception {
4141
// SessionFactory sf = buildBaseConfiguration()
4242
// .setProperty( AvailableSettings.HBM2DDL_AUTO, "create-drop" )

0 commit comments

Comments
 (0)