You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sn...@apache.org on 2017/01/30 16:26:15 UTC
cassandra git commit: eclipse-warnings on CASSANDRA-9425
Repository: cassandra
Updated Branches:
refs/heads/trunk 1e4cf2a8d -> 1a4696c3c
eclipse-warnings on CASSANDRA-9425
patch by Robert Stupp; reviewed by Aleksey Yeschenko for CASSANDRA-13164
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1a4696c3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1a4696c3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1a4696c3
Branch: refs/heads/trunk
Commit: 1a4696c3c590e63e3ae10938a00eb70aaf02317a
Parents: 1e4cf2a
Author: Robert Stupp <sn...@snazy.de>
Authored: Mon Jan 30 17:25:00 2017 +0100
Committer: Robert Stupp <sn...@snazy.de>
Committed: Mon Jan 30 17:25:31 2017 +0100
----------------------------------------------------------------------
src/java/org/apache/cassandra/cache/OHCProvider.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a4696c3/src/java/org/apache/cassandra/cache/OHCProvider.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cache/OHCProvider.java b/src/java/org/apache/cassandra/cache/OHCProvider.java
index 9fb4dfb..eefb0f4 100644
--- a/src/java/org/apache/cassandra/cache/OHCProvider.java
+++ b/src/java/org/apache/cassandra/cache/OHCProvider.java
@@ -125,9 +125,7 @@ public class OHCProvider implements CacheProvider<RowCacheKey, IRowCacheEntry>
private static KeySerializer instance = new KeySerializer();
public void serialize(RowCacheKey rowCacheKey, ByteBuffer buf)
{
- @SuppressWarnings("resource")
- DataOutputBuffer dataOutput = new DataOutputBufferFixed(buf);
- try
+ try (DataOutputBuffer dataOutput = new DataOutputBufferFixed(buf))
{
rowCacheKey.tableId.serialize(dataOutput);
dataOutput.writeUTF(rowCacheKey.indexName != null ? rowCacheKey.indexName : "");
@@ -142,11 +140,9 @@ public class OHCProvider implements CacheProvider<RowCacheKey, IRowCacheEntry>
public RowCacheKey deserialize(ByteBuffer buf)
{
- @SuppressWarnings("resource")
- DataInputBuffer dataInput = new DataInputBuffer(buf, false);
TableId tableId = null;
String indexName = null;
- try
+ try (DataInputBuffer dataInput = new DataInputBuffer(buf, false))
{
tableId = TableId.deserialize(dataInput);
indexName = dataInput.readUTF();