From 18ca4b41c1c19f373df7c67ce275cf8ccf396f8a Mon Sep 17 00:00:00 2001 From: Gavin Date: Wed, 17 May 2023 12:59:33 +0200 Subject: [PATCH] squash two warnings --- .../context/internal/ThreadLocalSessionContext.java | 4 +--- .../java/org/hibernate/internal/SessionFactoryImpl.java | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/context/internal/ThreadLocalSessionContext.java b/hibernate-core/src/main/java/org/hibernate/context/internal/ThreadLocalSessionContext.java index 6e19b91b43..a6e50cb110 100644 --- a/hibernate-core/src/main/java/org/hibernate/context/internal/ThreadLocalSessionContext.java +++ b/hibernate-core/src/main/java/org/hibernate/context/internal/ThreadLocalSessionContext.java @@ -133,7 +133,6 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext { * * @return the built or (re)obtained session. */ - @SuppressWarnings("deprecation") protected Session buildOrObtainSession() { return baseSessionBuilder() .autoClose( isAutoCloseEnabled() ) @@ -191,8 +190,7 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext { * @param session The session to bind. */ public static void bind(Session session) { - final SessionFactory factory = session.getSessionFactory(); - doBind( session, factory ); + doBind( session, session.getSessionFactory() ); } private static void terminateOrphanedSession(Session orphan) { 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 4ac9764a30..2a17c786a5 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java @@ -449,11 +449,6 @@ public class SessionFactoryImpl extends QueryParameterBindingTypeResolverImpl im class IntegratorObserver implements SessionFactoryObserver { private final ArrayList integrators = new ArrayList<>(); - - @Override - public void sessionFactoryCreated(SessionFactory factory) { - } - @Override public void sessionFactoryClosed(SessionFactory factory) { for ( Integrator integrator : integrators ) { @@ -959,8 +954,8 @@ public class SessionFactoryImpl extends QueryParameterBindingTypeResolverImpl im } else { - final NamedQueryMemento namedQueryMemento = ( (SqmQueryImplementor) hibernateQuery ).toMemento( - name ); + final NamedQueryMemento namedQueryMemento = + ( (SqmQueryImplementor) hibernateQuery ).toMemento( name ); namedObjectRepository.registerSqmQueryMemento( name, (NamedSqmQueryMemento) namedQueryMemento