accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch master updated: Fix warnings from dependency updates (#629)
Date Thu, 06 Sep 2018 21:00:20 GMT
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 7f91e0f  Fix warnings from dependency updates (#629)
7f91e0f is described below

commit 7f91e0f72398334c882c598b110a5a481646ad71
Author: Christopher Tubbs <ctubbsii@apache.org>
AuthorDate: Thu Sep 6 17:00:17 2018 -0400

    Fix warnings from dependency updates (#629)
    
    * Fix warnings from dependencies updated in #614
    * Use UTF_8 static imports consistently
    * Fix null checks in HostAndPort class instead of excluding from spotbugs
    * Fix additional minor compiler warnings from maven command line
---
 .../org/apache/accumulo/core/client/ClientConfiguration.java |  1 -
 .../org/apache/accumulo/core/client/impl/BulkSerialize.java  |  2 +-
 .../accumulo/core/client/sample/AbstractHashSampler.java     | 10 +++++++---
 .../core/client/summary/SummarizerConfiguration.java         |  9 +++++----
 core/src/main/java/org/apache/accumulo/core/data/Value.java  |  3 +--
 .../apache/accumulo/core/sample/impl/DataoutputHasher.java   |  7 ++++---
 .../apache/accumulo/core/security/crypto/CryptoUtils.java    |  4 ----
 .../main/java/org/apache/accumulo/core/summary/Gatherer.java |  9 ++++-----
 .../main/java/org/apache/accumulo/core/util/HostAndPort.java |  6 ++----
 core/src/main/spotbugs/exclude-filter.xml                    |  4 ----
 .../java/org/apache/accumulo/core/conf/PropertyTypeTest.java |  2 +-
 .../java/org/apache/accumulo/core/data/KeyBuilderTest.java   | 11 +++++------
 .../java/org/apache/accumulo/core/file/rfile/RFileTest.java  |  4 ++--
 .../main/java/org/apache/accumulo/server/fs/VolumeUtil.java  |  2 +-
 .../org/apache/accumulo/server/util/TServerUtilsTest.java    |  3 +++
 .../src/main/java/org/apache/accumulo/master/MasterTime.java | 12 +++++-------
 shell/src/main/java/org/apache/accumulo/shell/Shell.java     |  4 ++--
 .../shell/commands/ShellPluginConfigurationCommand.java      |  4 ++--
 .../test/java/org/apache/accumulo/shell/ShellUtilTest.java   |  4 ++--
 .../main/java/org/apache/accumulo/test/ShellServerIT.java    |  1 -
 20 files changed, 47 insertions(+), 55 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
index 4ee1984..6ada3cb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
@@ -528,7 +528,6 @@ public class ClientConfiguration {
     return compositeConfig.containsKey(key);
   }
 
-  @SuppressWarnings("unchecked")
   public Iterator<String> getKeys() {
     return compositeConfig.getKeys();
   }
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/BulkSerialize.java b/core/src/main/java/org/apache/accumulo/core/client/impl/BulkSerialize.java
index e9dec5e..cd86390 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/BulkSerialize.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/BulkSerialize.java
@@ -132,7 +132,7 @@ public class BulkSerialize {
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() throws IOException {
       reader.close();
     }
 
diff --git a/core/src/main/java/org/apache/accumulo/core/client/sample/AbstractHashSampler.java
b/core/src/main/java/org/apache/accumulo/core/client/sample/AbstractHashSampler.java
index d046ebf..e6f9fcd 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/sample/AbstractHashSampler.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/sample/AbstractHashSampler.java
@@ -86,13 +86,17 @@ public abstract class AbstractHashSampler implements Sampler {
         hashFunction = Hashing.murmur3_32();
         break;
       case "md5":
-        hashFunction = Hashing.md5();
+        @SuppressWarnings("deprecation")
+        HashFunction deprecatedMd5 = Hashing.md5();
+        hashFunction = deprecatedMd5;
         break;
       case "sha1":
-        hashFunction = Hashing.sha1();
+        @SuppressWarnings("deprecation")
+        HashFunction deprecatedSha1 = Hashing.sha1();
+        hashFunction = deprecatedSha1;
         break;
       default:
-        throw new IllegalArgumentException("Uknown hahser " + hasherOpt);
+        throw new IllegalArgumentException("Unknown hahser " + hasherOpt);
     }
 
     modulus = Integer.parseInt(modulusOpt);
diff --git a/core/src/main/java/org/apache/accumulo/core/client/summary/SummarizerConfiguration.java
b/core/src/main/java/org/apache/accumulo/core/client/summary/SummarizerConfiguration.java
index 7c396d1..d72fd0f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/summary/SummarizerConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/summary/SummarizerConfiguration.java
@@ -16,7 +16,8 @@
  */
 package org.apache.accumulo.core.client.summary;
 
-import java.nio.charset.StandardCharsets;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -52,10 +53,10 @@ public class SummarizerConfiguration {
       ArrayList<String> keys = new ArrayList<>(this.options.keySet());
       Collections.sort(keys);
       Hasher hasher = Hashing.murmur3_32().newHasher();
-      hasher.putString(className, StandardCharsets.UTF_8);
+      hasher.putString(className, UTF_8);
       for (String key : keys) {
-        hasher.putString(key, StandardCharsets.UTF_8);
-        hasher.putString(options.get(key), StandardCharsets.UTF_8);
+        hasher.putString(key, UTF_8);
+        hasher.putString(options.get(key), UTF_8);
       }
 
       this.configId = hasher.hash().toString();
diff --git a/core/src/main/java/org/apache/accumulo/core/data/Value.java b/core/src/main/java/org/apache/accumulo/core/data/Value.java
index 2e81e15..51767ea 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/Value.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/Value.java
@@ -25,7 +25,6 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 import org.apache.hadoop.io.BytesWritable;
@@ -59,7 +58,7 @@ public class Value implements WritableComparable<Object> {
    * @since 1.8.0
    */
   public Value(CharSequence cs) {
-    this(cs.toString().getBytes(StandardCharsets.UTF_8));
+    this(cs.toString().getBytes(UTF_8));
   }
 
   /**
diff --git a/core/src/main/java/org/apache/accumulo/core/sample/impl/DataoutputHasher.java
b/core/src/main/java/org/apache/accumulo/core/sample/impl/DataoutputHasher.java
index 35a18e2..185de80 100644
--- a/core/src/main/java/org/apache/accumulo/core/sample/impl/DataoutputHasher.java
+++ b/core/src/main/java/org/apache/accumulo/core/sample/impl/DataoutputHasher.java
@@ -17,9 +17,10 @@
 
 package org.apache.accumulo.core.sample.impl;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 import java.io.DataOutput;
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 
 import com.google.common.hash.Hasher;
 
@@ -96,13 +97,13 @@ public class DataoutputHasher implements DataOutput {
 
   @Override
   public void writeChars(String s) throws IOException {
-    hasher.putString(s, StandardCharsets.UTF_8);
+    hasher.putString(s, UTF_8);
 
   }
 
   @Override
   public void writeUTF(String s) throws IOException {
     hasher.putInt(s.length());
-    hasher.putBytes(s.getBytes(StandardCharsets.UTF_8));
+    hasher.putBytes(s.getBytes(UTF_8));
   }
 }
diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/CryptoUtils.java
b/core/src/main/java/org/apache/accumulo/core/security/crypto/CryptoUtils.java
index 8cd6567..8477ae5 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/crypto/CryptoUtils.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/CryptoUtils.java
@@ -26,13 +26,9 @@ import java.util.Objects;
 
 import org.apache.accumulo.core.spi.crypto.CryptoService.CryptoException;
 import org.apache.commons.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class CryptoUtils {
 
-  private static final Logger log = LoggerFactory.getLogger(CryptoUtils.class);
-
   public static SecureRandom newSha1SecureRandom() {
     return newSecureRandom("SHA1PRNG", "SUN");
   }
diff --git a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
index f5aaee6..928a922 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
@@ -17,7 +17,8 @@
 
 package org.apache.accumulo.core.summary;
 
-import java.nio.charset.StandardCharsets;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -208,8 +209,7 @@ public class Gatherer {
 
         // When no location, the approach below will consistently choose the same tserver
for the
         // same file (as long as the set of tservers is stable).
-        int idx = Math
-            .abs(Hashing.murmur3_32().hashString(entry.getKey(), StandardCharsets.UTF_8).asInt())
+        int idx = Math.abs(Hashing.murmur3_32().hashString(entry.getKey(), UTF_8).asInt())
             % tservers.size();
         location = tservers.get(idx);
       }
@@ -359,8 +359,7 @@ public class Gatherer {
     private synchronized void initiateProcessing(ProcessedFiles previousWork) {
       try {
         Predicate<String> fileSelector = file -> Math
-            .abs(Hashing.murmur3_32().hashString(file, StandardCharsets.UTF_8).asInt())
-            % modulus == remainder;
+            .abs(Hashing.murmur3_32().hashString(file, UTF_8).asInt()) % modulus == remainder;
         if (previousWork != null) {
           fileSelector = fileSelector.and(previousWork.failedFiles::contains);
         }
diff --git a/core/src/main/java/org/apache/accumulo/core/util/HostAndPort.java b/core/src/main/java/org/apache/accumulo/core/util/HostAndPort.java
index 43417f9..f0b133f 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/HostAndPort.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/HostAndPort.java
@@ -19,8 +19,6 @@ import static com.google.common.base.Preconditions.checkState;
 
 import java.io.Serializable;
 
-import com.google.common.base.Strings;
-
 /**
  * This class was copied from Guava release 23.0 to replace the older Guava 14 version that
had been
  * used in Accumulo. It was annotated as Beta by Google, therefore unstable to use in a core
@@ -144,7 +142,7 @@ public final class HostAndPort implements Serializable {
    *           if nothing meaningful could be parsed.
    */
   public static HostAndPort fromString(String hostPortString) {
-    java.util.Objects.requireNonNull(hostPortString);
+    hostPortString = java.util.Objects.requireNonNull(hostPortString);
     String host;
     String portString = null;
     boolean hasBracketlessColons = false;
@@ -167,7 +165,7 @@ public final class HostAndPort implements Serializable {
     }
 
     int port = NO_PORT;
-    if (!Strings.isNullOrEmpty(portString)) {
+    if (portString != null && !portString.trim().isEmpty()) {
       // Try to parse the whole port string as a number.
       // JDK7 accepts leading plus signs. We don't want to.
       checkArgument(!portString.startsWith("+"), "Unparseable port number: %s", hostPortString);
diff --git a/core/src/main/spotbugs/exclude-filter.xml b/core/src/main/spotbugs/exclude-filter.xml
index 39025c9..5aa5421 100644
--- a/core/src/main/spotbugs/exclude-filter.xml
+++ b/core/src/main/spotbugs/exclude-filter.xml
@@ -205,8 +205,4 @@
     <Class name="org.apache.accumulo.core.client.impl.ScannerOptionsTest" />
     <Bug code="NP" pattern="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS" />
   </Match>
-  <Match>
-    <Class name="org.apache.accumulo.core.util.HostAndPort" />
-    <Bug code="NP" pattern="NP_NULL_PARAM_DEREF" />
-  </Match>
 </FindBugsFilter>
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTypeTest.java b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTypeTest.java
index e0bcecf..44bf032 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTypeTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTypeTest.java
@@ -68,7 +68,7 @@ public class PropertyTypeTest {
   public void testFullCoverage() {
     // This test checks the remainder of the methods in this class to ensure each property
type has
     // a corresponding test
-    Stream<String> types = Arrays.stream(PropertyType.values()).map(Enum::name);
+    Stream<String> types = Arrays.stream(PropertyType.values()).map(Enum<PropertyType>::name);
 
     List<String> typesTested = Arrays.stream(this.getClass().getMethods()).map(m ->
m.getName())
         .filter(m -> m.startsWith("testType")).map(m -> m.substring(8))
diff --git a/core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java b/core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java
index 5a3d613..5182699 100644
--- a/core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/data/KeyBuilderTest.java
@@ -16,12 +16,11 @@
  */
 package org.apache.accumulo.core.data;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertSame;
 
-import java.nio.charset.StandardCharsets;
-
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
@@ -29,10 +28,10 @@ import org.junit.Test;
 public class KeyBuilderTest {
 
   private static final byte EMPTY_BYTES[] = new byte[0];
-  byte[] rowBytes = "row".getBytes(StandardCharsets.UTF_8);
-  byte[] familyBytes = "family".getBytes(StandardCharsets.UTF_8);
-  byte[] qualifierBytes = "qualifier".getBytes(StandardCharsets.UTF_8);
-  byte[] visibilityBytes = "visibility".getBytes(StandardCharsets.UTF_8);
+  byte[] rowBytes = "row".getBytes(UTF_8);
+  byte[] familyBytes = "family".getBytes(UTF_8);
+  byte[] qualifierBytes = "qualifier".getBytes(UTF_8);
+  byte[] visibilityBytes = "visibility".getBytes(UTF_8);
   Text rowText = new Text(rowBytes);
   Text familyText = new Text(familyBytes);
   Text qualifierText = new Text(qualifierBytes);
diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
index 9f69c8d..95f0135 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
@@ -2050,7 +2050,7 @@ public class RFileTest {
       RFile.setSampleBufferSize(sampleBufferSize);
 
       for (int modulus : new int[] {19, 103, 1019}) {
-        Hasher dataHasher = Hashing.md5().newHasher();
+        Hasher dataHasher = Hashing.sha512().newHasher();
         List<Entry<Key,Value>> sampleData = new ArrayList<>();
 
         ConfigurationCopy sampleConf = new ConfigurationCopy(
@@ -2115,7 +2115,7 @@ public class RFileTest {
   }
 
   private HashCode hash(SortedKeyValueIterator<Key,Value> iter) throws IOException
{
-    Hasher dataHasher = Hashing.md5().newHasher();
+    Hasher dataHasher = Hashing.sha512().newHasher();
     iter.seek(new Range(), EMPTY_COL_FAMS, false);
     while (iter.hasTop()) {
       hash(dataHasher, iter.getTopKey(), iter.getTopValue());
diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java
index fe47737..d676af5 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java
@@ -373,7 +373,7 @@ public class VolumeUtil {
 
   private static String hash(FileSystem fs, Path dir, String name) throws IOException {
     try (FSDataInputStream in = fs.open(new Path(dir, name))) {
-      return DigestUtils.sha256Hex(in);
+      return DigestUtils.sha512Hex(in);
     }
 
   }
diff --git a/server/base/src/test/java/org/apache/accumulo/server/util/TServerUtilsTest.java
b/server/base/src/test/java/org/apache/accumulo/server/util/TServerUtilsTest.java
index 374c07d..7c55ea9 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/util/TServerUtilsTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/util/TServerUtilsTest.java
@@ -197,6 +197,7 @@ public class TServerUtilsTest {
     ((ConfigurationCopy) factory.getSystemConfiguration()).set(Property.TSERV_CLIENTPORT,
         Integer.toString(port));
     try (ServerSocket s = new ServerSocket(port, 50, addr)) {
+      assertNotNull(s);
       startServer();
     }
   }
@@ -211,6 +212,7 @@ public class TServerUtilsTest {
         Integer.toString(port[0]));
     ((ConfigurationCopy) factory.getSystemConfiguration()).set(Property.TSERV_PORTSEARCH,
"true");
     try (ServerSocket s = new ServerSocket(port[0], 50, addr)) {
+      assertNotNull(s);
       ServerAddress address = startServer();
       assertNotNull(address);
       server = address.getServer();
@@ -255,6 +257,7 @@ public class TServerUtilsTest {
     ((ConfigurationCopy) factory.getSystemConfiguration()).set(Property.TSERV_CLIENTPORT,
         portRange);
     try (ServerSocket s = new ServerSocket(port[0], 50, addr)) {
+      assertNotNull(s);
       ServerAddress address = startServer();
       assertNotNull(address);
       server = address.getServer();
diff --git a/server/master/src/main/java/org/apache/accumulo/master/MasterTime.java b/server/master/src/main/java/org/apache/accumulo/master/MasterTime.java
index 240670c..37cc739 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/MasterTime.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/MasterTime.java
@@ -16,12 +16,12 @@
  */
 package org.apache.accumulo.master;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static java.util.concurrent.TimeUnit.NANOSECONDS;
 import static java.util.concurrent.TimeUnit.SECONDS;
 
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 import java.util.Timer;
 import java.util.TimerTask;
 
@@ -54,9 +54,8 @@ public class MasterTime extends TimerTask {
     this.master = master;
 
     try {
-      zk.putPersistentData(zPath, "0".getBytes(StandardCharsets.UTF_8), NodeExistsPolicy.SKIP);
-      skewAmount = Long.parseLong(new String(zk.getData(zPath, null), StandardCharsets.UTF_8))
-          - System.nanoTime();
+      zk.putPersistentData(zPath, "0".getBytes(UTF_8), NodeExistsPolicy.SKIP);
+      skewAmount = Long.parseLong(new String(zk.getData(zPath, null), UTF_8)) - System.nanoTime();
     } catch (Exception ex) {
       throw new IOException("Error updating master time", ex);
     }
@@ -88,7 +87,7 @@ public class MasterTime extends TimerTask {
       case INITIAL:
       case STOP:
         try {
-          long zkTime = Long.parseLong(new String(zk.getData(zPath, null), StandardCharsets.UTF_8));
+          long zkTime = Long.parseLong(new String(zk.getData(zPath, null), UTF_8));
           synchronized (this) {
             skewAmount = zkTime - System.nanoTime();
           }
@@ -105,8 +104,7 @@ public class MasterTime extends TimerTask {
       case UNLOAD_METADATA_TABLETS:
       case UNLOAD_ROOT_TABLET:
         try {
-          zk.putPersistentData(zPath,
-              Long.toString(System.nanoTime() + skewAmount).getBytes(StandardCharsets.UTF_8),
+          zk.putPersistentData(zPath, Long.toString(System.nanoTime() + skewAmount).getBytes(UTF_8),
               NodeExistsPolicy.OVERWRITE);
         } catch (Exception ex) {
           if (log.isDebugEnabled()) {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index dc5709c..2871674 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -159,8 +159,8 @@ import org.apache.accumulo.shell.commands.WhoAmICommand;
 import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
 import org.apache.accumulo.start.classloader.vfs.ContextManager;
 import org.apache.accumulo.start.spi.KeywordExecutable;
-import org.apache.commons.cli.BasicParser;
 import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.MissingOptionException;
 import org.apache.commons.cli.Option;
@@ -733,7 +733,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
         Options parseOpts = sc.getOptionsWithHelp();
 
         // Parse the string using the given options
-        CommandLine cl = new BasicParser().parse(parseOpts, fields);
+        CommandLine cl = new DefaultParser().parse(parseOpts, fields);
 
         int actualArgLen = cl.getArgs().length;
         int expectedArgLen = sc.numArgs();
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
b/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
index ac3a959..00f0302 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
@@ -26,8 +26,8 @@ import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.shell.Shell;
 import org.apache.accumulo.shell.Shell.Command;
-import org.apache.commons.cli.BasicParser;
 import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.OptionGroup;
 import org.apache.commons.cli.Options;
@@ -114,7 +114,7 @@ public abstract class ShellPluginConfigurationCommand extends Command
{
           o.addOption(OptUtil.tableOpt());
           args[0] = "-t";
           args[1] = tableName;
-          CommandLine cl = new BasicParser().parse(o, args);
+          CommandLine cl = new DefaultParser().parse(o, args);
           pluginClazz = shellState.getClassLoader(cl, shellState).loadClass(ent.getValue())
               .asSubclass(clazz);
         } catch (ClassNotFoundException e) {
diff --git a/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java b/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
index 9b15956..bf16ea4 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
@@ -48,7 +48,7 @@ public class ShellUtilTest {
   @Test
   public void testWithoutDecode() throws IOException {
     File testFile = new File(folder.getRoot(), "testFileNoDecode.txt");
-    FileUtils.writeStringToFile(testFile, FILEDATA);
+    FileUtils.writeStringToFile(testFile, FILEDATA, UTF_8);
     List<Text> output = ShellUtil.scanFile(testFile.getAbsolutePath(), false);
     assertEquals(ImmutableList.of(new Text("line1"), new Text("line2")), output);
   }
@@ -56,7 +56,7 @@ public class ShellUtilTest {
   @Test
   public void testWithDecode() throws IOException {
     File testFile = new File(folder.getRoot(), "testFileWithDecode.txt");
-    FileUtils.writeStringToFile(testFile, B64_FILEDATA);
+    FileUtils.writeStringToFile(testFile, B64_FILEDATA, UTF_8);
     List<Text> output = ShellUtil.scanFile(testFile.getAbsolutePath(), true);
     assertEquals(ImmutableList.of(new Text("line1"), new Text("line2")), output);
   }
diff --git a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
index 3a98ad4..805ea53 100644
--- a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
@@ -2174,7 +2174,6 @@ public class ShellServerIT extends SharedMiniClusterBase {
     ts.exec("createtable " + table + " -l locg1", false);
     ts.exec("createtable " + table + " group=fam1", false);
     ts.exec("createtable " + table + "-l fam1,fam2", false);
-    ts.exec("createtable " + table + " -local locg1=fam1,fam2", false);
   }
 
   @Test


Mime
View raw message