Repository: apache/fluo
Issue: Remove unnecessary @SuppressWarnings("resource") annotations

At one point `@SuppressWarnings("resource")` annotations were added to the code to reduce false positives from the `Potential resource leak` warning.  However, if a user doesn't turn on the warning in Eclipse, another `Unnecessary  @SuppressWarnings("resource")` appears.  The `Potential resource leak` warning does not provide much value so this should be just assumed off and the annotations should be removed from the code.


Changed files:
modules/core/src/test/java/io/fluo/core/impl/FailureIT.java, modules/core/src/test/java/io/fluo/core/TestTransaction.java, modules/core/src/test/java/io/fluo/core/TestBaseImpl.java, modules/core/src/main/java/io/fluo/core/impl/LockResolver.java, modules/core/src/test/java/io/fluo/core/impl/StochasticBankIT.java, modules/core/src/test/java/io/fluo/core/impl/TimestampTrackerIT.java, modules/core/src/test/java/io/fluo/core/impl/ParallelScannerIT.java

diff --git a/modules/core/src/main/java/io/fluo/core/impl/LockResolver.java b/modules/core/src/main/java/io/fluo/core/impl/LockResolver.java
index 31f56634..40f6db3d 100644
--- a/modules/core/src/main/java/io/fluo/core/impl/LockResolver.java
+++ b/modules/core/src/main/java/io/fluo/core/impl/LockResolver.java
@@ -91,7 +91,6 @@ public class LockResolver {
    *          the wall time that the transaction that encountered the lock first saw the lock
    * @return true if all locks passed in were resolved (rolled forward or back)
    */
-  @SuppressWarnings("resource")
   static boolean resolveLocks(Environment env, long startTs, TxStats stats, List<Entry<Key,Value>> locks, long startTime) {
     // check if transactor is still alive
 
diff --git a/modules/core/src/test/java/io/fluo/core/TestBaseImpl.java b/modules/core/src/test/java/io/fluo/core/TestBaseImpl.java
index 69d7a002..439e670b 100644
--- a/modules/core/src/test/java/io/fluo/core/TestBaseImpl.java
+++ b/modules/core/src/test/java/io/fluo/core/TestBaseImpl.java
@@ -69,7 +69,6 @@ public class TestBaseImpl {
       this.env = env;
     }
 
-    @SuppressWarnings("resource")
     TestOracle(int port) throws Exception {
       this(new Environment(config, curator, conn, port));
     }
diff --git a/modules/core/src/test/java/io/fluo/core/TestTransaction.java b/modules/core/src/test/java/io/fluo/core/TestTransaction.java
index 5d32f144..bfacf451 100644
--- a/modules/core/src/test/java/io/fluo/core/TestTransaction.java
+++ b/modules/core/src/test/java/io/fluo/core/TestTransaction.java
@@ -42,7 +42,6 @@ public class TestTransaction extends TypedTransactionBase implements Transaction
     this(new TransactionImpl(env).setTransactor(transactor), new StringEncoder());
   }
 
-  @SuppressWarnings("resource")
   public TestTransaction(Environment env) {
     this(new TransactionImpl(env), new StringEncoder());
   }
@@ -52,12 +51,10 @@ public class TestTransaction extends TypedTransactionBase implements Transaction
     this.tx = transactionImpl;
   }
 
-  @SuppressWarnings("resource")
   public TestTransaction(Environment env, Bytes trow, Column tcol) {
     this(new TransactionImpl(env, trow, tcol), new StringEncoder());
   }
 
-  @SuppressWarnings("resource")
   public TestTransaction(Environment env, String trow, Column tcol) {
     this(new TransactionImpl(env, Bytes.of(trow), tcol), new StringEncoder());
   }
diff --git a/modules/core/src/test/java/io/fluo/core/impl/FailureIT.java b/modules/core/src/test/java/io/fluo/core/impl/FailureIT.java
index d4bb2696..7ac69ebc 100644
--- a/modules/core/src/test/java/io/fluo/core/impl/FailureIT.java
+++ b/modules/core/src/test/java/io/fluo/core/impl/FailureIT.java
@@ -111,7 +111,6 @@ public class FailureIT extends TestBaseImpl {
     
     tx.done();
     
-    @SuppressWarnings("resource")
     TransactorNode t2 = new TransactorNode(env);
     TestTransaction tx2 = new TestTransaction(env, t2);
     
@@ -174,7 +173,6 @@ public class FailureIT extends TestBaseImpl {
     
     tx.done();
     
-    @SuppressWarnings("resource")
     TransactorNode t2 = new TransactorNode(env);
     TestTransaction tx2 = new TestTransaction(env, t2);
     
@@ -276,7 +274,6 @@ public class FailureIT extends TestBaseImpl {
   }
   
   private void rollbackTest(boolean killTransactor) throws Exception {
-    @SuppressWarnings("resource")
     TransactorNode t1 = new TransactorNode(env);
 
     TestTransaction tx = new TestTransaction(env);
diff --git a/modules/core/src/test/java/io/fluo/core/impl/ParallelScannerIT.java b/modules/core/src/test/java/io/fluo/core/impl/ParallelScannerIT.java
index b460f8e5..177edeac 100644
--- a/modules/core/src/test/java/io/fluo/core/impl/ParallelScannerIT.java
+++ b/modules/core/src/test/java/io/fluo/core/impl/ParallelScannerIT.java
@@ -114,7 +114,6 @@ public class ParallelScannerIT extends TestBaseImpl {
 
     tx1.done();
 
-    @SuppressWarnings("resource")
     TransactorNode tNode1 = new TransactorNode(env);
 
     TestTransaction tx2 = new TestTransaction(env, tNode1);
diff --git a/modules/core/src/test/java/io/fluo/core/impl/StochasticBankIT.java b/modules/core/src/test/java/io/fluo/core/impl/StochasticBankIT.java
index 05424861..91b84f95 100644
--- a/modules/core/src/test/java/io/fluo/core/impl/StochasticBankIT.java
+++ b/modules/core/src/test/java/io/fluo/core/impl/StochasticBankIT.java
@@ -56,7 +56,6 @@ public class StochasticBankIT extends TestBaseImpl {
   static TypeLayer typeLayer = new TypeLayer(new StringEncoder());
   private static AtomicInteger txCount = new AtomicInteger();
 
-  @SuppressWarnings("resource")
   @Test
   public void testConcurrency() throws Exception {
 
diff --git a/modules/core/src/test/java/io/fluo/core/impl/TimestampTrackerIT.java b/modules/core/src/test/java/io/fluo/core/impl/TimestampTrackerIT.java
index 13b37c10..f0a1bf06 100644
--- a/modules/core/src/test/java/io/fluo/core/impl/TimestampTrackerIT.java
+++ b/modules/core/src/test/java/io/fluo/core/impl/TimestampTrackerIT.java
@@ -30,7 +30,6 @@ public class TimestampTrackerIT extends TestBaseImpl {
 
   @Test(expected = NoSuchElementException.class)
   public void testTsNoElement() {
-    @SuppressWarnings("resource")
     TimestampTracker tracker = env.getSharedResources().getTimestampTracker();
     Assert.assertTrue(tracker.isEmpty());
     tracker.getOldestActiveTimestamp();