From 5c1ece7a8431f8f00f5cd397556cea734914d3a5 Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Sat, 11 May 2024 16:19:57 +0800 Subject: [PATCH] HHH-18097 Replace `java.io.Closeable` with `java.lang.AutoCloseable` --- .../src/main/java/org/hibernate/ScrollableResults.java | 4 +--- .../src/main/java/org/hibernate/SessionFactory.java | 2 +- .../src/main/java/org/hibernate/SharedSessionContract.java | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/ScrollableResults.java b/hibernate-core/src/main/java/org/hibernate/ScrollableResults.java index de7a2d879f..1684b382f9 100644 --- a/hibernate-core/src/main/java/org/hibernate/ScrollableResults.java +++ b/hibernate-core/src/main/java/org/hibernate/ScrollableResults.java @@ -6,8 +6,6 @@ */ package org.hibernate; -import java.io.Closeable; - import org.hibernate.query.Query; /** @@ -24,7 +22,7 @@ import org.hibernate.query.Query; * * @author Gavin King */ -public interface ScrollableResults extends AutoCloseable, Closeable { +public interface ScrollableResults extends AutoCloseable { /** * Get the current row of results. * diff --git a/hibernate-core/src/main/java/org/hibernate/SessionFactory.java b/hibernate-core/src/main/java/org/hibernate/SessionFactory.java index 6503cbe399..d2cd04366a 100644 --- a/hibernate-core/src/main/java/org/hibernate/SessionFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/SessionFactory.java @@ -136,7 +136,7 @@ import static org.hibernate.internal.TransactionManagement.manageTransaction; * @author Gavin King * @author Steve Ebersole */ -public interface SessionFactory extends EntityManagerFactory, Referenceable, Serializable, java.io.Closeable { +public interface SessionFactory extends EntityManagerFactory, Referenceable, Serializable { /** * The JNDI name, used to bind the SessionFactory to JNDI */ diff --git a/hibernate-core/src/main/java/org/hibernate/SharedSessionContract.java b/hibernate-core/src/main/java/org/hibernate/SharedSessionContract.java index 30f2900448..be0f1683ac 100644 --- a/hibernate-core/src/main/java/org/hibernate/SharedSessionContract.java +++ b/hibernate-core/src/main/java/org/hibernate/SharedSessionContract.java @@ -6,7 +6,6 @@ */ package org.hibernate; -import java.io.Closeable; import java.io.Serializable; import java.util.List; @@ -23,7 +22,7 @@ import org.hibernate.query.criteria.HibernateCriteriaBuilder; * * @author Steve Ebersole */ -public interface SharedSessionContract extends QueryProducer, Closeable, Serializable { +public interface SharedSessionContract extends QueryProducer, AutoCloseable, Serializable { /** * Obtain the tenant identifier associated with this session. *