@SuppressWarnings({"UnusedDeclaration"}) -> @SuppressWarnings("unused")

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-09-05 08:28:33 +02:00
parent 9cf4bd8251
commit 0dd2defc89
42 changed files with 74 additions and 75 deletions

View File

@ -266,7 +266,7 @@ public class C3P0ConnectionProvider
*
* @deprecated Use {@link #stop} instead
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
@Deprecated
public void close() {
stop();

View File

@ -71,7 +71,6 @@ public enum ReplicationMode {
/**
* Determine whether the mode dictates that the data being replicated should overwrite the data found.
*
* @param entity The entity being replicated
* @param currentVersion The version currently on the target database table.
* @param newVersion The replicating version
* @param versionType The version type

View File

@ -41,7 +41,7 @@ public abstract class AbstractArchiveDescriptor implements ArchiveDescriptor {
return entryBasePrefix.startsWith( "/" ) ? entryBasePrefix.substring( 1 ) : entryBasePrefix;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
protected ArchiveDescriptorFactory getArchiveDescriptorFactory() {
return archiveDescriptorFactory;
}

View File

@ -68,7 +68,7 @@ class TypeSafeActivator {
*
* @param object The supplied ValidatorFactory instance.
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static void validateSuppliedFactory(Object object) {
if ( !(object instanceof ValidatorFactory) ) {
throw new IntegrationException(
@ -78,7 +78,7 @@ class TypeSafeActivator {
}
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static void activate(ActivationContext activationContext) {
final ValidatorFactory factory;
try {

View File

@ -64,17 +64,17 @@ public class NaturalIdCacheKey implements Serializable {
return from( naturalIdValues, persister, persister.getRootEntityName(), session );
}
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public String getEntityName() {
return entityName;
}
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public String getTenantId() {
return tenantId;
}
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public Object getNaturalIdValues() {
return naturalIdValues;
}

View File

@ -125,7 +125,7 @@ public class PersistentArrayHolder<E> extends AbstractPersistentCollection<E> {
attributeMapping.getPropertyAccess().getSetter().set( getOwner(), array );
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public Object getArray() {
return array;
}

View File

@ -49,7 +49,7 @@ public class PersistentBag<E> extends AbstractPersistentCollection<E> implements
/**
* Constructs a PersistentBag. Needed for SOAP libraries, etc
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public PersistentBag() {
}
@ -497,7 +497,7 @@ public class PersistentBag<E> extends AbstractPersistentCollection<E> implements
*
* @return The number of occurrences.
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public int occurrences(Object o) {
read();
final Iterator<E> itr = bag.iterator();

View File

@ -54,7 +54,7 @@ public class PersistentIdentifierBag<E> extends AbstractPersistentCollection<E>
/**
* Constructs a PersistentIdentifierBag. This form needed for SOAP libraries, etc
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public PersistentIdentifierBag() {
}

View File

@ -36,7 +36,7 @@ public class PersistentSortedMap<K,E> extends PersistentMap<K,E> implements Sort
/**
* Constructs a PersistentSortedMap. This form needed for SOAP libraries, etc
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public PersistentSortedMap() {
}

View File

@ -33,7 +33,7 @@ public class PersistentSortedSet<E> extends PersistentSet<E> implements SortedSe
/**
* Constructs a PersistentSortedSet. This form needed for SOAP libraries, etc
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public PersistentSortedSet() {
}

View File

@ -39,6 +39,6 @@ public interface ColumnAliasExtractor {
/**
* An extractor which uses {@link ResultSetMetaData#getColumnName}
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
ColumnAliasExtractor COLUMN_NAME_EXTRACTOR = ResultSetMetaData::getColumnName;
}

View File

@ -58,7 +58,7 @@ public class DatasourceConnectionProviderImpl implements ConnectionProvider, Con
}
@InjectService( required = false )
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setJndiService(JndiService jndiService) {
this.jndiService = jndiService;
}

View File

@ -176,7 +176,7 @@ public final class JtaStatusHelper {
*
* @return True if the code indicates a roll back; false otherwise.
*/
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public static boolean isMarkedForRollback(int status) {
return status == Status.STATUS_MARKED_ROLLBACK;
}

View File

@ -31,12 +31,12 @@ public class BaselineSessionEventsListenerBuilder {
this.autoListener = autoListener;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public boolean isLogSessionMetrics() {
return logSessionMetrics;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public Class<? extends SessionEventListener> getAutoListener() {
return autoListener;
}

View File

@ -15,7 +15,7 @@ import org.hibernate.metamodel.CollectionClassification;
* @param <C> The attribute type (the collection type)
* @param <E> The collection element type
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public interface PluralAttributeMetadata<O, C, E> extends AttributeMetadata<O, C> {
/**
* The classification of the collection, indicating the collection semantics

View File

@ -332,7 +332,7 @@ public abstract class AbstractQuery<R>
// JPA hint handling
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public Set<String> getSupportedHints() {
return AvailableHints.getDefinedHints();
}

View File

@ -141,7 +141,7 @@ public class PatternRenderer {
* @param sqlAppender Target for appending
* @param args The arguments to inject into the template
*/
@SuppressWarnings({ "UnusedDeclaration" })
@SuppressWarnings("unused")
public void render(
SqlAppender sqlAppender,
List<? extends SqlAstNode> args,

View File

@ -227,7 +227,7 @@ public class ByteCodeEnhancedImmutableReferenceCacheTest extends BaseCoreFunctio
@Immutable
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static class MyEnhancedReferenceData implements ManagedEntity {
@Id
private Integer id;

View File

@ -89,7 +89,7 @@ public class ReferenceCacheTest extends BaseCoreFunctionalTestCase {
@Immutable
@Cacheable
@Cache( usage = CacheConcurrencyStrategy.READ_ONLY )
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static class MyReferenceData {
@Id
private Integer id;

View File

@ -73,7 +73,7 @@ public class CascadeToComponentCollectionTest extends BaseCoreFunctionalTestCase
session.close();
}
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
@Test
public void testMergingOriginallyNullComponent() {
// step1, we create a definition with one value, but with a null component

View File

@ -41,13 +41,13 @@ public class SuppliedConnectionTest extends ConnectionManagementTestCase {
private Connection connectionUnderTest;
@BeforeClassOnce
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
private void prepareConnectionProvider() {
cp = ConnectionProviderBuilder.buildConnectionProvider();
}
@AfterClassOnce
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
private void releaseConnectionProvider() {
try {
if ( cp instanceof Stoppable ) {

View File

@ -329,7 +329,7 @@ public abstract class BaseJpaOrNativeBootstrapFunctionalTestCase extends BaseUni
}
@AfterClassOnce
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
protected void releaseSessionFactory() {
if ( sessionFactory == null ) {
return;

View File

@ -50,7 +50,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase {
cfg.setProperty( Environment.GENERATE_STATISTICS, true );
}
@SuppressWarnings({ "UnusedDeclaration" })
@SuppressWarnings("unused")
private interface TestData {
Long getStudentId();

View File

@ -19,7 +19,7 @@ import static org.junit.jupiter.api.Assertions.fail;
/**
* @author Steve Ebersole
*/
@SuppressWarnings({ "UnusedDeclaration" })
@SuppressWarnings("unused")
@BaseUnitTest
public abstract class AbstractHolderTest {
protected abstract IntegralDataTypeHolder makeHolder();

View File

@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.fail;
/**
* @author Gail Badner
*/
@SuppressWarnings({ "UnusedDeclaration" })
@SuppressWarnings("unused")
@SessionFactory(generateStatistics = true)
public abstract class AbstractEntityWithOneToManyTest {
private boolean isContractPartiesInverse;

View File

@ -275,7 +275,7 @@ public abstract class BaseEntityManagerFunctionalTestCase extends BaseUnitTestCa
@After
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public void releaseResources() {
try {
releaseUnclosedEntityManagers();

View File

@ -22,7 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
*
* @author Steve Ebersole
*/
@SuppressWarnings({ "UnusedDeclaration" })
@SuppressWarnings("unused")
@SessionFactory
public abstract class LongStringTest {
private static final int LONG_STRING_SIZE = 10000;

View File

@ -525,7 +525,7 @@ public class AttributeConverterTest extends BaseUnitTestCase {
// Entity declarations used in the test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Entity(name = "T1")
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static class Tester {
@Id
private Long id;
@ -541,7 +541,7 @@ public class AttributeConverterTest extends BaseUnitTestCase {
}
@Entity(name = "T2")
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static class Tester2 {
@Id
private Long id;
@ -550,7 +550,7 @@ public class AttributeConverterTest extends BaseUnitTestCase {
}
@Entity(name = "T3")
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static class Tester3 {
@Id
private Long id;
@ -559,7 +559,7 @@ public class AttributeConverterTest extends BaseUnitTestCase {
}
@Entity(name = "T4")
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static class Tester4 {
@Id
private Long id;
@ -587,7 +587,7 @@ public class AttributeConverterTest extends BaseUnitTestCase {
}
@Entity(name = "T5")
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static class Tester5 {
@Id
private Long id;
@ -606,7 +606,7 @@ public class AttributeConverterTest extends BaseUnitTestCase {
@Entity
@Table(name = "irrelevantInstantEntity")
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public static class IrrelevantInstantEntity {
@Id
private Long id;

View File

@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* @author Burkhard Graves
* @author Gail Badner
*/
@SuppressWarnings({ "UnusedDeclaration" })
@SuppressWarnings("unused")
public abstract class AbstractRecursiveBidirectionalOneToManyTest extends BaseSessionFactoryFunctionalTest {
@Override

View File

@ -12,7 +12,7 @@ import java.util.Set;
/**
* @author Steve Ebersole
*/
@SuppressWarnings({"UnusedDeclaration"})
@SuppressWarnings("unused")
public class ManagedObject {
private Long moid;
private int version;

View File

@ -16,7 +16,7 @@ import static org.junit.Assert.fail;
/**
* @author Steve Ebersole
*/
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public abstract class ResultCheckStyleTest extends BaseCoreFunctionalTestCase {
public String getCacheConcurrencyStrategy() {
return null;

View File

@ -32,7 +32,7 @@ import static org.junit.Assert.assertTrue;
*
* @author Steve Ebersole
*/
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public abstract class CustomSQLTestSupport extends BaseCoreFunctionalTestCase {
public String getCacheConcurrencyStrategy() {
return null;

View File

@ -29,7 +29,7 @@ import static org.junit.Assert.fail;
*
* @author Gail Badner
*/
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public abstract class CustomStoredProcTestSupport extends CustomSQLTestSupport {
@Override

View File

@ -676,7 +676,7 @@ public class NativeSQLQueriesTest {
}
@Test
@SuppressWarnings( {"UnusedDeclaration"})
@SuppressWarnings("unused")
public void testExplicitReturnAPI(SessionFactoryScope scope) {
Organization jboss = new Organization( "JBoss" );
Person me = new Person( "Steve" );

View File

@ -63,7 +63,7 @@ public class SequenceIdRevisionEntity implements Serializable {
return timestamp;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}

View File

@ -35,12 +35,12 @@ public class SequenceIdTrackingModifiedEntitiesRevisionEntity extends SequenceId
@ModifiedEntityNames
private Set<String> modifiedEntityNames = new HashSet<>();
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public Set<String> getModifiedEntityNames() {
return modifiedEntityNames;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setModifiedEntityNames(Set<String> modifiedEntityNames) {
this.modifiedEntityNames = modifiedEntityNames;
}

View File

@ -81,7 +81,7 @@ public abstract class BaseEnversJPAFunctionalTestCase extends AbstractEnversTest
}
@BeforeClassOnce
@SuppressWarnings({"UnusedDeclaration"})
@SuppressWarnings("unused")
public void buildEntityManagerFactory() throws Exception {
log.trace( "Building EntityManagerFactory" );
@ -223,7 +223,7 @@ public abstract class BaseEnversJPAFunctionalTestCase extends AbstractEnversTest
}
@After
@SuppressWarnings({"UnusedDeclaration"})
@SuppressWarnings("unused")
public void releaseUnclosedEntityManagers() {
releaseUnclosedEntityManager( this.em );
auditReader = null;

View File

@ -25,7 +25,7 @@ public class Country {
/**
* Default constructor for persistence provider.
*/
@SuppressWarnings({"UnusedDeclaration"})
@SuppressWarnings("unused")
private Country() {
}

View File

@ -335,7 +335,7 @@ public abstract class BaseCoreFunctionalTestCase extends BaseUnitTestCase {
}
@AfterClassOnce
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
protected void releaseSessionFactory() {
if ( sessionFactory == null ) {
return;
@ -358,7 +358,7 @@ public abstract class BaseCoreFunctionalTestCase extends BaseUnitTestCase {
@OnFailure
@OnExpectedFailure
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void onFailure() {
if ( rebuildSessionFactoryOnError() ) {
rebuildSessionFactory();

View File

@ -387,7 +387,7 @@ public class BaseNonConfigCoreFunctionalTestCase extends BaseUnitTestCase {
}
@AfterClassOnce
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
protected void shutDown() {
releaseResources();
}
@ -420,7 +420,7 @@ public class BaseNonConfigCoreFunctionalTestCase extends BaseUnitTestCase {
@OnFailure
@OnExpectedFailure
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void onFailure() {
if ( rebuildSessionFactoryOnError() ) {
rebuildSessionFactory();

View File

@ -73,7 +73,7 @@ public class SchemaExportTask extends MatchingTask {
private String implicitNamingStrategy;
private String physicalNamingStrategy;
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void addFileset(FileSet set) {
fileSets.add(set);
}
@ -105,7 +105,7 @@ public class SchemaExportTask extends MatchingTask {
* written to standard out.
* @param quiet true to enable quiet mode
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setQuiet(boolean quiet) {
this.quiet = quiet;
}
@ -141,7 +141,7 @@ public class SchemaExportTask extends MatchingTask {
* Set the end of statement delimiter for the generated script
* @param delimiter the delimiter
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setDelimiter(String delimiter) {
this.delimiter = delimiter;
}
@ -163,17 +163,17 @@ public class SchemaExportTask extends MatchingTask {
DeprecationLogger.DEPRECATION_LOGGER.logDeprecatedNamingStrategyAntArgument();
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setImplicitNamingStrategy(String implicitNamingStrategy) {
this.implicitNamingStrategy = implicitNamingStrategy;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setPhysicalNamingStrategy(String physicalNamingStrategy) {
this.physicalNamingStrategy = physicalNamingStrategy;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setHaltonerror(boolean haltOnError) {
this.haltOnError = haltOnError;
}

View File

@ -65,7 +65,7 @@ public class SchemaUpdateTask extends MatchingTask {
private String implicitNamingStrategy = null;
private String physicalNamingStrategy = null;
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void addFileset(FileSet fileSet) {
fileSets.add( fileSet );
}
@ -75,7 +75,7 @@ public class SchemaUpdateTask extends MatchingTask {
*
* @param propertiesFile the properties file name
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setProperties(File propertiesFile) {
if ( !propertiesFile.exists() ) {
throw new BuildException( "Properties file: " + propertiesFile + " does not exist." );
@ -90,7 +90,7 @@ public class SchemaUpdateTask extends MatchingTask {
*
* @param configurationFile the file name
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setConfig(File configurationFile) {
this.configurationFile = configurationFile;
}
@ -100,7 +100,7 @@ public class SchemaUpdateTask extends MatchingTask {
*
* @param text true to enable text-only mode
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setText(boolean text) {
this.text = text;
}
@ -110,52 +110,52 @@ public class SchemaUpdateTask extends MatchingTask {
*
* @param quiet true to enable quiet mode
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setQuiet(boolean quiet) {
this.quiet = quiet;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setNamingStrategy(String namingStrategy) {
DeprecationLogger.DEPRECATION_LOGGER.logDeprecatedNamingStrategyAntArgument();
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setImplicitNamingStrategy(String implicitNamingStrategy) {
this.implicitNamingStrategy = implicitNamingStrategy;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setPhysicalNamingStrategy(String physicalNamingStrategy) {
this.physicalNamingStrategy = physicalNamingStrategy;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public File getOutputFile() {
return outputFile;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setOutputFile(File outputFile) {
this.outputFile = outputFile;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public boolean isHaltOnError() {
return haltOnError;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setHaltOnError(boolean haltOnError) {
this.haltOnError = haltOnError;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public String getDelimiter() {
return delimiter;
}
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public void setDelimiter(String delimiter) {
this.delimiter = delimiter;
}