diff --git a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java index 6f1d201cba..cd5932de2a 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java @@ -423,7 +423,7 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont this ); } - if ( !isClosed() || (waitingForAutoClose && factory.isOpen()) ) { + if ( !isClosed() || ( waitingForAutoClose && factory.isOpen() ) ) { getTransactionCoordinator().pulse(); } return this.currentHibernateTransaction; @@ -902,7 +902,7 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont @SuppressWarnings({"WeakerAccess", "unchecked"}) protected NativeQueryImplementor createNativeQuery(NamedSQLQueryDefinition queryDefinition, Class resultType) { - if ( resultType != null && !Tuple.class.equals(resultType)) { + if ( resultType != null && !Tuple.class.equals( resultType ) ) { resultClassChecking( resultType, queryDefinition ); } @@ -911,8 +911,8 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont this, factory.getQueryPlanCache().getSQLParameterMetadata( queryDefinition.getQueryString(), false ) ); - if (Tuple.class.equals(resultType)) { - query.setResultTransformer(new NativeQueryTupleTransformer()); + if ( Tuple.class.equals( resultType ) ) { + query.setResultTransformer( new NativeQueryTupleTransformer() ); } query.setHibernateFlushMode( queryDefinition.getFlushMode() ); query.setComment( queryDefinition.getComment() != null ? queryDefinition.getComment() : queryDefinition.getName() ); diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java b/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java index 8a66a509c7..ea78f317db 100644 --- a/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/ConfigurationHelper.java @@ -30,21 +30,21 @@ public abstract class ConfigurationHelper { public static FlushMode getFlushMode(Object value, FlushMode defaultFlushMode) { final FlushMode flushMode; - if (value instanceof FlushMode) { + if ( value instanceof FlushMode ) { flushMode = (FlushMode) value; } - else if (value instanceof javax.persistence.FlushModeType) { - flushMode = ConfigurationHelper.getFlushMode( (javax.persistence.FlushModeType) value); + else if ( value instanceof javax.persistence.FlushModeType ) { + flushMode = ConfigurationHelper.getFlushMode( (javax.persistence.FlushModeType) value ); } - else if (value instanceof String) { - flushMode = ConfigurationHelper.getFlushMode( (String) value); + else if ( value instanceof String ) { + flushMode = ConfigurationHelper.getFlushMode( (String) value ); } else { flushMode = defaultFlushMode; } - if (flushMode == null) { - throw new PersistenceException("Unable to parse org.hibernate.flushMode: " + value); + if ( flushMode == null ) { + throw new PersistenceException( "Unable to parse org.hibernate.flushMode: " + value ); } return flushMode; @@ -55,21 +55,21 @@ public abstract class ConfigurationHelper { } private static FlushMode getFlushMode(String flushMode) { - if (flushMode == null) { + if ( flushMode == null ) { return null; } - flushMode = flushMode.toUpperCase(Locale.ROOT); + flushMode = flushMode.toUpperCase( Locale.ROOT ); return FlushMode.valueOf( flushMode ); } private static FlushMode getFlushMode(FlushModeType flushMode) { - switch(flushMode) { + switch ( flushMode ) { case AUTO: return FlushMode.AUTO; case COMMIT: return FlushMode.COMMIT; default: - throw new AssertionFailure("Unknown FlushModeType: " + flushMode); + throw new AssertionFailure( "Unknown FlushModeType: " + flushMode ); } }