diff --git a/hibernate-core/src/main/java/org/hibernate/CustomEntityDirtinessStrategy.java b/hibernate-core/src/main/java/org/hibernate/CustomEntityDirtinessStrategy.java index 903288c17b..2a6395726b 100644 --- a/hibernate-core/src/main/java/org/hibernate/CustomEntityDirtinessStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/CustomEntityDirtinessStrategy.java @@ -33,7 +33,7 @@ public interface CustomEntityDirtinessStrategy { * * @return {@code true} indicates the dirty check can be done; {@code false} indicates it cannot. */ - public boolean canDirtyCheck(Object entity, EntityPersister persister, Session session); + boolean canDirtyCheck(Object entity, EntityPersister persister, Session session); /** * The callback used by Hibernate to determine if the given entity is dirty. Only called if the previous @@ -45,7 +45,7 @@ public interface CustomEntityDirtinessStrategy { * * @return {@code true} indicates the entity is dirty; {@code false} indicates the entity is not dirty. */ - public boolean isDirty(Object entity, EntityPersister persister, Session session); + boolean isDirty(Object entity, EntityPersister persister, Session session); /** * Callback used by Hibernate to signal that the entity dirty flag should be cleared. Generally this @@ -55,7 +55,7 @@ public interface CustomEntityDirtinessStrategy { * @param persister The persister corresponding to the given entity * @param session The session from which this call originates. */ - public void resetDirty(Object entity, EntityPersister persister, Session session); + void resetDirty(Object entity, EntityPersister persister, Session session); /** * Callback used to hook into Hibernate algorithm for determination of which attributes have changed. Applications @@ -67,7 +67,7 @@ public interface CustomEntityDirtinessStrategy { * @param session The session from which this call originates. * @param dirtyCheckContext The callback context */ - public void findDirty(Object entity, EntityPersister persister, Session session, DirtyCheckContext dirtyCheckContext); + void findDirty(Object entity, EntityPersister persister, Session session, DirtyCheckContext dirtyCheckContext); /** * A callback to drive dirty checking. Handed to the {@link CustomEntityDirtinessStrategy#findDirty} method @@ -76,20 +76,20 @@ public interface CustomEntityDirtinessStrategy { * * @see CustomEntityDirtinessStrategy#findDirty */ - public static interface DirtyCheckContext { + interface DirtyCheckContext { /** * The callback to indicate that dirty checking (the dirty attribute determination phase) should be handled * by the calling {@link CustomEntityDirtinessStrategy} using the given {@link AttributeChecker}. * * @param attributeChecker The delegate usable by the context for determining which attributes are dirty. */ - public void doDirtyChecking(AttributeChecker attributeChecker); + void doDirtyChecking(AttributeChecker attributeChecker); } /** * Responsible for identifying when attributes are dirty. */ - public static interface AttributeChecker { + interface AttributeChecker { /** * Do the attribute dirty check. * @@ -98,20 +98,19 @@ public interface CustomEntityDirtinessStrategy { * * @return {@code true} indicates the attribute value has changed; {@code false} indicates it has not. */ - public boolean isDirty(AttributeInformation attributeInformation); + boolean isDirty(AttributeInformation attributeInformation); } /** * Provides {@link AttributeChecker} with meta information about the attributes being checked. */ - @SuppressWarnings( {"UnusedDeclaration"}) - public static interface AttributeInformation { + interface AttributeInformation { /** * Get a reference to the persister for the entity containing this attribute. * * @return The entity persister. */ - public EntityPersister getContainingPersister(); + EntityPersister getContainingPersister(); /** * Many of Hibernate internals use arrays to define information about attributes. This value @@ -121,28 +120,28 @@ public interface CustomEntityDirtinessStrategy { * * @return The attribute index. */ - public int getAttributeIndex(); + int getAttributeIndex(); /** * Get the name of this attribute. * * @return The attribute name */ - public String getName(); + String getName(); /** * Get the mapping type of this attribute. * * @return The mapping type. */ - public Type getType(); + Type getType(); /** * Get the current value of this attribute. * * @return The attributes current value */ - public Object getCurrentValue(); + Object getCurrentValue(); /** * Get the loaded value of this attribute. @@ -152,8 +151,7 @@ public interface CustomEntityDirtinessStrategy { * * @return The attributes loaded value */ - public Object getLoadedValue(); + Object getLoadedValue(); } - } diff --git a/hibernate-core/src/main/java/org/hibernate/EntityNameResolver.java b/hibernate-core/src/main/java/org/hibernate/EntityNameResolver.java index e6390e1938..7d9cdadc28 100644 --- a/hibernate-core/src/main/java/org/hibernate/EntityNameResolver.java +++ b/hibernate-core/src/main/java/org/hibernate/EntityNameResolver.java @@ -20,5 +20,5 @@ public interface EntityNameResolver { * @return The corresponding entity-name, or null if this impl does not know how to perform resolution * for the given entity instance. */ - public String resolveEntityName(Object entity); + String resolveEntityName(Object entity); } diff --git a/hibernate-core/src/main/java/org/hibernate/Filter.java b/hibernate-core/src/main/java/org/hibernate/Filter.java index 6ca4d087fe..f2b5f27253 100644 --- a/hibernate-core/src/main/java/org/hibernate/Filter.java +++ b/hibernate-core/src/main/java/org/hibernate/Filter.java @@ -22,7 +22,7 @@ public interface Filter { * * @return This filter's name. */ - public String getName(); + String getName(); /** * Get the filter definition containing additional information about the @@ -30,7 +30,7 @@ public interface Filter { * * @return The filter definition */ - public FilterDefinition getFilterDefinition(); + FilterDefinition getFilterDefinition(); /** diff --git a/hibernate-core/src/main/java/org/hibernate/InstantiationException.java b/hibernate-core/src/main/java/org/hibernate/InstantiationException.java index 460fd972ce..a27373b3b4 100644 --- a/hibernate-core/src/main/java/org/hibernate/InstantiationException.java +++ b/hibernate-core/src/main/java/org/hibernate/InstantiationException.java @@ -12,7 +12,7 @@ package org.hibernate; * @author Gavin King */ public class InstantiationException extends HibernateException { - private final Class clazz; + private final Class clazz; /** * Constructs a InstantiationException. @@ -21,7 +21,7 @@ public class InstantiationException extends HibernateException { * @param clazz The Class we are attempting to instantiate * @param cause The underlying exception */ - public InstantiationException(String message, Class clazz, Throwable cause) { + public InstantiationException(String message, Class clazz, Throwable cause) { super( message, cause ); this.clazz = clazz; } @@ -32,7 +32,7 @@ public class InstantiationException extends HibernateException { * @param message A message explaining the exception condition * @param clazz The Class we are attempting to instantiate */ - public InstantiationException(String message, Class clazz) { + public InstantiationException(String message, Class clazz) { this( message, clazz, null ); } @@ -43,7 +43,7 @@ public class InstantiationException extends HibernateException { * @param clazz The Class we are attempting to instantiate * @param cause The underlying exception */ - public InstantiationException(String message, Class clazz, Exception cause) { + public InstantiationException(String message, Class clazz, Exception cause) { super( message, cause ); this.clazz = clazz; } @@ -56,7 +56,7 @@ public class InstantiationException extends HibernateException { * @return The class we are unable to instantiate */ @Deprecated - public Class getPersistentClass() { + public Class getPersistentClass() { return clazz; } @@ -65,7 +65,7 @@ public class InstantiationException extends HibernateException { * * @return The class we are unable to instantiate */ - public Class getUninstantiatableClass() { + public Class getUninstantiatableClass() { return clazz; } diff --git a/hibernate-core/src/main/java/org/hibernate/LobHelper.java b/hibernate-core/src/main/java/org/hibernate/LobHelper.java index 42188e98d4..b0d1f1a939 100644 --- a/hibernate-core/src/main/java/org/hibernate/LobHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/LobHelper.java @@ -26,7 +26,7 @@ public interface LobHelper { * * @return the created Blob */ - public Blob createBlob(byte[] bytes); + Blob createBlob(byte[] bytes); /** * Create a new {@link Blob} from stream data. @@ -36,7 +36,7 @@ public interface LobHelper { * @return the create Blob */ - public Blob createBlob(InputStream stream, long length); + Blob createBlob(InputStream stream, long length); /** * Create a new {@link Clob} from content. @@ -45,7 +45,7 @@ public interface LobHelper { * * @return The created {@link Clob} */ - public Clob createClob(String string); + Clob createClob(String string); /** * Create a new {@link Clob} from character reader. @@ -55,7 +55,7 @@ public interface LobHelper { * * @return The created {@link Clob} */ - public Clob createClob(Reader reader, long length); + Clob createClob(Reader reader, long length); /** * Create a new {@link NClob} from content. @@ -64,7 +64,7 @@ public interface LobHelper { * * @return The created {@link NClob} */ - public NClob createNClob(String string); + NClob createNClob(String string); /** * Create a new {@link NClob} from character reader. @@ -74,5 +74,5 @@ public interface LobHelper { * * @return The created {@link NClob} */ - public NClob createNClob(Reader reader, long length); + NClob createNClob(Reader reader, long length); } diff --git a/hibernate-core/src/main/java/org/hibernate/LockMode.java b/hibernate-core/src/main/java/org/hibernate/LockMode.java index 4975fdc459..6ab1dce838 100644 --- a/hibernate-core/src/main/java/org/hibernate/LockMode.java +++ b/hibernate-core/src/main/java/org/hibernate/LockMode.java @@ -79,7 +79,7 @@ public enum LockMode { @Deprecated FORCE( 15, "force" ), - /** + /* * start of jakarta.persistence.LockModeType equivalent modes */ @@ -115,7 +115,7 @@ public enum LockMode { private final int level; private final String externalForm; - private LockMode(int level, String externalForm) { + LockMode(int level, String externalForm) { this.level = level; this.externalForm = externalForm; } diff --git a/hibernate-core/src/main/java/org/hibernate/Metamodel.java b/hibernate-core/src/main/java/org/hibernate/Metamodel.java index 730df0991a..3c667f4b4a 100644 --- a/hibernate-core/src/main/java/org/hibernate/Metamodel.java +++ b/hibernate-core/src/main/java/org/hibernate/Metamodel.java @@ -45,7 +45,6 @@ public interface Metamodel extends JpaMetamodel { * @return the names of all persistent (mapped) classes that extend or implement the * given class or interface, accounting for implicit/explicit polymorphism settings * and excluding mapped subclasses/joined-subclasses of other classes in the result. - * @throws MappingException */ String[] getImplementors(String entityName); diff --git a/hibernate-core/src/main/java/org/hibernate/PropertyAccessException.java b/hibernate-core/src/main/java/org/hibernate/PropertyAccessException.java index f68c691274..3c7fb43a06 100644 --- a/hibernate-core/src/main/java/org/hibernate/PropertyAccessException.java +++ b/hibernate-core/src/main/java/org/hibernate/PropertyAccessException.java @@ -21,7 +21,7 @@ import org.hibernate.internal.util.StringHelper; * @author Gavin King */ public class PropertyAccessException extends HibernateException { - private final Class persistentClass; + private final Class persistentClass; private final String propertyName; private final boolean wasSetter; @@ -38,7 +38,7 @@ public class PropertyAccessException extends HibernateException { Throwable cause, String message, boolean wasSetter, - Class persistentClass, + Class persistentClass, String propertyName) { super( message, cause ); this.persistentClass = persistentClass; @@ -46,7 +46,7 @@ public class PropertyAccessException extends HibernateException { this.propertyName = propertyName; } - public Class getPersistentClass() { + public Class getPersistentClass() { return persistentClass; } diff --git a/hibernate-core/src/main/java/org/hibernate/PropertySetterAccessException.java b/hibernate-core/src/main/java/org/hibernate/PropertySetterAccessException.java index 80f7902856..8eaf1187ff 100644 --- a/hibernate-core/src/main/java/org/hibernate/PropertySetterAccessException.java +++ b/hibernate-core/src/main/java/org/hibernate/PropertySetterAccessException.java @@ -24,9 +24,9 @@ public class PropertySetterAccessException extends PropertyAccessException { */ public PropertySetterAccessException( Throwable cause, - Class persistentClass, + Class persistentClass, String propertyName, - Class expectedType, + Class expectedType, Object target, Object value) { super( diff --git a/hibernate-core/src/main/java/org/hibernate/ReplicationMode.java b/hibernate-core/src/main/java/org/hibernate/ReplicationMode.java index 0a1bf6e427..f5af16720d 100644 --- a/hibernate-core/src/main/java/org/hibernate/ReplicationMode.java +++ b/hibernate-core/src/main/java/org/hibernate/ReplicationMode.java @@ -20,7 +20,10 @@ public enum ReplicationMode { */ EXCEPTION { @Override - public boolean shouldOverwriteCurrentVersion(Object entity, Object currentVersion, Object newVersion, BasicType versionType) { + public boolean shouldOverwriteCurrentVersion( + Object entity, + Object currentVersion, Object newVersion, + BasicType versionType) { throw new AssertionFailure( "should not be called" ); } }, @@ -29,7 +32,10 @@ public enum ReplicationMode { */ IGNORE { @Override - public boolean shouldOverwriteCurrentVersion(Object entity, Object currentVersion, Object newVersion, BasicType versionType) { + public boolean shouldOverwriteCurrentVersion( + Object entity, + Object currentVersion, Object newVersion, + BasicType versionType) { return false; } }, @@ -38,7 +44,10 @@ public enum ReplicationMode { */ OVERWRITE { @Override - public boolean shouldOverwriteCurrentVersion(Object entity, Object currentVersion, Object newVersion, BasicType versionType) { + public boolean shouldOverwriteCurrentVersion( + Object entity, + Object currentVersion, Object newVersion, + BasicType versionType) { return true; } }, @@ -47,10 +56,14 @@ public enum ReplicationMode { */ LATEST_VERSION { @Override - @SuppressWarnings("unchecked") - public boolean shouldOverwriteCurrentVersion(Object entity, Object currentVersion, Object newVersion, BasicType versionType) { + public boolean shouldOverwriteCurrentVersion( + Object entity, + Object currentVersion, Object newVersion, + BasicType versionType) { // always overwrite non-versioned data (because we don't know which is newer) - return versionType == null || versionType.getJavaTypeDescriptor().getComparator().compare( currentVersion, newVersion ) <= 0; + return versionType == null + || versionType.getJavaTypeDescriptor().getComparator() + .compare( currentVersion, newVersion ) <= 0; } }; @@ -64,6 +77,9 @@ public enum ReplicationMode { * * @return {@code true} indicates the data should be overwritten; {@code false} indicates it should not. */ - public abstract boolean shouldOverwriteCurrentVersion(Object entity, Object currentVersion, Object newVersion, BasicType versionType); + public abstract boolean shouldOverwriteCurrentVersion( + Object entity, + Object currentVersion, Object newVersion, + BasicType versionType); } diff --git a/hibernate-core/src/main/java/org/hibernate/ScrollMode.java b/hibernate-core/src/main/java/org/hibernate/ScrollMode.java index 63419cbb58..31a92b5a2d 100644 --- a/hibernate-core/src/main/java/org/hibernate/ScrollMode.java +++ b/hibernate-core/src/main/java/org/hibernate/ScrollMode.java @@ -41,7 +41,7 @@ public enum ScrollMode { private final int resultSetType; - private ScrollMode(int level) { + ScrollMode(int level) { this.resultSetType = level; } diff --git a/hibernate-core/src/main/java/org/hibernate/SessionBuilder.java b/hibernate-core/src/main/java/org/hibernate/SessionBuilder.java index 95558c235e..dafbd4304b 100644 --- a/hibernate-core/src/main/java/org/hibernate/SessionBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/SessionBuilder.java @@ -9,7 +9,6 @@ package org.hibernate; import java.sql.Connection; import java.util.TimeZone; -import org.hibernate.query.Query; import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode; import org.hibernate.resource.jdbc.spi.StatementInspector; @@ -18,7 +17,6 @@ import org.hibernate.resource.jdbc.spi.StatementInspector; * * @author Steve Ebersole */ -@SuppressWarnings("UnusedReturnValue") public interface SessionBuilder { /** * Opens a session with the specified options. @@ -94,6 +92,7 @@ public interface SessionBuilder { * * @return {@code this}, for method chaining */ + @SuppressWarnings("UnusedReturnValue") T autoClear(boolean autoClear); /** diff --git a/hibernate-core/src/main/java/org/hibernate/SessionEventListener.java b/hibernate-core/src/main/java/org/hibernate/SessionEventListener.java index 0df61f0a5a..effca9c6ca 100644 --- a/hibernate-core/src/main/java/org/hibernate/SessionEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/SessionEventListener.java @@ -16,37 +16,37 @@ import java.io.Serializable; * @author Steve Ebersole */ public interface SessionEventListener extends Serializable { - public void transactionCompletion(boolean successful); + void transactionCompletion(boolean successful); - public void jdbcConnectionAcquisitionStart(); - public void jdbcConnectionAcquisitionEnd(); + void jdbcConnectionAcquisitionStart(); + void jdbcConnectionAcquisitionEnd(); - public void jdbcConnectionReleaseStart(); - public void jdbcConnectionReleaseEnd(); + void jdbcConnectionReleaseStart(); + void jdbcConnectionReleaseEnd(); - public void jdbcPrepareStatementStart(); - public void jdbcPrepareStatementEnd(); + void jdbcPrepareStatementStart(); + void jdbcPrepareStatementEnd(); - public void jdbcExecuteStatementStart(); - public void jdbcExecuteStatementEnd(); + void jdbcExecuteStatementStart(); + void jdbcExecuteStatementEnd(); - public void jdbcExecuteBatchStart(); - public void jdbcExecuteBatchEnd(); + void jdbcExecuteBatchStart(); + void jdbcExecuteBatchEnd(); - public void cachePutStart(); - public void cachePutEnd(); + void cachePutStart(); + void cachePutEnd(); - public void cacheGetStart(); - public void cacheGetEnd(boolean hit); + void cacheGetStart(); + void cacheGetEnd(boolean hit); - public void flushStart(); - public void flushEnd(int numberOfEntities, int numberOfCollections); + void flushStart(); + void flushEnd(int numberOfEntities, int numberOfCollections); - public void partialFlushStart(); - public void partialFlushEnd(int numberOfEntities, int numberOfCollections); + void partialFlushStart(); + void partialFlushEnd(int numberOfEntities, int numberOfCollections); - public void dirtyCalculationStart(); - public void dirtyCalculationEnd(boolean dirty); + void dirtyCalculationStart(); + void dirtyCalculationEnd(boolean dirty); - public void end(); + void end(); } diff --git a/hibernate-core/src/main/java/org/hibernate/SharedSessionBuilder.java b/hibernate-core/src/main/java/org/hibernate/SharedSessionBuilder.java index 541f64a9e0..9927644747 100644 --- a/hibernate-core/src/main/java/org/hibernate/SharedSessionBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/SharedSessionBuilder.java @@ -115,7 +115,7 @@ public interface SharedSessionBuilder extends Se @Override T autoClose(boolean autoClose); - @Override + @Override @SuppressWarnings("unchecked") default T flushBeforeCompletion(boolean flushBeforeCompletion) { if ( flushBeforeCompletion ) { flushMode( FlushMode.ALWAYS ); diff --git a/hibernate-core/src/main/java/org/hibernate/TimeZoneStorageStrategy.java b/hibernate-core/src/main/java/org/hibernate/TimeZoneStorageStrategy.java index fe5afcf8e4..e69266207d 100644 --- a/hibernate-core/src/main/java/org/hibernate/TimeZoneStorageStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/TimeZoneStorageStrategy.java @@ -26,5 +26,5 @@ public enum TimeZoneStorageStrategy { /** * Doesn't store the time zone, but instead normalizes to UTC. */ - NORMALIZE; + NORMALIZE }