kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject [12/12] kudu git commit: [java] Fix the high priority spotbugs warings
Date Fri, 27 Apr 2018 03:55:00 GMT
[java] Fix the high priority spotbugs warings

None of these are functional changes.

Change-Id: Ia0f8136627b76cfbc58ab04c744b1731c12853be
Reviewed-on: http://gerrit.cloudera.org:8080/10221
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <todd@apache.org>


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

Branch: refs/heads/master
Commit: 3ee87a00fb4516bc5db298d8acb7cb7e9c15fb4c
Parents: 6a32001
Author: Grant Henke <granthenke@apache.org>
Authored: Thu Apr 26 12:18:23 2018 -0500
Committer: Todd Lipcon <todd@apache.org>
Committed: Thu Apr 26 22:24:13 2018 +0000

----------------------------------------------------------------------
 .../java/org/apache/kudu/mapreduce/tools/ITImportCsv.java | 10 ++++++----
 .../src/main/java/org/apache/kudu/util/ByteVec.java       |  2 +-
 .../test/java/org/apache/kudu/client/TestHybridTime.java  |  2 +-
 .../main/java/org/apache/kudu/mapreduce/JarFinder.java    |  2 +-
 .../java/org/apache/kudu/mapreduce/ITOutputFormatJob.java |  4 +++-
 5 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/3ee87a00/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
----------------------------------------------------------------------
diff --git a/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
b/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
index a641882..43c0f37 100644
--- a/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
+++ b/java/kudu-client-tools/src/test/java/org/apache/kudu/mapreduce/tools/ITImportCsv.java
@@ -42,6 +42,8 @@ import org.apache.kudu.client.CreateTableOptions;
 import org.apache.kudu.mapreduce.CommandLineParser;
 import org.apache.kudu.mapreduce.HadoopTestingUtility;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 public class ITImportCsv extends BaseKuduTest {
 
   private static final String TABLE_NAME =
@@ -116,10 +118,10 @@ public class ITImportCsv extends BaseKuduTest {
 
   private void writeCsvFile(File data) throws IOException {
     FileOutputStream fos = new FileOutputStream(data);
-    fos.write("1\t3\t2.3\tsome string\ttrue\n".getBytes());
-    fos.write("2\t5\t4.5\tsome more\tfalse\n".getBytes());
-    fos.write("3\t7\twait this is not a double\tbad row\ttrue\n".getBytes());
-    fos.write("4\t9\t10\ttrailing separator isn't bad mkay?\ttrue\t\n".getBytes());
+    fos.write("1\t3\t2.3\tsome string\ttrue\n".getBytes(UTF_8));
+    fos.write("2\t5\t4.5\tsome more\tfalse\n".getBytes(UTF_8));
+    fos.write("3\t7\twait this is not a double\tbad row\ttrue\n".getBytes(UTF_8));
+    fos.write("4\t9\t10\ttrailing separator isn't bad mkay?\ttrue\t\n".getBytes(UTF_8));
     fos.close();
   }
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/3ee87a00/java/kudu-client/src/main/java/org/apache/kudu/util/ByteVec.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/util/ByteVec.java b/java/kudu-client/src/main/java/org/apache/kudu/util/ByteVec.java
index a5323a4..2033857 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/util/ByteVec.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/util/ByteVec.java
@@ -34,7 +34,7 @@ import org.apache.yetus.audience.InterfaceAudience;
  */
 @InterfaceAudience.Private
 @NotThreadSafe
-public final class ByteVec {
+public final class ByteVec implements Cloneable {
 
   /** Default initial capacity for new vectors. */
   @InterfaceAudience.LimitedPrivate("Test")

http://git-wip-us.apache.org/repos/asf/kudu/blob/3ee87a00/java/kudu-client/src/test/java/org/apache/kudu/client/TestHybridTime.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestHybridTime.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestHybridTime.java
index a19861c..2e62009 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestHybridTime.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestHybridTime.java
@@ -50,7 +50,7 @@ public class TestHybridTime extends BaseKuduTest {
   protected static final String TABLE_NAME =
     TestHybridTime.class.getName() + "-" + System.currentTimeMillis();
 
-  protected static Schema schema = getSchema();
+  protected static final Schema schema = getSchema();
   protected static KuduTable table;
 
   @BeforeClass

http://git-wip-us.apache.org/repos/asf/kudu/blob/3ee87a00/java/kudu-mapreduce/src/main/java/org/apache/kudu/mapreduce/JarFinder.java
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/src/main/java/org/apache/kudu/mapreduce/JarFinder.java b/java/kudu-mapreduce/src/main/java/org/apache/kudu/mapreduce/JarFinder.java
index 5431fc8..925e855 100644
--- a/java/kudu-mapreduce/src/main/java/org/apache/kudu/mapreduce/JarFinder.java
+++ b/java/kudu-mapreduce/src/main/java/org/apache/kudu/mapreduce/JarFinder.java
@@ -48,7 +48,7 @@ import org.apache.yetus.audience.InterfaceAudience;
 public class JarFinder {
 
   @InterfaceAudience.Private
-  public static String FILE_DIR_PROPERTY = "jar.file.dir";
+  public static final String FILE_DIR_PROPERTY = "jar.file.dir";
 
   private static File fileDir = null;
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/3ee87a00/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
index 06874c2..068219d 100644
--- a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
+++ b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
@@ -42,6 +42,8 @@ import org.apache.kudu.client.KuduTable;
 import org.apache.kudu.client.Operation;
 import org.apache.kudu.client.PartialRow;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 public class ITOutputFormatJob extends BaseKuduTest {
 
   private static final String TABLE_NAME =
@@ -132,7 +134,7 @@ public class ITOutputFormatJob extends BaseKuduTest {
 
   private void writeDataFile(File data) throws IOException {
     FileOutputStream fos = new FileOutputStream(data);
-    fos.write("VALUE1\nVALUE2\n".getBytes());
+    fos.write("VALUE1\nVALUE2\n".getBytes(UTF_8));
     fos.close();
   }
 }


Mime
View raw message