cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject cassandra git commit: Fix potential resource leak warnings
Date Mon, 15 Feb 2016 09:15:22 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 7bdffec93 -> ac7e2793d


Fix potential resource leak warnings

patch by Benjamin Lerer; reviewed by Sylvain Lebresne for CASSANDRA-11084


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/ac7e2793
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ac7e2793
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ac7e2793

Branch: refs/heads/cassandra-3.0
Commit: ac7e2793debe6de27d5ca50ce9afc3ff9a17f88d
Parents: 7bdffec
Author: Benjamin Lerer <b.lerer@gmail.com>
Authored: Mon Feb 15 10:14:08 2016 +0100
Committer: Benjamin Lerer <b.lerer@gmail.com>
Committed: Mon Feb 15 10:14:08 2016 +0100

----------------------------------------------------------------------
 .../org/apache/cassandra/hints/CompressedChecksummedDataInput.java | 2 ++
 src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java   | 2 ++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac7e2793/src/java/org/apache/cassandra/hints/CompressedChecksummedDataInput.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hints/CompressedChecksummedDataInput.java b/src/java/org/apache/cassandra/hints/CompressedChecksummedDataInput.java
index 1009b57..cc4a6bd 100644
--- a/src/java/org/apache/cassandra/hints/CompressedChecksummedDataInput.java
+++ b/src/java/org/apache/cassandra/hints/CompressedChecksummedDataInput.java
@@ -145,6 +145,8 @@ public final class CompressedChecksummedDataInput extends ChecksummedDataInput
         }
     }
 
+    // Closing the CompressedChecksummedDataInput will close the underlying channel.
+    @SuppressWarnings("resource")
     public static final CompressedChecksummedDataInput upgradeInput(ChecksummedDataInput
input, ICompressor compressor)
     {
         long position = input.getPosition();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac7e2793/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
index 5699c5a..2af0016 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
@@ -122,6 +122,8 @@ public class OutboundTcpConnectionPool
         return newSocket(endPoint());
     }
 
+    // Closing the socket will close the underlying channel.
+    @SuppressWarnings("resource")
     public static Socket newSocket(InetAddress endpoint) throws IOException
     {
         // zero means 'bind on any available port.'


Mime
View raw message