accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [3/3] accumulo git commit: ACCUMULO-3643 Catch findbugs up through rank 16
Date Wed, 11 Mar 2015 21:40:53 GMT
ACCUMULO-3643 Catch findbugs up through rank 16

* fixes incorrect clone implementations
* fix missing equals/hashCode for Comparable
* public non-final static constants in ClassSize
* unclosed streams
* inefficient boxing/unboxing
* incorrectly using read instead of readFully
* check return on file operations (delete, create, mkdirs, etc.)
* add comments to indicate intentional ignoring exceptions
* renamed an inner class which looked like an exception, but wasn't
* make servlets conform to serializable interface from parent class
* triage and add exclusions for System.exit and forced gc
* triage and add exclusions for unclosed stream false positives


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

Branch: refs/heads/master
Commit: 8158d39c9dc9efb980db66051c7a01b45a880a9a
Parents: ded955e
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Wed Mar 11 17:22:34 2015 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Wed Mar 11 17:39:17 2015 -0400

----------------------------------------------------------------------
 core/src/main/findbugs/exclude-filter.xml       | 50 ++++++++++++++++----
 .../accumulo/core/bloomfilter/BloomFilter.java  |  3 --
 .../core/client/impl/ClientContext.java         |  4 +-
 .../core/client/impl/ConditionalWriterImpl.java |  9 +++-
 .../client/impl/NamespaceOperationsImpl.java    |  8 ++--
 .../core/client/impl/TabletLocator.java         |  1 -
 .../client/mapreduce/AbstractInputFormat.java   | 16 ++-----
 .../tokens/CredentialProviderToken.java         |  2 +-
 .../client/security/tokens/DelegationToken.java |  2 +-
 .../client/security/tokens/KerberosToken.java   |  7 ++-
 .../core/client/security/tokens/NullToken.java  |  6 ++-
 .../accumulo/core/conf/SiteConfiguration.java   |  4 +-
 .../core/file/blockfile/cache/CachedBlock.java  | 14 ++++++
 .../core/file/blockfile/cache/ClassSize.java    | 47 +++++++++---------
 .../file/blockfile/cache/LruBlockCache.java     |  6 +++
 .../accumulo/core/iterators/OrIterator.java     | 12 +++++
 .../core/iterators/user/AgeOffFilter.java       |  1 -
 .../core/iterators/user/TimestampFilter.java    |  4 +-
 .../user/WholeColumnFamilyIterator.java         |  6 +--
 .../apache/accumulo/core/rpc/ThriftUtil.java    |  8 +++-
 .../CachingHDFSSecretKeyEncryptionStrategy.java |  2 +-
 .../apache/accumulo/core/util/CreateToken.java  |  6 ++-
 .../org/apache/accumulo/core/util/Version.java  |  6 +--
 .../core/util/format/DefaultFormatter.java      | 35 +++++++-------
 .../accumulo/core/cli/TestClientOpts.java       |  6 +--
 .../client/impl/TableOperationsHelperTest.java  |  4 +-
 .../mapred/AccumuloFileOutputFormatTest.java    | 15 ++++--
 .../mapred/AccumuloRowInputFormatTest.java      |  8 ++--
 .../mapreduce/AccumuloFileOutputFormatTest.java | 11 ++++-
 .../mapreduce/AccumuloRowInputFormatTest.java   |  8 ++--
 .../conf/CredentialProviderFactoryShimTest.java |  8 +++-
 .../iterators/aggregation/NumSummationTest.java | 17 +++++--
 .../core/util/LocalityGroupUtilTest.java        |  4 +-
 .../core/util/format/HexFormatterTest.java      |  2 +-
 .../simple/src/main/findbugs/exclude-filter.xml |  5 ++
 .../simple/client/RandomBatchScanner.java       |  3 +-
 .../examples/simple/client/RowOperations.java   | 30 ++++++------
 .../simple/filedata/ChunkInputFormatTest.java   | 16 +++++--
 .../simple/filedata/ChunkInputStreamTest.java   | 40 +++++++++++-----
 fate/src/main/findbugs/exclude-filter.xml       |  5 ++
 .../apache/accumulo/maven/plugin/StartMojo.java |  4 +-
 .../impl/MiniAccumuloClusterImpl.java           | 28 ++++++-----
 .../MiniAccumuloClusterStartStopTest.java       |  6 ++-
 .../minicluster/MiniAccumuloClusterTest.java    |  5 +-
 .../impl/MiniAccumuloClusterImplTest.java       |  6 ++-
 pom.xml                                         |  2 +-
 proxy/src/main/findbugs/exclude-filter.xml      |  7 ++-
 .../org/apache/accumulo/proxy/ProxyServer.java  | 30 ++++++------
 .../base/src/main/findbugs/exclude-filter.xml   |  8 ++++
 .../server/constraints/MetadataConstraints.java |  2 +-
 .../accumulo/server/data/ServerMutation.java    | 13 +----
 .../iterators/MetadataBulkLoadFilter.java       |  2 +-
 .../master/balancer/DefaultLoadBalancer.java    | 11 +++++
 .../server/metrics/AbstractMetricsImpl.java     |  5 +-
 .../server/replication/StatusFormatter.java     | 19 +-------
 .../org/apache/accumulo/server/util/Admin.java  | 16 +++++--
 .../master/balancer/GroupBalancerTest.java      |  2 +-
 .../master/balancer/TableLoadBalancerTest.java  |  8 ++--
 .../server/security/SystemCredentialsTest.java  |  8 ++--
 .../accumulo/server/util/FileUtilTest.java      | 39 +++++++--------
 server/gc/src/main/findbugs/exclude-filter.xml  |  5 ++
 .../master/src/main/findbugs/exclude-filter.xml | 20 ++++++++
 .../accumulo/master/TabletGroupWatcher.java     |  3 +-
 .../DistributedWorkQueueWorkAssigner.java       |  1 +
 .../accumulo/master/tableOps/BulkImport.java    |  7 +--
 .../accumulo/master/tableOps/ImportTable.java   | 39 +++++----------
 .../accumulo/master/tableOps/TraceRepo.java     |  2 +-
 .../accumulo/monitor/ZooKeeperStatus.java       | 11 +++++
 .../accumulo/monitor/servlets/BasicServlet.java |  6 +--
 .../accumulo/monitor/servlets/JSONServlet.java  |  4 +-
 .../accumulo/monitor/servlets/LogServlet.java   |  2 +
 .../monitor/servlets/ProblemServlet.java        | 17 ++++---
 .../monitor/servlets/ReplicationServlet.java    | 25 ++++++----
 .../accumulo/monitor/servlets/ShellServlet.java | 36 ++++++++++----
 .../monitor/servlets/TServersServlet.java       |  2 +
 .../servlets/trace/NullKeyValueIterator.java    |  3 +-
 .../servlets/trace/ShowTraceLinkType.java       |  2 +
 .../monitor/servlets/trace/Summary.java         |  3 ++
 .../monitor/util/celltypes/CellType.java        |  5 +-
 .../monitor/util/celltypes/CompactionsType.java |  1 +
 .../monitor/util/celltypes/DateTimeType.java    |  1 +
 .../monitor/util/celltypes/DurationType.java    |  1 +
 .../monitor/util/celltypes/NumberType.java      |  1 +
 .../monitor/util/celltypes/PercentageType.java  |  2 +
 .../util/celltypes/PreciseNumberType.java       |  2 +
 .../util/celltypes/ProgressChartType.java       |  1 +
 .../monitor/util/celltypes/StringType.java      |  2 +
 .../monitor/util/celltypes/TServerLinkType.java |  2 +
 .../monitor/util/celltypes/TableLinkType.java   |  1 +
 .../monitor/util/celltypes/TableStateType.java  |  2 +
 .../tracer/src/main/findbugs/exclude-filter.xml |  2 +-
 .../org/apache/accumulo/tracer/TraceServer.java |  2 +-
 .../src/main/findbugs/exclude-filter.xml        |  6 +++
 .../tserver/TabletServerResourceManager.java    |  5 ++
 .../compaction/MajorCompactionRequest.java      |  5 ++
 .../accumulo/tserver/log/MultiReader.java       | 11 +++++
 .../tserver/metrics/TabletServerMBeanImpl.java  |  2 +-
 .../metrics/TabletServerMinCMetrics.java        |  2 +-
 .../metrics/TabletServerScanMetrics.java        |  2 +-
 .../metrics/TabletServerUpdateMetrics.java      |  2 +-
 .../tserver/tablet/CompactionRunner.java        | 12 +++++
 .../tserver/log/SortedLogRecoveryTest.java      | 11 +++++
 .../tserver/log/TestUpgradePathForWALogs.java   |  6 ++-
 .../accumulo/tserver/tablet/RootFilesTest.java  |  8 ++--
 .../accumulo/tserver/tablet/TabletTest.java     |  8 ++--
 shell/src/main/findbugs/exclude-filter.xml      |  5 ++
 .../shell/commands/ExtensionCommand.java        |  5 +-
 .../apache/accumulo/shell/ShellConfigTest.java  |  7 ++-
 .../org/apache/accumulo/shell/ShellTest.java    |  8 +++-
 .../AccumuloReloadingVFSClassLoaderTest.java    |  8 ++--
 test/src/main/findbugs/exclude-filter.xml       | 25 +++++++++-
 .../apache/accumulo/test/TestRandomDeletes.java | 13 +++++
 .../accumulo/test/continuous/Histogram.java     | 14 ++++++
 .../test/functional/CacheTestClean.java         |  7 +--
 .../test/functional/CacheTestReader.java        |  6 ++-
 .../accumulo/test/randomwalk/bulk/Verify.java   |  2 +-
 .../randomwalk/security/WalkingSecurity.java    |  4 +-
 .../accumulo/fate/zookeeper/ZooLockTest.java    |  2 +-
 .../org/apache/accumulo/harness/AccumuloIT.java | 10 ++--
 .../accumulo/harness/MiniClusterHarness.java    |  4 +-
 .../accumulo/harness/SharedMiniClusterIT.java   |  4 +-
 .../org/apache/accumulo/harness/TestingKdc.java |  7 +--
 .../apache/accumulo/proxy/SimpleProxyBase.java  | 19 ++++----
 .../apache/accumulo/test/AuditMessageIT.java    |  7 ++-
 .../accumulo/test/BulkImportVolumeIT.java       |  4 +-
 .../org/apache/accumulo/test/ExistingMacIT.java |  6 ++-
 .../MissingWalHeaderCompletesRecoveryIT.java    |  6 ++-
 .../org/apache/accumulo/test/NamespacesIT.java  |  4 +-
 .../test/RewriteTabletDirectoriesIT.java        |  4 +-
 .../org/apache/accumulo/test/ShellServerIT.java |  4 +-
 .../apache/accumulo/test/VolumeChooserIT.java   |  6 +--
 .../java/org/apache/accumulo/test/VolumeIT.java |  8 ++--
 .../test/functional/ConfigurableMacIT.java      |  4 +-
 .../accumulo/test/functional/DeleteIT.java      | 15 +++---
 .../functional/DeleteTableDuringSplitIT.java    |  4 +-
 .../test/functional/HalfDeadTServerIT.java      |  6 ++-
 .../accumulo/test/functional/KerberosIT.java    | 16 +++----
 .../test/functional/MonitorLoggingIT.java       |  2 +-
 .../accumulo/test/functional/ScanIdIT.java      |  9 ++--
 .../test/replication/CyclicReplicationIT.java   |  6 ++-
 ...UnusedWalDoesntCloseReplicationStatusIT.java |  2 +-
 .../test/security/KerberosTokenTest.java        | 12 +++--
 .../apache/accumulo/test/util/CertUtils.java    | 20 ++++++--
 .../accumulo/test/util/CertUtilsTest.java       | 32 +++++++++----
 trace/src/main/findbugs/exclude-filter.xml      |  5 +-
 145 files changed, 849 insertions(+), 438 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/findbugs/exclude-filter.xml
----------------------------------------------------------------------
diff --git a/core/src/main/findbugs/exclude-filter.xml b/core/src/main/findbugs/exclude-filter.xml
index d7c7348..8223660 100644
--- a/core/src/main/findbugs/exclude-filter.xml
+++ b/core/src/main/findbugs/exclude-filter.xml
@@ -18,16 +18,29 @@
   <Match>
     <!-- ignore thrift-generated files -->
     <Or>
-      <Class name="~org\.apache\.accumulo\.core\.client\.impl\.thrift\..*" />
-      <Class name="~org\.apache\.accumulo\.core\.data\.thrift\..*" />
-      <Class name="~org\.apache\.accumulo\.core\.gc\.thrift\..*" />
-      <Class name="~org\.apache\.accumulo\.core\.master\.thrift\..*" />
-      <Class name="~org\.apache\.accumulo\.core\.security\.thrift\..*" />
-      <Class name="~org\.apache\.accumulo\.core\.tabletserver\.thrift\..*" />
-      <Class name="~org\.apache\.accumulo\.core\.replication\.thrift\..*" />
+      <Package name="org.apache.accumulo.core.client.impl.thrift" />
+      <Package name="org.apache.accumulo.core.data.thrift" />
+      <Package name="org.apache.accumulo.core.gc.thrift" />
+      <Package name="org.apache.accumulo.core.master.thrift" />
+      <Package name="org.apache.accumulo.core.replication.thrift" />
+      <Package name="org.apache.accumulo.core.security.thrift" />
+      <Package name="org.apache.accumulo.core.tabletserver.thrift" />
+      <Package name="org.apache.accumulo.core.trace.thrift" />
     </Or>
   </Match>
   <Match>
+    <!-- ignore proto-generated files -->
+    <Package name="org.apache.accumulo.core.replication.proto" />
+  </Match>
+  <Match>
+    <!-- ignore Writable false positives about closing wrapped DataInput stream -->
+    <Or>
+      <Class name="org.apache.accumulo.core.bloomfilter.BloomFilter" />
+    </Or>
+    <Method name="readFields" params="java.io.DataInput" returns="void" />
+    <Bug code="OS" pattern="OS_OPEN_STREAM" />
+  </Match>
+  <Match>
     <!-- locking is confusing, but probably correct -->
     <Class name="org.apache.accumulo.core.client.impl.TabletLocatorImpl" />
     <Method name="processInvalidated" params="org.apache.accumulo.core.client.impl.ClientContext,org.apache.accumulo.core.client.impl.TabletLocatorImpl$LockCheckerSession" returns="void" />
@@ -38,12 +51,15 @@
     <Or>
       <Package name="org.apache.accumulo.core.iterators.user" />
       <Package name="org.apache.accumulo.core.iterators" />
+      <Package name="org.apache.accumulo.core.trace" />
       <Class name="org.apache.accumulo.core.client.mapred.RangeInputSplit" />
-      <Class name="org.apache.accumulo.core.trace.CountSampler" />
       <Class name="org.apache.accumulo.core.util.AddressUtil" />
       <Class name="org.apache.accumulo.core.zookeeper.ZooUtil" />
     </Or>
-    <Bug code="NM" pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" />
+    <Or>
+      <Bug code="NM" pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" />
+      <Bug code="NM" pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE" />
+    </Or>
   </Match>
   <Match>
     <!-- bad practice to start a thread in constructor; we should be careful using this class -->
@@ -64,4 +80,20 @@
     <Method name="equals" params="java.lang.Object" returns="boolean" />
     <Bug code="EQ" pattern="EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS" />
   </Match>
+  <Match>
+    <!-- CryptoTest shouldn't close the given I/O streams, because they are just wrapping them -->
+    <Or>
+      <Class name="org.apache.accumulo.core.security.crypto.CryptoTest" />
+      <Class name="org.apache.accumulo.core.security.crypto.DefaultCryptoModule" />
+    </Or>
+    <Bug code="OS" pattern="OS_OPEN_STREAM" />
+  </Match>
+  <Match>
+    <!-- admin classes can call System.exit -->
+    <Or>
+      <Class name="org.apache.accumulo.core.util.Jar" />
+      <Class name="org.apache.accumulo.core.file.rfile.PrintInfo" />
+    </Or>
+    <Bug code="DM" pattern="DM_EXIT" />
+  </Match>
 </FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java b/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java
index 4726e83..d8f8a75 100644
--- a/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/bloomfilter/BloomFilter.java
@@ -212,8 +212,6 @@ public class BloomFilter extends Filter {
     }
 
     if (super.getSerialVersion() == super.getVersion()) {
-      // ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
-      // ObjectInputStream ois = new ObjectInputStream(bais);
       ObjectInputStream ois = new ObjectInputStream((DataInputStream) (in));
       try {
         bits = (BitSet) ois.readObject();
@@ -221,7 +219,6 @@ public class BloomFilter extends Filter {
         log.error("BloomFilter tried to deserialize as bitset", e);
         throw new IOException("BloomFilter tried to deserialize as bitset: " + e);
       }
-      // can not close ois, it would close in
 
     } else {
       for (int i = 0, byteIndex = 0, bitIndex = 0; i < vectorSize; i++, bitIndex++) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
index 7c2fb1b..9257a1f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
@@ -130,13 +130,13 @@ public class ClientContext {
       if (!clientConf.getBoolean(ClientProperty.INSTANCE_RPC_SASL_ENABLED.getKey(), defaultVal)) {
         return null;
       }
-      return new SaslConnectionParams(clientConf, creds.getToken());
+      return new SaslConnectionParams(clientConf, getCredentials().getToken());
     }
     AccumuloConfiguration conf = getConfiguration();
     if (!conf.getBoolean(Property.INSTANCE_RPC_SASL_ENABLED)) {
       return null;
     }
-    return new SaslConnectionParams(conf, creds.getToken());
+    return new SaslConnectionParams(conf, getCredentials().getToken());
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
index f0d9e0c..6200791 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
@@ -17,6 +17,8 @@
 
 package org.apache.accumulo.core.client.impl;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -184,6 +186,11 @@ class ConditionalWriterImpl implements ConditionalWriter {
     }
 
     @Override
+    public int hashCode() {
+      return super.hashCode();
+    }
+
+    @Override
     public boolean equals(Object o) {
       if (o instanceof QCMutation)
         return compareTo((QCMutation) o) == 0;
@@ -415,7 +422,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
       count++;
 
       if (mut.getConditions().size() == 0)
-        throw new IllegalArgumentException("ConditionalMutation had no conditions " + new String(mut.getRow()));
+        throw new IllegalArgumentException("ConditionalMutation had no conditions " + new String(mut.getRow(), UTF_8));
 
       for (Condition cond : mut.getConditions()) {
         if (!isVisible(cond.getVisibility())) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
index 0b6330d..264e05a 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/NamespaceOperationsImpl.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.core.client.impl;
 
 import static com.google.common.base.Preconditions.checkArgument;
+import static java.nio.charset.StandardCharsets.UTF_8;
 
 import java.nio.ByteBuffer;
 import java.util.Arrays;
@@ -88,7 +89,8 @@ public class NamespaceOperationsImpl extends NamespaceOperationsHelper {
     checkArgument(namespace != null, "namespace is null");
 
     try {
-      doNamespaceFateOperation(FateOperation.NAMESPACE_CREATE, Arrays.asList(ByteBuffer.wrap(namespace.getBytes())), Collections.<String,String> emptyMap());
+      doNamespaceFateOperation(FateOperation.NAMESPACE_CREATE, Arrays.asList(ByteBuffer.wrap(namespace.getBytes(UTF_8))),
+          Collections.<String,String> emptyMap());
     } catch (NamespaceNotFoundException e) {
       // should not happen
       throw new AssertionError(e);
@@ -110,7 +112,7 @@ public class NamespaceOperationsImpl extends NamespaceOperationsHelper {
       throw new NamespaceNotEmptyException(namespaceId, namespace, null);
     }
 
-    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(namespace.getBytes()));
+    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(namespace.getBytes(UTF_8)));
     Map<String,String> opts = new HashMap<String,String>();
 
     try {
@@ -126,7 +128,7 @@ public class NamespaceOperationsImpl extends NamespaceOperationsHelper {
   public void rename(String oldNamespaceName, String newNamespaceName) throws AccumuloSecurityException, NamespaceNotFoundException, AccumuloException,
       NamespaceExistsException {
 
-    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(oldNamespaceName.getBytes()), ByteBuffer.wrap(newNamespaceName.getBytes()));
+    List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(oldNamespaceName.getBytes(UTF_8)), ByteBuffer.wrap(newNamespaceName.getBytes(UTF_8)));
     Map<String,String> opts = new HashMap<String,String>();
     doNamespaceFateOperation(FateOperation.NAMESPACE_RENAME, args, opts);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
index 2391fe6..2af45d3 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
@@ -148,7 +148,6 @@ public abstract class TabletLocator {
           }
         }
 
-        tabletLoc = new String(tabletLoc);
         tabletLocs.put(tabletLoc, new WeakReference<String>(tabletLoc));
         return tabletLoc;
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
index 255e555..9ed6315 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
@@ -34,7 +34,6 @@ import org.apache.accumulo.core.client.ClientSideIteratorScanner;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.IsolatedScanner;
-import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableDeletedException;
 import org.apache.accumulo.core.client.TableNotFoundException;
@@ -480,16 +479,6 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
         usesLocalIterators = tableConfig.shouldUseLocalIterators();
       }
 
-      List<IteratorSetting> iterators = split.getIterators();
-      if (null == iterators) {
-        iterators = tableConfig.getIterators();
-      }
-
-      Collection<Pair<Text,Text>> columns = split.getFetchedColumns();
-      if (null == columns) {
-        columns = tableConfig.getFetchedColumns();
-      }
-
       try {
         log.debug("Creating connector with user: " + principal);
         log.debug("Creating scanner for table: " + table);
@@ -516,6 +505,11 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
         throw new IOException(e);
       }
 
+      Collection<Pair<Text,Text>> columns = split.getFetchedColumns();
+      if (null == columns) {
+        columns = tableConfig.getFetchedColumns();
+      }
+
       // setup a scanner within the bounds of this split
       for (Pair<Text,Text> c : columns) {
         if (c.getSecond() != null) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
index d8ebc4a..bc427a7 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java
@@ -84,7 +84,7 @@ public class CredentialProviderToken extends PasswordToken {
 
   @Override
   public CredentialProviderToken clone() {
-    CredentialProviderToken clone = new CredentialProviderToken();
+    CredentialProviderToken clone = (CredentialProviderToken) super.clone();
     clone.setPassword(this.getPassword());
     return clone;
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/client/security/tokens/DelegationToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/DelegationToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/DelegationToken.java
index 4f8a107..c3219ec 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/DelegationToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/DelegationToken.java
@@ -131,7 +131,7 @@ public class DelegationToken extends PasswordToken {
 
   @Override
   public DelegationToken clone() {
-    DelegationToken copy = new DelegationToken();
+    DelegationToken copy = (DelegationToken) super.clone();
     copy.setPassword(getPassword());
     copy.identifier = new AuthenticationTokenIdentifier(identifier);
     return copy;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
index 5412bad..fc4b934 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/KerberosToken.java
@@ -89,8 +89,11 @@ public class KerberosToken implements AuthenticationToken {
   @Override
   public KerberosToken clone() {
     try {
-      return new KerberosToken(principal);
-    } catch (IOException e) {
+      KerberosToken clone = (KerberosToken) super.clone();
+      clone.principal = principal;
+      clone.keytab = keytab == null ? keytab : keytab.getCanonicalFile();
+      return clone;
+    } catch (CloneNotSupportedException | IOException e) {
       throw new RuntimeException(e);
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
index 530b41f..aea8821 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
@@ -45,7 +45,11 @@ public class NullToken implements AuthenticationToken {
 
   @Override
   public NullToken clone() {
-    return new NullToken();
+    try {
+      return (NullToken) super.clone();
+    } catch (CloneNotSupportedException e) {
+      throw new AssertionError("Inconceivable", e);
+    }
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
index f0c9e59..927abc6 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
@@ -38,7 +38,7 @@ import org.apache.log4j.Logger;
 public class SiteConfiguration extends AccumuloConfiguration {
   private static final Logger log = Logger.getLogger(SiteConfiguration.class);
 
-  private static AccumuloConfiguration parent = null;
+  private AccumuloConfiguration parent = null;
   private static SiteConfiguration instance = null;
 
   private static Configuration xmlConfig;
@@ -47,7 +47,7 @@ public class SiteConfiguration extends AccumuloConfiguration {
    * Not for consumers. Call {@link SiteConfiguration#getInstance(AccumuloConfiguration)} instead
    */
   SiteConfiguration(AccumuloConfiguration parent) {
-    SiteConfiguration.parent = parent;
+    this.parent = parent;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java
index b6d6d41..eef900c 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java
@@ -19,6 +19,8 @@
  */
 package org.apache.accumulo.core.file.blockfile.cache;
 
+import java.util.Objects;
+
 /**
  * Represents an entry in the {@link LruBlockCache}.
  *
@@ -79,10 +81,22 @@ public class CachedBlock implements HeapSize, Comparable<CachedBlock>, CacheEntr
     }
   }
 
+  @Override
   public long heapSize() {
     return size;
   }
 
+  @Override
+  public int hashCode() {
+    return Objects.hashCode(accessTime);
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    return this == obj || (obj != null && obj instanceof CachedBlock && 0 == compareTo((CachedBlock) obj));
+  }
+
+  @Override
   public int compareTo(CachedBlock that) {
     if (this.accessTime == that.accessTime)
       return 0;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java
index 2d7586f..b46da23 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java
@@ -35,67 +35,67 @@ import org.apache.commons.logging.LogFactory;
 public class ClassSize {
   static final Log LOG = LogFactory.getLog(ClassSize.class);
 
-  private static int nrOfRefsPerObj = 2;
+  private static final int nrOfRefsPerObj = 2;
 
   /** Array overhead */
-  public static int ARRAY = 0;
+  public static final int ARRAY;
 
   /** Overhead for ArrayList(0) */
-  public static int ARRAYLIST = 0;
+  public static final int ARRAYLIST;
 
   /** Overhead for ByteBuffer */
-  public static int BYTE_BUFFER = 0;
+  public static final int BYTE_BUFFER;
 
   /** Overhead for an Integer */
-  public static int INTEGER = 0;
+  public static final int INTEGER;
 
   /** Overhead for entry in map */
-  public static int MAP_ENTRY = 0;
+  public static final int MAP_ENTRY;
 
   /** Object overhead is minimum 2 * reference size (8 bytes on 64-bit) */
-  public static int OBJECT = 0;
+  public static final int OBJECT;
 
   /** Reference size is 8 bytes on 64-bit, 4 bytes on 32-bit */
-  public static int REFERENCE = 0;
+  public static final int REFERENCE;
 
   /** String overhead */
-  public static int STRING = 0;
+  public static final int STRING;
 
   /** Overhead for TreeMap */
-  public static int TREEMAP = 0;
+  public static final int TREEMAP;
 
   /** Overhead for ConcurrentHashMap */
-  public static int CONCURRENT_HASHMAP = 0;
+  public static final int CONCURRENT_HASHMAP;
 
   /** Overhead for ConcurrentHashMap.Entry */
-  public static int CONCURRENT_HASHMAP_ENTRY = 0;
+  public static final int CONCURRENT_HASHMAP_ENTRY;
 
   /** Overhead for ConcurrentHashMap.Segment */
-  public static int CONCURRENT_HASHMAP_SEGMENT = 0;
+  public static final int CONCURRENT_HASHMAP_SEGMENT;
 
   /** Overhead for ConcurrentSkipListMap */
-  public static int CONCURRENT_SKIPLISTMAP = 0;
+  public static final int CONCURRENT_SKIPLISTMAP;
 
   /** Overhead for ConcurrentSkipListMap Entry */
-  public static int CONCURRENT_SKIPLISTMAP_ENTRY = 0;
+  public static final int CONCURRENT_SKIPLISTMAP_ENTRY;
 
   /** Overhead for ReentrantReadWriteLock */
-  public static int REENTRANT_LOCK = 0;
+  public static final int REENTRANT_LOCK;
 
   /** Overhead for AtomicLong */
-  public static int ATOMIC_LONG = 0;
+  public static final int ATOMIC_LONG;
 
   /** Overhead for AtomicInteger */
-  public static int ATOMIC_INTEGER = 0;
+  public static final int ATOMIC_INTEGER;
 
   /** Overhead for AtomicBoolean */
-  public static int ATOMIC_BOOLEAN = 0;
+  public static final int ATOMIC_BOOLEAN;
 
   /** Overhead for CopyOnWriteArraySet */
-  public static int COPYONWRITE_ARRAYSET = 0;
+  public static final int COPYONWRITE_ARRAYSET;
 
   /** Overhead for CopyOnWriteArrayList */
-  public static int COPYONWRITE_ARRAYLIST = 0;
+  public static final int COPYONWRITE_ARRAYLIST;
 
   private static final String THIRTY_TWO = "32";
 
@@ -108,10 +108,7 @@ public class ClassSize {
     String arcModel = sysProps.getProperty("sun.arch.data.model");
 
     // Default value is set to 8, covering the case when arcModel is unknown
-    REFERENCE = 8;
-    if (arcModel.equals(THIRTY_TWO)) {
-      REFERENCE = 4;
-    }
+    REFERENCE = arcModel.equals(THIRTY_TWO) ? 4 : 8;
 
     OBJECT = 2 * REFERENCE;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
index 98c800e..888a92f 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
@@ -20,6 +20,7 @@
 package org.apache.accumulo.core.file.blockfile.cache;
 
 import java.lang.ref.WeakReference;
+import java.util.Objects;
 import java.util.PriorityQueue;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.Executors;
@@ -447,6 +448,11 @@ public class LruBlockCache implements BlockCache, HeapSize {
     }
 
     @Override
+    public int hashCode() {
+      return Objects.hashCode(overflow());
+    }
+
+    @Override
     public boolean equals(Object that) {
       if (that instanceof BlockBucket)
         return compareTo((BlockBucket) that) == 0;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/iterators/OrIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/OrIterator.java b/core/src/main/java/org/apache/accumulo/core/iterators/OrIterator.java
index 98c8cac..3769eae 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/OrIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/OrIterator.java
@@ -22,6 +22,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Objects;
 import java.util.PriorityQueue;
 
 import org.apache.accumulo.core.data.ArrayByteSequence;
@@ -61,6 +62,17 @@ public class OrIterator implements SortedKeyValueIterator<Key,Value> {
       this.seekColfams = Collections.<ByteSequence> singletonList(new ArrayByteSequence(term.getBytes(), 0, term.getLength()));
     }
 
+    @Override
+    public int hashCode() {
+      return Objects.hashCode(iter.getTopKey().getColumnQualifier());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+      return obj == this || (obj != null && obj instanceof TermSource && 0 == compareTo((TermSource) obj));
+    }
+
+    @Override
     public int compareTo(TermSource o) {
       // NOTE: If your implementation can have more than one row in a tablet,
       // you must compare row key here first, then column qualifier.

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
index 705f990..ee28e26 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
@@ -59,7 +59,6 @@ public class AgeOffFilter extends Filter {
       throw new IllegalArgumentException(TTL + " must be set for AgeOffFilter");
 
     super.init(source, options, env);
-    threshold = -1;
     threshold = Long.parseLong(ttl);
 
     String time = options.get(CURRENT_TIME);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
index 3cfbf5b..18c10e9 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
@@ -90,14 +90,14 @@ public class TimestampFilter extends Filter {
       if (hasStart) {
         String s = options.get(START);
         if (s.startsWith(LONG_PREFIX))
-          start = Long.valueOf(s.substring(LONG_PREFIX.length()));
+          start = Long.parseLong(s.substring(LONG_PREFIX.length()));
         else
           start = dateParser.parse(s).getTime();
       }
       if (hasEnd) {
         String s = options.get(END);
         if (s.startsWith(LONG_PREFIX))
-          end = Long.valueOf(s.substring(LONG_PREFIX.length()));
+          end = Long.parseLong(s.substring(LONG_PREFIX.length()));
         else
           end = dateParser.parse(s).getTime();
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIterator.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIterator.java
index 25f30a8..55f79d3 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIterator.java
@@ -85,13 +85,13 @@ public class WholeColumnFamilyIterator implements SortedKeyValueIterator<Key,Val
       {
         int len = din.readInt();
         cq = new byte[len];
-        din.read(cq);
+        din.readFully(cq);
       }
       // read the col visibility
       {
         int len = din.readInt();
         cv = new byte[len];
-        din.read(cv);
+        din.readFully(cv);
       }
       // read the timestamp
       long timestamp = din.readLong();
@@ -99,7 +99,7 @@ public class WholeColumnFamilyIterator implements SortedKeyValueIterator<Key,Val
       {
         int len = din.readInt();
         valBytes = new byte[len];
-        din.read(valBytes);
+        din.readFully(valBytes);
       }
       map.put(new Key(rowKey.getRowData().toArray(), rowKey.getColumnFamilyData().toArray(), cq, cv, timestamp, false, false), new Value(valBytes, false));
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java
index f2e8612..0f952c2 100644
--- a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java
@@ -414,14 +414,18 @@ public class ThriftUtil {
       if (params.isTrustStoreSet()) {
         tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
         KeyStore ts = KeyStore.getInstance(params.getTrustStoreType());
-        ts.load(new FileInputStream(params.getTrustStorePath()), params.getTrustStorePass().toCharArray());
+        try (FileInputStream fis = new FileInputStream(params.getTrustStorePath())) {
+          ts.load(fis, params.getTrustStorePass().toCharArray());
+        }
         tmf.init(ts);
       }
 
       if (params.isKeyStoreSet()) {
         kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
         KeyStore ks = KeyStore.getInstance(params.getKeyStoreType());
-        ks.load(new FileInputStream(params.getKeyStorePath()), params.getKeyStorePass().toCharArray());
+        try (FileInputStream fis = new FileInputStream(params.getKeyStorePath())) {
+          ks.load(fis, params.getKeyStorePass().toCharArray());
+        }
         kmf.init(ks, params.getKeyStorePass().toCharArray());
       }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java b/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
index b70cf57..d808500 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
@@ -140,7 +140,7 @@ public class CachingHDFSSecretKeyEncryptionStrategy implements SecretKeyEncrypti
 
         int keyEncryptionKeyLength = in.readInt();
         keyEncryptionKey = new byte[keyEncryptionKeyLength];
-        in.read(keyEncryptionKey);
+        in.readFully(keyEncryptionKey);
 
         initialized = true;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java b/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java
index adb7c3d..452c411 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java
@@ -116,14 +116,16 @@ public class CreateToken implements KeywordExecutable {
       }
       File tf = new File(tokenFile);
       if (!tf.exists()) {
-        tf.createNewFile();
+        if (!tf.createNewFile()) {
+          throw new IOException("Couldn't create " + tf.getCanonicalPath());
+        }
       }
       PrintStream out = new PrintStream(new FileOutputStream(tf, true), true, UTF_8.name());
       String outString = principal + ":" + opts.tokenClassName + ":" + tokenBase64;
       out.println(outString);
       out.close();
       System.out.println("Token written to " + tokenFile + ". Remember to upload it to hdfs.");
-    } catch (Exception e) {
+    } catch (IOException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
       throw new RuntimeException(e);
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/util/Version.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/Version.java b/core/src/main/java/org/apache/accumulo/core/util/Version.java
index 069e5b1..f3d8bfb 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/Version.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/Version.java
@@ -58,12 +58,12 @@ public class Version implements KeywordExecutable {
 
     if (parser.group(1) != null)
       package_ = parser.group(2);
-    major = Integer.valueOf(parser.group(3));
+    major = Integer.parseInt(parser.group(3));
     minor = 0;
     if (parser.group(5) != null)
-      minor = Integer.valueOf(parser.group(5));
+      minor = Integer.parseInt(parser.group(5));
     if (parser.group(7) != null)
-      release = Integer.valueOf(parser.group(7));
+      release = Integer.parseInt(parser.group(7));
     if (parser.group(9) != null)
       etcetera = parser.group(9);
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java b/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
index f104610..5a2f43f 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
@@ -31,26 +31,26 @@ import org.apache.hadoop.io.Text;
 public class DefaultFormatter implements Formatter {
   private Iterator<Entry<Key,Value>> si;
   private boolean doTimestamps;
-  private static final ThreadLocal<DateFormat> formatter = new ThreadLocal<DateFormat>() {
-    @Override
-    protected DateFormat initialValue() {
-      return new DefaultDateFormat();
-    }
 
-    class DefaultDateFormat extends DateFormat {
-      private static final long serialVersionUID = 1L;
+  public static class DefaultDateFormat extends DateFormat {
+    private static final long serialVersionUID = 1L;
 
-      @Override
-      public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
-        toAppendTo.append(Long.toString(date.getTime()));
-        return toAppendTo;
-      }
+    @Override
+    public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
+      toAppendTo.append(Long.toString(date.getTime()));
+      return toAppendTo;
+    }
 
-      @Override
-      public Date parse(String source, ParsePosition pos) {
-        return new Date(Long.parseLong(source));
-      }
+    @Override
+    public Date parse(String source, ParsePosition pos) {
+      return new Date(Long.parseLong(source));
+    }
+  }
 
+  private static final ThreadLocal<DateFormat> formatter = new ThreadLocal<DateFormat>() {
+    @Override
+    protected DateFormat initialValue() {
+      return new DefaultDateFormat();
     }
   };
 
@@ -61,11 +61,13 @@ public class DefaultFormatter implements Formatter {
     doTimestamps = printTimestamps;
   }
 
+  @Override
   public boolean hasNext() {
     checkState(true);
     return si.hasNext();
   }
 
+  @Override
   public String next() {
     DateFormat timestampFormat = null;
 
@@ -81,6 +83,7 @@ public class DefaultFormatter implements Formatter {
     return formatEntry(si.next(), timestampFormat);
   }
 
+  @Override
   public void remove() {
     checkState(true);
     si.remove();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java b/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
index ef6836f..f0fdcca 100644
--- a/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
+++ b/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
@@ -111,7 +111,7 @@ public class TestClientOpts {
   public void testVolumes() throws IOException {
     File instanceId = tmpDir.newFolder("instance_id");
     File uuid = new File(instanceId, UUID.randomUUID().toString());
-    uuid.createNewFile();
+    assertTrue(uuid.createNewFile());
     // document the defaults
     ClientOpts args = new ClientOpts();
     File siteXml = tmpDir.newFile(this.getClass().getSimpleName() + "-" + testName.getMethodName() + "-site.xml");
@@ -137,9 +137,9 @@ public class TestClientOpts {
   @Test
   public void testInstanceDir() throws IOException {
     File instanceId = tmpDir.newFolder("instance_id");
-    instanceId.mkdir();
+    assertTrue(instanceId.mkdir() || instanceId.isDirectory());
     File uuid = new File(instanceId, UUID.randomUUID().toString());
-    uuid.createNewFile();
+    assertTrue(uuid.createNewFile());
     // document the defaults
     ClientOpts args = new ClientOpts();
     File siteXml = tmpDir.newFile(this.getClass().getSimpleName() + "-" + testName.getMethodName() + "-site.xml");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/client/impl/TableOperationsHelperTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/impl/TableOperationsHelperTest.java b/core/src/test/java/org/apache/accumulo/core/client/impl/TableOperationsHelperTest.java
index dab7226..475412f 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/impl/TableOperationsHelperTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/impl/TableOperationsHelperTest.java
@@ -297,7 +297,9 @@ public class TableOperationsHelperTest {
     try {
       t.attachIterator("table", setting);
       Assert.fail();
-    } catch (AccumuloException e) {}
+    } catch (AccumuloException e) {
+      // expected, ignore
+    }
     setting.setName("thirdName");
     try {
       t.attachIterator("table", setting);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
index 3a4d641..6064fa5 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
@@ -47,13 +47,15 @@ import org.apache.hadoop.mapred.Reporter;
 import org.apache.hadoop.mapred.lib.IdentityMapper;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
-import org.apache.log4j.Logger;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class AccumuloFileOutputFormatTest {
+  private static final Logger log = LoggerFactory.getLogger(AccumuloFileOutputFormatTest.class);
   private static final int JOB_VISIBILITY_CACHE_SIZE = 3000;
   private static final String PREFIX = AccumuloFileOutputFormatTest.class.getSimpleName();
   private static final String INSTANCE_NAME = PREFIX + "_mapred_instance";
@@ -111,7 +113,7 @@ public class AccumuloFileOutputFormatTest {
             if (index == 2)
               fail();
           } catch (Exception e) {
-            Logger.getLogger(this.getClass()).error(e, e);
+            log.error(e.toString(), e);
             assertEquals(2, index);
           }
         } catch (AssertionError e) {
@@ -173,7 +175,9 @@ public class AccumuloFileOutputFormatTest {
 
   public void handleWriteTests(boolean content) throws Exception {
     File f = folder.newFile("handleWriteTests");
-    f.delete();
+    if (f.delete()) {
+      log.debug("Deleted {}", f);
+    }
     MRTester.main(new String[] {"root", "", content ? TEST_TABLE : EMPTY_TABLE, f.getAbsolutePath()});
 
     assertTrue(f.exists());
@@ -194,9 +198,10 @@ public class AccumuloFileOutputFormatTest {
   @Test
   public void writeBadVisibility() throws Exception {
     File f = folder.newFile("writeBadVisibility");
-    f.delete();
+    if (f.delete()) {
+      log.debug("Deleted {}", f);
+    }
     MRTester.main(new String[] {"root", "", BAD_TABLE, f.getAbsolutePath()});
-    Logger.getLogger(this.getClass()).error(e1, e1);
     assertNull(e1);
     assertNull(e2);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java
index 219e4f0..498ad1f 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormatTest.java
@@ -60,13 +60,13 @@ public class AccumuloRowInputFormatTest {
   private static final String ROW2 = "row2";
   private static final String ROW3 = "row3";
   private static final String COLF1 = "colf1";
-  private static List<Entry<Key,Value>> row1;
-  private static List<Entry<Key,Value>> row2;
-  private static List<Entry<Key,Value>> row3;
+  private static final List<Entry<Key,Value>> row1;
+  private static final List<Entry<Key,Value>> row2;
+  private static final List<Entry<Key,Value>> row3;
   private static AssertionError e1 = null;
   private static AssertionError e2 = null;
 
-  public AccumuloRowInputFormatTest() {
+  static {
     row1 = new ArrayList<Entry<Key,Value>>();
     row1.add(new KeyValue(new Key(ROW1, COLF1, "colq1"), "v1".getBytes()));
     row1.add(new KeyValue(new Key(ROW1, COLF1, "colq2"), "v2".getBytes()));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
index f5114ce..0fa5080 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
@@ -45,8 +45,11 @@ import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class AccumuloFileOutputFormatTest {
+  private static final Logger log = LoggerFactory.getLogger(AccumuloFileOutputFormatTest.class);
   private static final String PREFIX = AccumuloFileOutputFormatTest.class.getSimpleName();
   private static final String INSTANCE_NAME = PREFIX + "_mapreduce_instance";
   private static final String BAD_TABLE = PREFIX + "_mapreduce_bad_table";
@@ -160,7 +163,9 @@ public class AccumuloFileOutputFormatTest {
 
   public void handleWriteTests(boolean content) throws Exception {
     File f = folder.newFile("handleWriteTests");
-    f.delete();
+    if (f.delete()) {
+      log.debug("Deleted {}", f);
+    }
     MRTester.main(new String[] {"root", "", content ? TEST_TABLE : EMPTY_TABLE, f.getAbsolutePath()});
 
     assertTrue(f.exists());
@@ -181,7 +186,9 @@ public class AccumuloFileOutputFormatTest {
   @Test
   public void writeBadVisibility() throws Exception {
     File f = folder.newFile("writeBadVisibility");
-    f.delete();
+    if (f.delete()) {
+      log.debug("Deleted {}", f);
+    }
     MRTester.main(new String[] {"root", "", BAD_TABLE, f.getAbsolutePath()});
     assertNull(e1);
     assertNull(e2);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
index 484d208..59005d3 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
@@ -57,13 +57,13 @@ public class AccumuloRowInputFormatTest {
   private static final String ROW2 = "row2";
   private static final String ROW3 = "row3";
   private static final String COLF1 = "colf1";
-  private static List<Entry<Key,Value>> row1;
-  private static List<Entry<Key,Value>> row2;
-  private static List<Entry<Key,Value>> row3;
+  private static final List<Entry<Key,Value>> row1;
+  private static final List<Entry<Key,Value>> row2;
+  private static final List<Entry<Key,Value>> row3;
   private static AssertionError e1 = null;
   private static AssertionError e2 = null;
 
-  public AccumuloRowInputFormatTest() {
+  static {
     row1 = new ArrayList<Entry<Key,Value>>();
     row1.add(new KeyValue(new Key(ROW1, COLF1, "colq1"), "v1".getBytes()));
     row1.add(new KeyValue(new Key(ROW1, COLF1, "colq2"), "v2".getBytes()));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java b/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
index 29e2632..37dff20 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
@@ -33,12 +33,16 @@ import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  *
  */
 public class CredentialProviderFactoryShimTest {
 
+  private static final Logger log = LoggerFactory.getLogger(CredentialProviderFactoryShimTest.class);
+
   private static final String populatedKeyStoreName = "/accumulo.jceks", emptyKeyStoreName = "/empty.jceks";
   private static File emptyKeyStore, populatedKeyStore;
 
@@ -144,7 +148,9 @@ public class CredentialProviderFactoryShimTest {
     File targetDir = new File(System.getProperty("user.dir") + "/target");
     File keystoreFile = new File(targetDir, "create.jks");
     if (keystoreFile.exists()) {
-      keystoreFile.delete();
+      if (!keystoreFile.delete()) {
+        log.error("Unable to delete {}", keystoreFile);
+      }
     }
 
     String providerUrl = "jceks://file" + keystoreFile.getAbsolutePath();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java
index d8d3b47..7520ee3 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/aggregation/NumSummationTest.java
@@ -16,16 +16,20 @@
  */
 package org.apache.accumulo.core.iterators.aggregation;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
 
 import org.apache.accumulo.core.data.Value;
 import org.apache.log4j.Logger;
+import org.junit.Test;
 
 /**
  * @deprecated since 1.4
  */
 @Deprecated
-public class NumSummationTest extends TestCase {
+public class NumSummationTest {
 
   private static final Logger log = Logger.getLogger(NumSummationTest.class);
 
@@ -36,6 +40,7 @@ public class NumSummationTest extends TestCase {
     return b;
   }
 
+  @Test
   public void test1() {
     try {
       long[] la = {1l, 2l, 3l};
@@ -51,6 +56,7 @@ public class NumSummationTest extends TestCase {
     }
   }
 
+  @Test
   public void test2() {
     try {
       NumArraySummation nas = new NumArraySummation();
@@ -73,6 +79,7 @@ public class NumSummationTest extends TestCase {
     }
   }
 
+  @Test
   public void test3() {
     try {
       NumArraySummation nas = new NumArraySummation();
@@ -92,6 +99,7 @@ public class NumSummationTest extends TestCase {
     }
   }
 
+  @Test
   public void test4() {
     try {
       long l = 5l;
@@ -104,6 +112,7 @@ public class NumSummationTest extends TestCase {
     }
   }
 
+  @Test
   public void test5() {
     try {
       NumSummation ns = new NumSummation();
@@ -132,8 +141,8 @@ public class NumSummationTest extends TestCase {
       ns.reset();
       l = NumSummation.bytesToLong(ns.aggregate().get());
       assertTrue("l was " + l, l == 0);
-    } catch (Exception e) {
-      assertTrue(false);
+    } catch (IOException | RuntimeException e) {
+      fail();
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java b/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java
index 32d5f62..60464a6 100644
--- a/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java
@@ -54,7 +54,9 @@ public class LocalityGroupUtilTest {
       conf.set("table.groups.enabled", "lg1,lg2");
       LocalityGroupUtil.getLocalityGroups(conf);
       fail();
-    } catch (LocalityGroupConfigurationError err) {}
+    } catch (LocalityGroupConfigurationError err) {
+      // expected, ignore
+    }
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java b/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java
index 64a3f1b..4745ad3 100644
--- a/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java
@@ -82,6 +82,6 @@ public class HexFormatterTest {
     data.put(new Key("", "", "", now), new Value());
     formatter.initialize(data.entrySet(), true);
     String entry = formatter.next().split("\\s+")[2];
-    assertEquals(now, Long.valueOf(entry).longValue());
+    assertEquals(now, Long.parseLong(entry));
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/examples/simple/src/main/findbugs/exclude-filter.xml
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/findbugs/exclude-filter.xml b/examples/simple/src/main/findbugs/exclude-filter.xml
index c801230..0ce1597 100644
--- a/examples/simple/src/main/findbugs/exclude-filter.xml
+++ b/examples/simple/src/main/findbugs/exclude-filter.xml
@@ -15,4 +15,9 @@
   limitations under the License.
 -->
 <FindBugsFilter>
+  <Match>
+    <!-- example classes can call System.exit -->
+    <Class name="org.apache.accumulo.examples.simple.isolation.InterferenceTest$Writer" />
+    <Bug code="DM" pattern="DM_EXIT" />
+  </Match>
 </FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
index e984f1e..657ceb4 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.examples.simple.client;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.apache.accumulo.examples.simple.client.RandomBatchWriter.abs;
 
 import java.util.Arrays;
@@ -63,7 +64,7 @@ class CountingVerifyingReceiver {
     byte expectedValue[] = RandomBatchWriter.createValue(rowid, expectedValueSize);
 
     if (!Arrays.equals(expectedValue, value.get())) {
-      log.error("Got unexpected value for " + key + " expected : " + new String(expectedValue) + " got : " + new String(value.get()));
+      log.error("Got unexpected value for " + key + " expected : " + new String(expectedValue, UTF_8) + " got : " + new String(value.get(), UTF_8));
     }
 
     if (!expectedRows.containsKey(key.getRow())) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java
index ba7f9ad..c84835b 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.examples.simple.client;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
@@ -79,20 +81,20 @@ public class RowOperations {
     Text col4 = new Text("4");
 
     // Now we'll add them to the mutations
-    mut1.put(new Text("column"), col1, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-    mut1.put(new Text("column"), col2, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-    mut1.put(new Text("column"), col3, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-    mut1.put(new Text("column"), col4, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-
-    mut2.put(new Text("column"), col1, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-    mut2.put(new Text("column"), col2, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-    mut2.put(new Text("column"), col3, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-    mut2.put(new Text("column"), col4, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-
-    mut3.put(new Text("column"), col1, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-    mut3.put(new Text("column"), col2, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-    mut3.put(new Text("column"), col3, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
-    mut3.put(new Text("column"), col4, System.currentTimeMillis(), new Value("This is the value for this key".getBytes()));
+    mut1.put(new Text("column"), col1, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+    mut1.put(new Text("column"), col2, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+    mut1.put(new Text("column"), col3, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+    mut1.put(new Text("column"), col4, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+
+    mut2.put(new Text("column"), col1, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+    mut2.put(new Text("column"), col2, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+    mut2.put(new Text("column"), col3, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+    mut2.put(new Text("column"), col4, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+
+    mut3.put(new Text("column"), col1, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+    mut3.put(new Text("column"), col2, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+    mut3.put(new Text("column"), col3, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
+    mut3.put(new Text("column"), col4, System.currentTimeMillis(), new Value("This is the value for this key".getBytes(UTF_8)));
 
     // Now we'll make a Batch Writer
     bw = connector.createBatchWriter(table, bwOpts.getBatchWriterConfig());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java
index 5540759..e908a59 100644
--- a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java
+++ b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java
@@ -17,9 +17,11 @@
 package org.apache.accumulo.examples.simple.filedata;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -173,21 +175,25 @@ public class ChunkInputFormatTest {
           e0 = e;
         }
         try {
-          value.read(b);
+          assertFalse(value.read(b) > 0);
           try {
-            assertTrue(false);
+            fail();
           } catch (AssertionError e) {
             e1 = e;
           }
-        } catch (Exception e) {}
+        } catch (Exception e) {
+          // expected, ignore
+        }
         try {
           value.close();
           try {
-            assertTrue(false);
+            fail();
           } catch (AssertionError e) {
             e2 = e;
           }
-        } catch (Exception e) {}
+        } catch (Exception e) {
+          // expected, ignore
+        }
       }
     }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java
index 68af6d8..2cf5332 100644
--- a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java
+++ b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java
@@ -16,13 +16,17 @@
  */
 package org.apache.accumulo.examples.simple.filedata;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map.Entry;
 
-import junit.framework.TestCase;
-
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchWriter;
@@ -42,8 +46,9 @@ import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.core.util.PeekingIterator;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
+import org.junit.Test;
 
-public class ChunkInputStreamTest extends TestCase {
+public class ChunkInputStreamTest {
   private static final Logger log = Logger.getLogger(ChunkInputStream.class);
   List<Entry<Key,Value>> data;
   List<Entry<Key,Value>> baddata;
@@ -103,6 +108,7 @@ public class ChunkInputStreamTest extends TestCase {
     data.add(new KeyValue(new Key(new Text(row), new Text(cf), chunkCQ, new Text(vis)), value.getBytes()));
   }
 
+  @Test
   public void testExceptionOnMultipleSetSourceWithoutClose() throws IOException {
     ChunkInputStream cis = new ChunkInputStream();
     PeekingIterator<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(data.iterator());
@@ -110,13 +116,14 @@ public class ChunkInputStreamTest extends TestCase {
     cis.setSource(pi);
     try {
       cis.setSource(pi);
-      assertNotNull(null);
+      fail();
     } catch (IOException e) {
       assertNull(null);
     }
     cis.close();
   }
 
+  @Test
   public void testExceptionOnGetVisBeforeClose() throws IOException {
     ChunkInputStream cis = new ChunkInputStream();
     PeekingIterator<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(data.iterator());
@@ -132,6 +139,7 @@ public class ChunkInputStreamTest extends TestCase {
     cis.getVisibilities();
   }
 
+  @Test
   public void testReadIntoBufferSmallerThanChunks() throws IOException {
     ChunkInputStream cis = new ChunkInputStream();
     byte[] b = new byte[5];
@@ -183,6 +191,7 @@ public class ChunkInputStreamTest extends TestCase {
     assertFalse(pi.hasNext());
   }
 
+  @Test
   public void testReadIntoBufferLargerThanChunks() throws IOException {
     ChunkInputStream cis = new ChunkInputStream();
     byte[] b = new byte[20];
@@ -221,6 +230,7 @@ public class ChunkInputStreamTest extends TestCase {
     assertFalse(pi.hasNext());
   }
 
+  @Test
   public void testWithAccumulo() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException, IOException {
     Connector conn = new MockInstance().getConnector("root", new PasswordToken(""));
     conn.tableOperations().create("test");
@@ -275,24 +285,25 @@ public class ChunkInputStreamTest extends TestCase {
 
   private static void assumeExceptionOnRead(ChunkInputStream cis, byte[] b) {
     try {
-      cis.read(b);
-      assertNotNull(null);
+      assertEquals(0, cis.read(b));
+      fail();
     } catch (IOException e) {
       log.debug("EXCEPTION " + e.getMessage());
-      assertNull(null);
+      // expected, ignore
     }
   }
 
   private static void assumeExceptionOnClose(ChunkInputStream cis) {
     try {
       cis.close();
-      assertNotNull(null);
+      fail();
     } catch (IOException e) {
       log.debug("EXCEPTION " + e.getMessage());
-      assertNull(null);
+      // expected, ignore
     }
   }
 
+  @Test
   public void testBadData() throws IOException {
     ChunkInputStream cis = new ChunkInputStream();
     byte[] b = new byte[20];
@@ -329,9 +340,9 @@ public class ChunkInputStreamTest extends TestCase {
 
     try {
       cis.setSource(pi);
-      assertNotNull(null);
+      fail();
     } catch (IOException e) {
-      assertNull(null);
+      // expected, ignore
     }
     assumeExceptionOnClose(cis);
     assertEquals(cis.getVisibilities().toString(), "[K]");
@@ -348,6 +359,7 @@ public class ChunkInputStreamTest extends TestCase {
     assumeExceptionOnClose(cis);
   }
 
+  @Test
   public void testBadDataWithoutClosing() throws IOException {
     ChunkInputStream cis = new ChunkInputStream();
     byte[] b = new byte[20];
@@ -380,9 +392,9 @@ public class ChunkInputStreamTest extends TestCase {
 
     try {
       cis.setSource(pi);
-      assertNotNull(null);
+      fail();
     } catch (IOException e) {
-      assertNull(null);
+      // expected, ignore
     }
     assertEquals(cis.getVisibilities().toString(), "[K]");
 
@@ -398,6 +410,7 @@ public class ChunkInputStreamTest extends TestCase {
     assumeExceptionOnClose(cis);
   }
 
+  @Test
   public void testMultipleChunkSizes() throws IOException {
     ChunkInputStream cis = new ChunkInputStream();
     byte[] b = new byte[20];
@@ -426,6 +439,7 @@ public class ChunkInputStreamTest extends TestCase {
     assertFalse(pi.hasNext());
   }
 
+  @Test
   public void testSingleByteRead() throws IOException {
     ChunkInputStream cis = new ChunkInputStream();
     PeekingIterator<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(data.iterator());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/fate/src/main/findbugs/exclude-filter.xml
----------------------------------------------------------------------
diff --git a/fate/src/main/findbugs/exclude-filter.xml b/fate/src/main/findbugs/exclude-filter.xml
index c801230..249da12 100644
--- a/fate/src/main/findbugs/exclude-filter.xml
+++ b/fate/src/main/findbugs/exclude-filter.xml
@@ -15,4 +15,9 @@
   limitations under the License.
 -->
 <FindBugsFilter>
+  <Match>
+    <!-- admin classes can call System.exit -->
+    <Class name="org.apache.accumulo.fate.AdminUtil" />
+    <Bug code="DM" pattern="DM_EXIT" />
+  </Match>
 </FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/maven-plugin/src/main/java/org/apache/accumulo/maven/plugin/StartMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugin/src/main/java/org/apache/accumulo/maven/plugin/StartMojo.java b/maven-plugin/src/main/java/org/apache/accumulo/maven/plugin/StartMojo.java
index 42d4145..2eb41e0 100644
--- a/maven-plugin/src/main/java/org/apache/accumulo/maven/plugin/StartMojo.java
+++ b/maven-plugin/src/main/java/org/apache/accumulo/maven/plugin/StartMojo.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.maven.plugin;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
@@ -60,7 +61,8 @@ public class StartMojo extends AbstractAccumuloMojo {
       subdir = subdir.getCanonicalFile();
       if (subdir.exists())
         FileUtils.forceDelete(subdir);
-      subdir.mkdirs();
+      if (!subdir.mkdirs() && !subdir.isDirectory())
+        throw new IOException(subdir + " cannot be created as a directory");
       MiniAccumuloConfigImpl cfg = new MiniAccumuloConfigImpl(subdir, rootPassword);
       cfg.setInstanceName(instanceName);
       configureMiniClasspath(cfg, miniClasspath);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index 608618c..411c5e0 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -360,24 +360,24 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
 
     this.config = config.initialize();
 
-    config.getConfDir().mkdirs();
-    config.getLogDir().mkdirs();
-    config.getLibDir().mkdirs();
-    config.getLibExtDir().mkdirs();
+    mkdirs(config.getConfDir());
+    mkdirs(config.getLogDir());
+    mkdirs(config.getLibDir());
+    mkdirs(config.getLibExtDir());
 
     if (!config.useExistingInstance()) {
-      config.getZooKeeperDir().mkdirs();
-      config.getWalogDir().mkdirs();
-      config.getAccumuloDir().mkdirs();
+      mkdirs(config.getZooKeeperDir());
+      mkdirs(config.getWalogDir());
+      mkdirs(config.getAccumuloDir());
     }
 
     if (config.useMiniDFS()) {
       File nn = new File(config.getAccumuloDir(), "nn");
-      nn.mkdirs();
+      mkdirs(nn);
       File dn = new File(config.getAccumuloDir(), "dn");
-      dn.mkdirs();
+      mkdirs(dn);
       File dfs = new File(config.getAccumuloDir(), "dfs");
-      dfs.mkdirs();
+      mkdirs(dfs);
       Configuration conf = new Configuration();
       conf.set(DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY, nn.getAbsolutePath());
       conf.set(DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY, dn.getAbsolutePath());
@@ -449,6 +449,12 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
     clusterControl = new MiniAccumuloClusterControl(this);
   }
 
+  private static void mkdirs(File dir) {
+    if (!dir.mkdirs()) {
+      log.warn("Unable to create {}", dir);
+    }
+  }
+
   private void writeConfig(File file, Iterable<Map.Entry<String,String>> settings) throws IOException {
     FileWriter fileWriter = new FileWriter(file);
     fileWriter.append("<configuration>\n");
@@ -802,7 +808,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
       return new Path("/tmp/");
     } else {
       File tmp = new File(config.getDir(), "tmp");
-      tmp.mkdirs();
+      mkdirs(tmp);
       return new Path(tmp.toString());
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
index 10bb08a..5ca7bc8 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.minicluster;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 import java.io.IOException;
 
@@ -39,10 +41,10 @@ public class MiniAccumuloClusterStartStopTest {
 
   @Before
   public void setupTestCluster() throws IOException {
-    baseDir.mkdirs();
+    assertTrue(baseDir.mkdirs() || baseDir.isDirectory());
     File testDir = new File(baseDir, testName.getMethodName());
     FileUtils.deleteQuietly(testDir);
-    testDir.mkdir();
+    assertTrue(testDir.mkdir());
     accumulo = new MiniAccumuloCluster(testDir, "superSecret");
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
index 9afaab7..d21f957 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.minicluster;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.util.Collections;
@@ -61,10 +62,10 @@ public class MiniAccumuloClusterTest {
   @BeforeClass
   public static void setupMiniCluster() throws Exception {
     File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
-    baseDir.mkdirs();
+    assertTrue(baseDir.mkdirs() || baseDir.isDirectory());
     testDir = new File(baseDir, MiniAccumuloClusterTest.class.getName());
     FileUtils.deleteQuietly(testDir);
-    testDir.mkdir();
+    assertTrue(testDir.mkdir());
 
     MiniAccumuloConfig config = new MiniAccumuloConfig(testDir, "superSecret").setJDWPEnabled(true);
     config.setZooKeeperPort(0);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java
index 3339fb0..439605e 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.minicluster.impl;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 import java.util.Arrays;
 import java.util.Collection;
@@ -59,10 +61,10 @@ public class MiniAccumuloClusterImplTest {
     Logger.getLogger("org.apache.zookeeper").setLevel(Level.ERROR);
 
     File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests");
-    baseDir.mkdirs();
+    assertTrue(baseDir.mkdirs() || baseDir.isDirectory());
     testDir = new File(baseDir, MiniAccumuloClusterImplTest.class.getName());
     FileUtils.deleteQuietly(testDir);
-    testDir.mkdir();
+    assertTrue(testDir.mkdir());
 
     MiniAccumuloConfigImpl config = new MiniAccumuloConfigImpl(testDir, "superSecret").setJDWPEnabled(true);
     // expressly set number of tservers since we assert it later, in case the default changes

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c892b18..e20993f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -528,7 +528,7 @@
             <effort>Max</effort>
             <failOnError>true</failOnError>
             <includeTests>true</includeTests>
-            <maxRank>14</maxRank>
+            <maxRank>16</maxRank>
             <excludeFilterFile>src/main/findbugs/exclude-filter.xml</excludeFilterFile>
           </configuration>
         </plugin>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/8158d39c/proxy/src/main/findbugs/exclude-filter.xml
----------------------------------------------------------------------
diff --git a/proxy/src/main/findbugs/exclude-filter.xml b/proxy/src/main/findbugs/exclude-filter.xml
index ba0aa63..432b1b4 100644
--- a/proxy/src/main/findbugs/exclude-filter.xml
+++ b/proxy/src/main/findbugs/exclude-filter.xml
@@ -17,6 +17,11 @@
 <FindBugsFilter>
   <Match>
     <!-- ignore thrift-generated classes -->
-    <Class name="~org\.apache\.accumulo\.proxy\.thrift\..*" />
+    <Package name="org.apache.accumulo.proxy.thrift" />
+  </Match>
+  <Match>
+    <!-- admin classes can call System.exit -->
+    <Class name="org.apache.accumulo.proxy.Proxy" />
+    <Bug code="DM" pattern="DM_EXIT" />
   </Match>
 </FindBugsFilter>


Mime
View raw message