diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java index 17e3a258e0..ef50a2b8ec 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java @@ -535,7 +535,7 @@ public class SessionFactoryImpl implements SessionFactoryImplementor { } protected void validateNotClosed() { - if ( Status.CLOSED == status ) { + if ( status == Status.CLOSED ) { throw new IllegalStateException( "EntityManagerFactory is closed" ); } } @@ -625,7 +625,7 @@ public class SessionFactoryImpl implements SessionFactoryImplementor { } private Session buildEntityManager(final SynchronizationType synchronizationType, final Map map) { - assert Status.CLOSED != status; + assert status != Status.CLOSED; SessionBuilderImplementor builder = withOptions(); if ( synchronizationType == SynchronizationType.SYNCHRONIZED ) { @@ -694,7 +694,7 @@ public class SessionFactoryImpl implements SessionFactoryImplementor { @Override public boolean isOpen() { - return Status.CLOSED != status; + return status != Status.CLOSED; } @Override @@ -792,7 +792,7 @@ public class SessionFactoryImpl implements SessionFactoryImplementor { @Override public void close() throws HibernateException { synchronized (this) { - if ( Status.OPEN != status ) { + if ( status != Status.OPEN ) { if ( getSessionFactoryOptions().getJpaCompliance().isJpaClosedComplianceEnabled() ) { throw new IllegalStateException( "EntityManagerFactory is already closed" ); } @@ -988,7 +988,7 @@ public class SessionFactoryImpl implements SessionFactoryImplementor { @Override public boolean isClosed() { - return Status.CLOSED == status; + return status == Status.CLOSED; } private transient StatisticsImplementor statistics;