From 5763c864d8603de8696fbd6b6c9d13ed0ee95a1f Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sat, 11 Nov 2017 20:21:16 +0300 Subject: [PATCH] style: make PGReplicationStream, LargeObject implement AutoCloseable for Java 7+ fixes #1013 --- .../main/java/org/postgresql/largeobject/LargeObject.java | 6 +++++- .../org/postgresql/replication/PGReplicationStream.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java b/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java index 1ec3924485..b486ea40ed 100644 --- a/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java +++ b/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java @@ -41,7 +41,11 @@ * @see java.sql.PreparedStatement#setBinaryStream * @see java.sql.PreparedStatement#setUnicodeStream */ -public class LargeObject { +public class LargeObject + //#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.1" + implements AutoCloseable + //#endif + /* hi, checkstyle */ { /** * Indicates a seek from the begining of a file */ diff --git a/pgjdbc/src/main/java/org/postgresql/replication/PGReplicationStream.java b/pgjdbc/src/main/java/org/postgresql/replication/PGReplicationStream.java index 698d1c7520..ea07a98524 100644 --- a/pgjdbc/src/main/java/org/postgresql/replication/PGReplicationStream.java +++ b/pgjdbc/src/main/java/org/postgresql/replication/PGReplicationStream.java @@ -17,7 +17,11 @@ * It means that process wal record should be fast as possible, because during process wal record * lead to disconnect by timeout from server. */ -public interface PGReplicationStream { +public interface PGReplicationStream + //#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.1" + extends AutoCloseable + //#endif + /* hi, checkstyle */ { /** *

Read next wal record from backend. It method can be block until new message will not get