hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [2/4] hbase git commit: HBASE-19497 Fix findbugs and error-prone warnings in hbase-common (branch-2) Signed-off-by: Apekshit Sharma <appy@apache.org>
Date Sat, 16 Dec 2017 00:17:00 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringFixedLength.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringFixedLength.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringFixedLength.java
index 431b25f..e8b99bd 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringFixedLength.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringFixedLength.java
@@ -17,8 +17,8 @@
  */
 package org.apache.hadoop.hbase.types;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.util.Order;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * An {@code DataType} that encodes fixed-length values encoded using

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringTerminated.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringTerminated.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringTerminated.java
index 6a4a2e7..397f443 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringTerminated.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/RawStringTerminated.java
@@ -17,8 +17,8 @@
  */
 package org.apache.hadoop.hbase.types;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.util.Order;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * An {@code DataType} that encodes variable-length values encoded using

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Struct.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Struct.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Struct.java
index a06c175..793c910 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Struct.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Struct.java
@@ -19,9 +19,9 @@ package org.apache.hadoop.hbase.types;
 
 import java.util.Iterator;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.util.Order;
 import org.apache.hadoop.hbase.util.PositionedByteRange;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * <p>
@@ -102,41 +102,56 @@ public class Struct implements DataType<Object[]> {
     boolean skippable = true;
     for (int i = 0; i < this.fields.length; i++) {
       DataType dt = this.fields[i];
-      if (!dt.isOrderPreserving()) preservesOrder = false;
+      if (!dt.isOrderPreserving()) {
+        preservesOrder = false;
+      }
       if (i < this.fields.length - 2 && !dt.isSkippable()) {
         throw new IllegalArgumentException("Field in position " + i
           + " is not skippable. Non-right-most struct fields must be skippable.");
       }
-      if (!dt.isSkippable()) skippable = false;
+      if (!dt.isSkippable()) {
+        skippable = false;
+      }
     }
     this.isOrderPreserving = preservesOrder;
     this.isSkippable = skippable;
   }
 
   @Override
-  public boolean isOrderPreserving() { return isOrderPreserving; }
+  public boolean isOrderPreserving() {
+    return isOrderPreserving;
+  }
 
   @Override
-  public Order getOrder() { return null; }
+  public Order getOrder() {
+    return null;
+  }
 
   @Override
-  public boolean isNullable() { return false; }
+  public boolean isNullable() {
+    return false;
+  }
 
   @Override
-  public boolean isSkippable() { return isSkippable; }
+  public boolean isSkippable() {
+    return isSkippable;
+  }
 
   @SuppressWarnings("unchecked")
   @Override
   public int encodedLength(Object[] val) {
     assert fields.length >= val.length;
     int sum = 0;
-    for (int i = 0; i < val.length; i++)
+    for (int i = 0; i < val.length; i++) {
       sum += fields[i].encodedLength(val[i]);
+    }
     return sum;
   }
 
   @Override
-  public Class<Object[]> encodedClass() { return Object[].class; }
+  public Class<Object[]> encodedClass() {
+    return Object[].class;
+  }
 
   /**
    * Retrieve an {@link Iterator} over the values encoded in {@code src}.
@@ -150,8 +165,9 @@ public class Struct implements DataType<Object[]> {
   public int skip(PositionedByteRange src) {
     StructIterator it = iterator(src);
     int skipped = 0;
-    while (it.hasNext())
+    while (it.hasNext()) {
       skipped += it.skip();
+    }
     return skipped;
   }
 
@@ -160,8 +176,9 @@ public class Struct implements DataType<Object[]> {
     int i = 0;
     Object[] ret = new Object[fields.length];
     Iterator<Object> it = iterator(src);
-    while (it.hasNext())
+    while (it.hasNext()) {
       ret[i++] = it.next();
+    }
     return ret;
   }
 
@@ -171,20 +188,25 @@ public class Struct implements DataType<Object[]> {
   public Object decode(PositionedByteRange src, int index) {
     assert index >= 0;
     StructIterator it = iterator(src.shallowCopy());
-    for (; index > 0; index--)
+    for (; index > 0; index--) {
       it.skip();
+    }
     return it.next();
   }
 
   @SuppressWarnings("unchecked")
   @Override
   public int encode(PositionedByteRange dst, Object[] val) {
-    if (val.length == 0) return 0;
+    if (val.length == 0) {
+      return 0;
+    }
     assert fields.length >= val.length;
     int end, written = 0;
     // find the last occurrence of a non-null or null and non-nullable value
     for (end = val.length - 1; end > -1; end--) {
-      if (null != val[end] || (null == val[end] && !fields[end].isNullable())) break;
+      if (null != val[end] || (null == val[end] && !fields[end].isNullable())) {
+        break;
+      }
     }
     for (int i = 0; i <= end; i++) {
       written += fields[i].encode(dst, val[i]);

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructBuilder.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructBuilder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructBuilder.java
index d49b784..98511af 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructBuilder.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructBuilder.java
@@ -38,15 +38,23 @@ public class StructBuilder {
   /**
    * Append {@code field} to the sequence of accumulated fields.
    */
-  public StructBuilder add(DataType<?> field) { fields.add(field); return this; }
+  public StructBuilder add(DataType<?> field) {
+    fields.add(field);
+    return this;
+  }
 
   /**
    * Retrieve the {@link Struct} represented by {@code this}.
    */
-  public Struct toStruct() { return new Struct(fields.toArray(new DataType<?>[fields.size()])); }
+  public Struct toStruct() {
+    return new Struct(fields.toArray(new DataType<?>[fields.size()]));
+  }
 
   /**
    * Reset the sequence of accumulated fields.
    */
-  public StructBuilder reset() { fields.clear(); return this; }
+  public StructBuilder reset() {
+    fields.clear();
+    return this;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructIterator.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructIterator.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructIterator.java
index 3227e3b..e6226a5 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructIterator.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/StructIterator.java
@@ -20,8 +20,8 @@ package org.apache.hadoop.hbase.types;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.util.PositionedByteRange;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * An {@link Iterator} over encoded {@code Struct} members.
@@ -73,13 +73,19 @@ public class StructIterator implements Iterator<Object> {
   }
 
   @Override
-  public void remove() { throw new UnsupportedOperationException(); }
+  public void remove() {
+    throw new UnsupportedOperationException();
+  }
 
   @Override
   public Object next() {
-    if (!hasNext()) throw new NoSuchElementException();
+    if (!hasNext()) {
+      throw new NoSuchElementException();
+    }
     DataType<?> t = types[idx++];
-    if (src.getPosition() == src.getLength() && t.isNullable()) return null;
+    if (src.getPosition() == src.getLength() && t.isNullable()) {
+      return null;
+    }
     return t.decode(src);
   }
 
@@ -88,9 +94,13 @@ public class StructIterator implements Iterator<Object> {
    * @return the number of bytes skipped.
    */
   public int skip() {
-    if (!hasNext()) throw new NoSuchElementException();
+    if (!hasNext()) {
+      throw new NoSuchElementException();
+    }
     DataType<?> t = types[idx++];
-    if (src.getPosition() == src.getLength() && t.isNullable()) return 0;
+    if (src.getPosition() == src.getLength() && t.isNullable()) {
+      return 0;
+    }
     return t.skip(src);
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/types/TerminatedWrapper.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/TerminatedWrapper.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/TerminatedWrapper.java
index 17ff6f4..dcd6b84 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/TerminatedWrapper.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/TerminatedWrapper.java
@@ -17,11 +17,11 @@
  */
 package org.apache.hadoop.hbase.types;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Order;
 import org.apache.hadoop.hbase.util.PositionedByteRange;
 import org.apache.hadoop.hbase.util.SimplePositionedMutableByteRange;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * Wraps an existing {@code DataType} implementation as a terminated
@@ -40,8 +40,9 @@ public class TerminatedWrapper<T> implements DataType<T> {
    * @throws IllegalArgumentException when {@code term} is null or empty.
    */
   public TerminatedWrapper(DataType<T> wrapped, byte[] term) {
-    if (null == term || term.length == 0)
+    if (null == term || term.length == 0) {
       throw new IllegalArgumentException("terminator must be non-null and non-empty.");
+    }
     this.wrapped = wrapped;
     wrapped.getOrder().apply(term);
     this.term = term;
@@ -58,16 +59,24 @@ public class TerminatedWrapper<T> implements DataType<T> {
   }
 
   @Override
-  public boolean isOrderPreserving() { return wrapped.isOrderPreserving(); }
+  public boolean isOrderPreserving() {
+    return wrapped.isOrderPreserving();
+  }
 
   @Override
-  public Order getOrder() { return wrapped.getOrder(); }
+  public Order getOrder() {
+    return wrapped.getOrder();
+  }
 
   @Override
-  public boolean isNullable() { return wrapped.isNullable(); }
+  public boolean isNullable() {
+    return wrapped.isNullable();
+  }
 
   @Override
-  public boolean isSkippable() { return true; }
+  public boolean isSkippable() {
+    return true;
+  }
 
   @Override
   public int encodedLength(T val) {
@@ -75,7 +84,9 @@ public class TerminatedWrapper<T> implements DataType<T> {
   }
 
   @Override
-  public Class<T> encodedClass() { return wrapped.encodedClass(); }
+  public Class<T> encodedClass() {
+    return wrapped.encodedClass();
+  }
 
   /**
    * Return the position at which {@code term} begins within {@code src},
@@ -86,12 +97,18 @@ public class TerminatedWrapper<T> implements DataType<T> {
     final int offset = src.getOffset();
     int i;
     SKIP: for (i = src.getPosition(); i < src.getLength(); i++) {
-      if (a[offset + i] != term[0]) continue;
+      if (a[offset + i] != term[0]) {
+        continue;
+      }
       int j;
       for (j = 1; j < term.length && offset + j < src.getLength(); j++) {
-        if (a[offset + i + j] != term[j]) continue SKIP;
+        if (a[offset + i + j] != term[j]) {
+          continue SKIP;
+        }
+      }
+      if (j == term.length) {
+        return i; // success
       }
-      if (j == term.length) return i; // success
     }
     return -1;
   }
@@ -112,7 +129,9 @@ public class TerminatedWrapper<T> implements DataType<T> {
       // find the terminator position
       final int start = src.getPosition();
       int skipped = terminatorPosition(src);
-      if (-1 == skipped) throw new IllegalArgumentException("Terminator sequence not found.");
+      if (-1 == skipped) {
+        throw new IllegalArgumentException("Terminator sequence not found.");
+      }
       skipped += term.length;
       src.setPosition(skipped);
       return skipped - start;
@@ -128,7 +147,9 @@ public class TerminatedWrapper<T> implements DataType<T> {
     } else {
       // find the terminator position
       int term = terminatorPosition(src);
-      if (-1 == term) throw new IllegalArgumentException("Terminator sequence not found.");
+      if (-1 == term) {
+        throw new IllegalArgumentException("Terminator sequence not found.");
+      }
       byte[] b = new byte[term - src.getPosition()];
       src.get(b);
       // TODO: should we assert that b.position == b.length?

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union2.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union2.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union2.java
index 8dd6b2c..5c9f26d 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union2.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union2.java
@@ -17,9 +17,9 @@
  */
 package org.apache.hadoop.hbase.types;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.util.Order;
 import org.apache.hadoop.hbase.util.PositionedByteRange;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * The {@code Union} family of {@link DataType}s encode one of a fixed
@@ -48,7 +48,9 @@ public abstract class Union2<A, B> implements DataType<Object> {
   }
 
   @Override
-  public Order getOrder() { return null; }
+  public Order getOrder() {
+    return null;
+  }
 
   @Override
   public boolean isNullable() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union3.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union3.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union3.java
index 3b2a606..f489ba2 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union3.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union3.java
@@ -17,9 +17,9 @@
  */
 package org.apache.hadoop.hbase.types;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.util.Order;
 import org.apache.hadoop.hbase.util.PositionedByteRange;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * The {@code Union} family of {@link DataType}s encode one of a fixed
@@ -48,7 +48,9 @@ public abstract class Union3<A, B, C> extends Union2<A, B> {
   }
 
   @Override
-  public Order getOrder() { return null; }
+  public Order getOrder() {
+    return null;
+  }
 
   @Override
   public boolean isNullable() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union4.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union4.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union4.java
index cadea44..c4c814b 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union4.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Union4.java
@@ -17,9 +17,9 @@
  */
 package org.apache.hadoop.hbase.types;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.util.Order;
 import org.apache.hadoop.hbase.util.PositionedByteRange;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * The {@code Union} family of {@link DataType}s encode one of a fixed
@@ -47,7 +47,9 @@ public abstract class Union4<A, B, C, D> extends Union3<A, B, C> {
   }
 
   @Override
-  public Order getOrder() { return null; }
+  public Order getOrder() {
+    return null;
+  }
 
   @Override
   public boolean isNullable() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractByteRange.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractByteRange.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractByteRange.java
index 85b1e4b..60de6cd 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractByteRange.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractByteRange.java
@@ -189,9 +189,9 @@ public abstract class AbstractByteRange implements ByteRange {
   public short getShort(int index) {
     int offset = this.offset + index;
     short n = 0;
-    n ^= bytes[offset] & 0xFF;
-    n <<= 8;
-    n ^= bytes[offset + 1] & 0xFF;
+    n = (short) ((n ^ bytes[offset]) & 0xFF);
+    n = (short) (n << 8);
+    n = (short) ((n ^ bytes[offset + 1]) & 0xFF);
     return n;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java
index e301c1f..21b174e 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java
@@ -36,9 +36,9 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configurable;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * Common base class used for HBase command-line tools. Simplifies workflow and

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Base64.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Base64.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Base64.java
index 7bc4008..91df2d5 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Base64.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Base64.java
@@ -35,6 +35,7 @@ import java.io.ObjectOutputStream;
 import java.io.OutputStream;
 import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
 
@@ -569,7 +570,7 @@ public class Base64 {
       return new String(baos.toByteArray(), PREFERRED_ENCODING);
 
     } catch (UnsupportedEncodingException uue) {
-      return new String(baos.toByteArray());
+      return new String(baos.toByteArray(), StandardCharsets.UTF_8);
 
     } catch (IOException e) {
       LOG.error("error encoding object", e);
@@ -694,7 +695,7 @@ public class Base64 {
         return new String(baos.toByteArray(), PREFERRED_ENCODING);
 
       } catch (UnsupportedEncodingException uue) {
-        return new String(baos.toByteArray());
+        return new String(baos.toByteArray(), StandardCharsets.UTF_8);
 
       } catch (IOException e) {
         LOG.error("error encoding byte array", e);
@@ -751,7 +752,7 @@ public class Base64 {
       return new String(outBuff, 0, e, PREFERRED_ENCODING);
 
     } catch (UnsupportedEncodingException uue) {
-      return new String(outBuff, 0, e);
+      return new String(outBuff, 0, e, StandardCharsets.UTF_8);
     }
   } // end encodeBytes
 
@@ -926,7 +927,7 @@ public class Base64 {
       bytes = s.getBytes(PREFERRED_ENCODING);
 
     } catch (UnsupportedEncodingException uee) {
-      bytes = s.getBytes();
+      bytes = s.getBytes(StandardCharsets.UTF_8);
     } // end catch
 
     // Decode

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
index 2715740..b2e5c9b 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
@@ -28,15 +28,14 @@ import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.nio.ByteBuff;
 import org.apache.hadoop.hbase.nio.MultiByteBuff;
 import org.apache.hadoop.hbase.nio.SingleByteBuff;
 import org.apache.hadoop.util.StringUtils;
-
-import com.google.common.annotations.VisibleForTesting;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * This class manages an array of ByteBuffers with a default size 4MB. These
@@ -237,7 +236,7 @@ public class ByteBufferArray {
     int endBuffer = (int) (end / bufferSize), endOffset = (int) (end % bufferSize);
     assert array.length >= len + arrayOffset;
     assert startBuffer >= 0 && startBuffer < bufferCount;
-    assert endBuffer >= 0 && endBuffer < bufferCount
+    assert (endBuffer >= 0 && endBuffer < bufferCount)
         || (endBuffer == bufferCount && endOffset == 0);
     if (startBuffer >= buffers.length || startBuffer < 0) {
       String msg = "Failed multiple, start=" + start + ",startBuffer="
@@ -285,7 +284,7 @@ public class ByteBufferArray {
       endBufferOffset = bufferSize;
     }
     assert startBuffer >= 0 && startBuffer < bufferCount;
-    assert endBuffer >= 0 && endBuffer < bufferCount
+    assert (endBuffer >= 0 && endBuffer < bufferCount)
         || (endBuffer == bufferCount && endBufferOffset == 0);
     if (startBuffer >= buffers.length || startBuffer < 0) {
       String msg = "Failed subArray, start=" + offset + ",startBuffer=" + startBuffer

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java
index 3fc1a7b..5e6809f 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java
@@ -16,7 +16,6 @@
  */
 package org.apache.hadoop.hbase.util;
 
-import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
 import java.io.ByteArrayOutputStream;
 import java.io.DataInput;
 import java.io.DataInputStream;
@@ -29,14 +28,15 @@ import java.math.BigInteger;
 import java.nio.ByteBuffer;
 import java.util.Arrays;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.io.ByteBufferWriter;
 import org.apache.hadoop.hbase.io.util.StreamUtils;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.io.WritableUtils;
-
+import org.apache.yetus.audience.InterfaceAudience;
 import sun.nio.ch.DirectBuffer;
 
+import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
+
 /**
  * Utility functions for working with byte buffers, such as reading/writing
  * variable-length long numbers.
@@ -245,27 +245,27 @@ public final class ByteBufferUtils {
       return 8;
     }
 
-    if (value < (1l << 4 * 8)) {
+    if (value < (1L << (4 * 8))) {
       // no more than 4 bytes
-      if (value < (1l << 2 * 8)) {
-        if (value < (1l << 1 * 8)) {
+      if (value < (1L << (2 * 8))) {
+        if (value < (1L << (1 * 8))) {
           return 1;
         }
         return 2;
       }
-      if (value < (1l << 3 * 8)) {
+      if (value < (1L << (3 * 8))) {
         return 3;
       }
       return 4;
     }
     // more than 4 bytes
-    if (value < (1l << 6 * 8)) {
-      if (value < (1l << 5 * 8)) {
+    if (value < (1L << (6 * 8))) {
+      if (value < (1L << (5 * 8))) {
         return 5;
       }
       return 6;
     }
-    if (value < (1l << 7 * 8)) {
+    if (value < (1L << (7 * 8))) {
       return 7;
     }
     return 8;
@@ -281,13 +281,13 @@ public final class ByteBufferUtils {
       return 4;
     }
 
-    if (value < (1 << 2 * 8)) {
-      if (value < (1 << 1 * 8)) {
+    if (value < (1 << (2 * 8))) {
+      if (value < (1 << (1 * 8))) {
         return 1;
       }
       return 2;
     }
-    if (value <= (1 << 3 * 8)) {
+    if (value <= (1 << (3 * 8))) {
       return 3;
     }
     return 4;
@@ -337,7 +337,7 @@ public final class ByteBufferUtils {
       throws IOException {
     long tmpLong = 0;
     for (int i = 0; i < fitInBytes; ++i) {
-      tmpLong |= (in.read() & 0xffl) << (8 * i);
+      tmpLong |= (in.read() & 0xffL) << (8 * i);
     }
     return tmpLong;
   }
@@ -350,7 +350,7 @@ public final class ByteBufferUtils {
   public static long readLong(ByteBuffer in, final int fitInBytes) {
     long tmpLength = 0;
     for (int i = 0; i < fitInBytes; ++i) {
-      tmpLength |= (in.get() & 0xffl) << (8l * i);
+      tmpLength |= (in.get() & 0xffL) << (8L * i);
     }
     return tmpLength;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
index e36b1bb..c32649b 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
@@ -36,21 +36,20 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 
+import com.google.protobuf.ByteString;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
 import org.apache.hadoop.hbase.KeyValue;
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.io.RawComparator;
 import org.apache.hadoop.io.WritableComparator;
 import org.apache.hadoop.io.WritableUtils;
-
+import org.apache.yetus.audience.InterfaceAudience;
 import sun.misc.Unsafe;
 
 import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
 import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists;
-import com.google.protobuf.ByteString;
 
 /**
  * Utility class that handles byte arrays, conversions to/from other types,
@@ -270,6 +269,7 @@ public class Bytes implements Comparable<Bytes> {
    * @return Positive if left is bigger than right, 0 if they are equal, and
    *         negative if left is smaller than right.
    */
+  @Override
   public int compareTo(Bytes that) {
     return BYTES_RAWCOMPARATOR.compare(
         this.bytes, this.offset, this.length,
@@ -1157,9 +1157,9 @@ public class Bytes implements Comparable<Bytes> {
       return UnsafeAccess.toShort(bytes, offset);
     } else {
       short n = 0;
-      n ^= bytes[offset] & 0xFF;
-      n <<= 8;
-      n ^= bytes[offset+1] & 0xFF;
+      n = (short) ((n ^ bytes[offset]) & 0xFF);
+      n = (short) (n << 8);
+      n = (short) ((n ^ bytes[offset+1]) & 0xFF);
       return n;
    }
   }
@@ -1533,8 +1533,8 @@ public class Bytes implements Comparable<Bytes> {
         final int stride = 8;
         final int minLength = Math.min(length1, length2);
         int strideLimit = minLength & ~(stride - 1);
-        final long offset1Adj = offset1 + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;
-        final long offset2Adj = offset2 + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;
+        final long offset1Adj = (long) offset1 + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;
+        final long offset2Adj = (long) offset2 + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;
         int i;
 
         /*

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java
index 16d1fc2..120f0dc 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ChecksumType.java
@@ -18,8 +18,8 @@
 
 package org.apache.hadoop.hbase.util;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.util.DataChecksum;
+import org.apache.yetus.audience.InterfaceAudience;
 
 /**
  * Checksum types. The Checksum type is a one byte number

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java
index b1edf7c..b2af1e7 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassLoaderBase.java
@@ -20,9 +20,10 @@ package org.apache.hadoop.hbase.util;
 import java.net.URL;
 import java.net.URLClassLoader;
 
-import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;
 import org.apache.yetus.audience.InterfaceAudience;
 
+import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;
+
 /**
  * Base class loader that defines couple shared constants used by sub-classes.
  */

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java
index 2a83a5d..eba3b12 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java
@@ -31,7 +31,6 @@ import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.apache.hadoop.HadoopIllegalArgumentException;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataOutputStream;
@@ -42,16 +41,14 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.PathFilter;
 import org.apache.hadoop.fs.RemoteIterator;
 import org.apache.hadoop.fs.permission.FsPermission;
-
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.ipc.RemoteException;
+import org.apache.yetus.audience.InterfaceAudience;
 
 import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
 import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists;
 
-import org.apache.hadoop.ipc.RemoteException;
-import org.apache.yetus.audience.InterfaceAudience;
-
 /**
  * Utility methods for interacting with the underlying file system.
  */
@@ -402,7 +399,7 @@ public abstract class CommonFSUtils {
 
   private static boolean isValidWALRootDir(Path walDir, final Configuration c) throws IOException {
     Path rootDir = getRootDir(c);
-    if (walDir != rootDir) {
+    if (!walDir.equals(rootDir)) {
       if (walDir.toString().startsWith(rootDir.toString() + "/")) {
         throw new IllegalStateException("Illegal WAL directory specified. " +
             "WAL directories are not permitted to be under the root directory if set.");

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java
index 6019695..15828ed 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java
@@ -37,12 +37,12 @@ import java.util.regex.Pattern;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.FileUtil;
-import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.IOUtils;
+import org.apache.yetus.audience.InterfaceAudience;
 
 import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;
 import org.apache.hadoop.hbase.shaded.com.google.common.collect.MapMaker;

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/HasThread.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/HasThread.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/HasThread.java
index d461475..76a90f5 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/HasThread.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/HasThread.java
@@ -44,7 +44,8 @@ public abstract class HasThread implements Runnable {
   public Thread getThread() {
     return thread;
   }
-  
+
+  @Override
   public abstract void run();
   
   //// Begin delegation to Thread

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Hash.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Hash.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Hash.java
index ebaed10..1f3d722 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Hash.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Hash.java
@@ -74,15 +74,15 @@ public abstract class Hash {
    * @return hash function instance, or null if type is invalid
    */
   public static Hash getInstance(int type) {
-    switch(type) {
-    case JENKINS_HASH:
-      return JenkinsHash.getInstance();
-    case MURMUR_HASH:
-      return MurmurHash.getInstance();
-    case MURMUR_HASH3:
-      return MurmurHash3.getInstance();
-    default:
-      return null;
+    switch (type) {
+      case JENKINS_HASH:
+        return JenkinsHash.getInstance();
+      case MURMUR_HASH:
+        return MurmurHash.getInstance();
+      case MURMUR_HASH3:
+        return MurmurHash3.getInstance();
+      default:
+        return null;
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JRubyFormat.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JRubyFormat.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JRubyFormat.java
index 29e46ce..2cb2ea7 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JRubyFormat.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JRubyFormat.java
@@ -23,6 +23,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 
 import org.apache.yetus.audience.InterfaceAudience;
+
 import org.apache.hadoop.hbase.shaded.com.google.common.escape.Escaper;
 import org.apache.hadoop.hbase.shaded.com.google.common.escape.Escapers;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
index 0571a08..532f841 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java
@@ -18,12 +18,13 @@ package org.apache.hadoop.hbase.util;
 
 import java.io.Closeable;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.lang.management.ManagementFactory;
 import java.lang.reflect.Array;
+import java.nio.charset.StandardCharsets;
 import java.util.Iterator;
 import java.util.Set;
-
 import javax.management.AttributeNotFoundException;
 import javax.management.InstanceNotFoundException;
 import javax.management.IntrospectionException;
@@ -41,8 +42,8 @@ import javax.management.openmbean.CompositeType;
 import javax.management.openmbean.TabularData;
 
 import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.core.JsonGenerator;
 import com.fasterxml.jackson.core.JsonGenerationException;
+import com.fasterxml.jackson.core.JsonGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -340,7 +341,8 @@ public class JSONBean {
    * @throws MalformedObjectNameException
    */
   public static void dumpAllBeans() throws IOException, MalformedObjectNameException {
-    try (PrintWriter writer = new PrintWriter(System.out)) {
+    try (PrintWriter writer = new PrintWriter(
+        new OutputStreamWriter(System.out, StandardCharsets.UTF_8))) {
       JSONBean dumper = new JSONBean();
       try (JSONBean.Writer jsonBeanWriter = dumper.open(writer)) {
         MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONMetricUtil.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONMetricUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONMetricUtil.java
index c11c52a..ae967a1 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONMetricUtil.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JSONMetricUtil.java
@@ -28,7 +28,6 @@ import java.lang.management.RuntimeMXBean;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Set;
-
 import javax.management.InstanceNotFoundException;
 import javax.management.MBeanAttributeInfo;
 import javax.management.MBeanInfo;

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java
index 13f1996..ab966f1 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java
@@ -26,6 +26,7 @@ import java.lang.management.ManagementFactory;
 import java.lang.management.OperatingSystemMXBean;
 import java.lang.management.RuntimeMXBean;
 import java.lang.reflect.Method;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -160,7 +161,7 @@ public class JVM {
           new String[]{"bash", "-c",
               "ls /proc/" + pidhost[0] + "/fdinfo | wc -l"});
       inputStream = p.getInputStream();
-      inputStreamReader = new InputStreamReader(inputStream);
+      inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
       bufferedReader = new BufferedReader(inputStreamReader);
       String openFileDesCount;
       if ((openFileDesCount = bufferedReader.readLine()) != null) {
@@ -236,7 +237,7 @@ public class JVM {
       int count = 0;
       Process p = Runtime.getRuntime().exec("ps -e");
       inputStream = p.getInputStream();
-      inputStreamReader = new InputStreamReader(inputStream);
+      inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
       bufferedReader = new BufferedReader(inputStreamReader);
       while (bufferedReader.readLine() != null) {
         count++;
@@ -288,7 +289,7 @@ public class JVM {
       //using linux bash commands to retrieve info
       Process p = Runtime.getRuntime().exec(new String[]{"bash", "-c", "ulimit -n"});
       in = p.getInputStream();
-      output = new BufferedReader(new InputStreamReader(in));
+      output = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
       String maxFileDesCount;
       if ((maxFileDesCount = output.readLine()) != null) {
         return Long.parseLong(maxFileDesCount);

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java
index 3979438..b68068b 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java
@@ -503,17 +503,17 @@ public class OrderedBytes {
     x = src.get();
     a1 = ord.apply(x) & 0xff;
     if (-1 == unsignedCmp(a0, 249)) {
-      return (a0 - 241) * 256 + a1 + 240;
+      return (a0 - 241L) * 256 + a1 + 240;
     }
     x = src.get();
     a2 = ord.apply(x) & 0xff;
     if (a0 == 249) {
-      return 2288 + 256 * a1 + a2;
+      return 2288L + 256 * a1 + a2;
     }
     x = src.get();
     a3 = ord.apply(x) & 0xff;
     if (a0 == 250) {
-      return (a1 << 16) | (a2 << 8) | a3;
+      return ((long) a1 << 16L) | (a2 << 8) | a3;
     }
     x = src.get();
     a4 = ord.apply(x) & 0xff;
@@ -663,7 +663,8 @@ public class OrderedBytes {
       dst.put((byte) ((2 * d + 1) & 0xff));
       abs = abs.subtract(BigDecimal.valueOf(d));
     }
-    a[offset + dst.getPosition() - 1] &= 0xfe; // terminal digit should be 2x
+    // terminal digit should be 2x
+    a[offset + dst.getPosition() - 1] = (byte) (a[offset + dst.getPosition() - 1] & 0xfe);
     if (isNeg) {
       // negative values encoded as ~M
       DESCENDING.apply(a, offset + startM, dst.getPosition() - startM);
@@ -747,8 +748,8 @@ public class OrderedBytes {
       dst.put((byte) (2 * d + 1));
       abs = abs.subtract(BigDecimal.valueOf(d));
     }
-
-    a[offset + dst.getPosition() - 1] &= 0xfe; // terminal digit should be 2x
+    // terminal digit should be 2x
+    a[offset + dst.getPosition() - 1] = (byte) (a[offset + dst.getPosition() - 1] & 0xfe);
     if (isNeg) {
       // negative values encoded as ~M
       DESCENDING.apply(a, offset + startM, dst.getPosition() - startM);
@@ -1063,7 +1064,8 @@ public class OrderedBytes {
       if (s > 1) {
         dst.put((byte) (0x7f & t));
       } else {
-        dst.getBytes()[offset + dst.getPosition() - 1] &= 0x7f;
+        dst.getBytes()[offset + dst.getPosition() - 1] =
+          (byte) (dst.getBytes()[offset + dst.getPosition() - 1] & 0x7f);
       }
     }
     ord.apply(dst.getBytes(), offset + start, dst.getPosition() - start);
@@ -1116,7 +1118,7 @@ public class OrderedBytes {
         ret.put((byte) (t | ((ord.apply(a[offset + i]) & 0x7f) >>> s)));
       }
       if (i == end) break;
-      t = (byte) ((ord.apply(a[offset + i]) << 8 - s) & 0xff);
+      t = (byte) ((ord.apply(a[offset + i]) << (8 - s)) & 0xff);
       s = s == 1 ? 7 : s - 1;
     }
     src.setPosition(end);
@@ -1372,7 +1374,7 @@ public class OrderedBytes {
   public static int encodeFloat32(PositionedByteRange dst, float val, Order ord) {
     final int offset = dst.getOffset(), start = dst.getPosition();
     int i = Float.floatToIntBits(val);
-    i ^= ((i >> Integer.SIZE - 1) | Integer.MIN_VALUE);
+    i ^= ((i >> (Integer.SIZE - 1)) | Integer.MIN_VALUE);
     dst.put(FIXED_FLOAT32)
         .put((byte) (i >> 24))
         .put((byte) (i >> 16))
@@ -1394,7 +1396,7 @@ public class OrderedBytes {
     for (int i = 1; i < 4; i++) {
       val = (val << 8) + (ord.apply(src.get()) & 0xff);
     }
-    val ^= (~val >> Integer.SIZE - 1) | Integer.MIN_VALUE;
+    val ^= (~val >> (Integer.SIZE - 1)) | Integer.MIN_VALUE;
     return Float.intBitsToFloat(val);
   }
 
@@ -1466,7 +1468,7 @@ public class OrderedBytes {
   public static int encodeFloat64(PositionedByteRange dst, double val, Order ord) {
     final int offset = dst.getOffset(), start = dst.getPosition();
     long lng = Double.doubleToLongBits(val);
-    lng ^= ((lng >> Long.SIZE - 1) | Long.MIN_VALUE);
+    lng ^= ((lng >> (Long.SIZE - 1)) | Long.MIN_VALUE);
     dst.put(FIXED_FLOAT64)
         .put((byte) (lng >> 56))
         .put((byte) (lng >> 48))
@@ -1492,7 +1494,7 @@ public class OrderedBytes {
     for (int i = 1; i < 8; i++) {
       val = (val << 8) + (ord.apply(src.get()) & 0xff);
     }
-    val ^= (~val >> Long.SIZE - 1) | Long.MIN_VALUE;
+    val ^= (~val >> (Long.SIZE - 1)) | Long.MIN_VALUE;
     return Double.longBitsToDouble(val);
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java
index f23e5ca..4f4b775 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java
@@ -25,8 +25,8 @@ import java.util.regex.Pattern;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.HBaseException;
+import org.apache.yetus.audience.InterfaceAudience;
 
 @InterfaceAudience.Private
 public class PrettyPrinter {

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ReflectionUtils.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ReflectionUtils.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ReflectionUtils.java
index 8b1a0ad..6430d2e 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ReflectionUtils.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ReflectionUtils.java
@@ -29,12 +29,10 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.nio.charset.Charset;
 
+import edu.umd.cs.findbugs.annotations.NonNull;
 import org.apache.commons.logging.Log;
-
 import org.apache.yetus.audience.InterfaceAudience;
 
-import edu.umd.cs.findbugs.annotations.NonNull;
-
 @InterfaceAudience.Private
 public class ReflectionUtils {
   @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java
index 5f0ddf0..dcf6626 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java
@@ -20,9 +20,9 @@ package org.apache.hadoop.hbase.util;
 
 import java.util.concurrent.TimeUnit;
 
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.util.RetryCounter.ExponentialBackoffPolicyWithLimit;
 import org.apache.hadoop.hbase.util.RetryCounter.RetryConfig;
+import org.apache.yetus.audience.InterfaceAudience;
 
 @InterfaceAudience.Private
 public class RetryCounterFactory {

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowBloomHashKey.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowBloomHashKey.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowBloomHashKey.java
index 2587ceb..d750c60 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowBloomHashKey.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowBloomHashKey.java
@@ -18,7 +18,6 @@
 package org.apache.hadoop.hbase.util;
 
 import org.apache.hadoop.hbase.Cell;
-import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.PrivateCellUtil;
 import org.apache.yetus.audience.InterfaceAudience;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowColBloomHashKey.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowColBloomHashKey.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowColBloomHashKey.java
index 41260f4..17a26ac 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowColBloomHashKey.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RowColBloomHashKey.java
@@ -18,9 +18,8 @@
 package org.apache.hadoop.hbase.util;
 
 import org.apache.hadoop.hbase.Cell;
-import org.apache.hadoop.hbase.CellUtil;
-import org.apache.hadoop.hbase.PrivateCellUtil;
 import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.PrivateCellUtil;
 import org.apache.yetus.audience.InterfaceAudience;
 
 /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/SoftObjectPool.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/SoftObjectPool.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/SoftObjectPool.java
index fbc1a47..4cce1f8 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/SoftObjectPool.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/SoftObjectPool.java
@@ -21,13 +21,12 @@ import java.lang.ref.Reference;
 import java.lang.ref.SoftReference;
 
 import org.apache.yetus.audience.InterfaceAudience;
-import org.apache.hadoop.hbase.util.ObjectPool.ObjectFactory;
 
 /**
  * A {@code SoftReference} based shared object pool.
  * The objects are kept in soft references and
  * associated with keys which are identified by the {@code equals} method.
- * The objects are created by {@link ObjectFactory} on demand.
+ * The objects are created by ObjectFactory on demand.
  * The object creation is expected to be lightweight,
  * and the objects may be excessively created and discarded.
  * Thread safe.

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Threads.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Threads.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Threads.java
index b39a5e8..4e2f09f 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Threads.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Threads.java
@@ -18,11 +18,13 @@
  */
 package org.apache.hadoop.hbase.util;
 
+import java.io.OutputStreamWriter;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.lang.Thread.UncaughtExceptionHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.nio.charset.StandardCharsets;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
@@ -31,9 +33,9 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.util.ReflectionUtils;
 import org.apache.hadoop.util.StringUtils;
+import org.apache.yetus.audience.InterfaceAudience;
 
 import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;
 
@@ -312,7 +314,8 @@ public class Threads {
           @Override
           public void printThreadInfo(PrintStream stream, String title) {
             try {
-              hadoop26Method.invoke(null, new PrintWriter(stream), title);
+              hadoop26Method.invoke(null, new PrintWriter(
+                  new OutputStreamWriter(stream, StandardCharsets.UTF_8)), title);
             } catch (IllegalAccessException | IllegalArgumentException e) {
               throw new RuntimeException(e);
             } catch (InvocationTargetException e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Triple.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Triple.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Triple.java
index 1442bf7..9086644 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Triple.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Triple.java
@@ -44,6 +44,7 @@ public class Triple<A, B, C> {
     return new Triple<>(first, second, third);
   }
 
+  @Override
   public int hashCode() {
     int hashFirst = (first != null ? first.hashCode() : 0);
     int hashSecond = (second != null ? second.hashCode() : 0);
@@ -52,6 +53,7 @@ public class Triple<A, B, C> {
     return (hashFirst >> 1) ^ hashSecond ^ (hashThird << 1);
   }
 
+  @Override
   public boolean equals(Object obj) {
     if (!(obj instanceof Triple)) {
       return false;
@@ -69,6 +71,7 @@ public class Triple<A, B, C> {
     return true;
   }
 
+  @Override
   public String toString() {
     return "(" + first + ", " + second + "," + third + " )";
   }
@@ -97,6 +100,3 @@ public class Triple<A, B, C> {
     this.third = third;
   }
 }
-
-
-

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java
index 5cb9ea6..50fef6d 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java
@@ -27,7 +27,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.yetus.audience.InterfaceStability;
-
 import sun.misc.Unsafe;
 import sun.nio.ch.DirectBuffer;
 
@@ -326,7 +325,7 @@ public final class UnsafeAccess {
       destAddress = destAddress + BYTE_ARRAY_BASE_OFFSET + dest.arrayOffset();
       destBase = dest.array();
     }
-    long srcAddress = srcOffset + BYTE_ARRAY_BASE_OFFSET;
+    long srcAddress = (long) srcOffset + BYTE_ARRAY_BASE_OFFSET;
     unsafeCopy(src, srcAddress, destBase, destAddress, length);
   }
 
@@ -360,7 +359,7 @@ public final class UnsafeAccess {
       srcAddress = srcAddress + BYTE_ARRAY_BASE_OFFSET + src.arrayOffset();
       srcBase = src.array();
     }
-    long destAddress = destOffset + BYTE_ARRAY_BASE_OFFSET;
+    long destAddress = (long) destOffset + BYTE_ARRAY_BASE_OFFSET;
     unsafeCopy(srcBase, srcAddress, dest, destAddress, length);
   }
 
@@ -381,13 +380,13 @@ public final class UnsafeAccess {
     if (src.isDirect()) {
       srcAddress = srcOffset + ((DirectBuffer) src).address();
     } else {
-      srcAddress = srcOffset +  src.arrayOffset() + BYTE_ARRAY_BASE_OFFSET;
+      srcAddress = (long) srcOffset +  src.arrayOffset() + BYTE_ARRAY_BASE_OFFSET;
       srcBase = src.array();
     }
     if (dest.isDirect()) {
       destAddress = destOffset + ((DirectBuffer) dest).address();
     } else {
-      destAddress = destOffset + BYTE_ARRAY_BASE_OFFSET + dest.arrayOffset();
+      destAddress = (long) destOffset + BYTE_ARRAY_BASE_OFFSET + dest.arrayOffset();
       destBase = dest.array();
     }
     unsafeCopy(srcBase, srcAddress, destBase, destAddress, length);

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/util/WeakObjectPool.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/WeakObjectPool.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/WeakObjectPool.java
index 08f04a5..181979f 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/WeakObjectPool.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/WeakObjectPool.java
@@ -21,7 +21,6 @@ import java.lang.ref.Reference;
 import java.lang.ref.WeakReference;
 
 import org.apache.yetus.audience.InterfaceAudience;
-import org.apache.hadoop.hbase.util.ObjectPool.ObjectFactory;
 
 /**
  * A {@code WeakReference} based shared object pool.

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java
index 5eef2d3..109b066 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java
@@ -22,11 +22,12 @@ import java.io.IOException;
 import java.util.Map.Entry;
 import java.util.Properties;
 
-import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.yetus.audience.InterfaceAudience;
 
+import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
+
 /**
  * Utility methods for reading, and building the ZooKeeper configuration.
  *

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java
index 4202036..db203b8 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/ClassFinder.java
@@ -287,7 +287,7 @@ public class ClassFinder {
     return null;
   }
 
-  private class FileFilterWithName implements FileFilter {
+  private static class FileFilterWithName implements FileFilter {
     private FileNameFilter nameFilter;
 
     public FileFilterWithName(FileNameFilter nameFilter) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
index a503820..d84e8ec 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
@@ -222,7 +222,8 @@ public class HBaseCommonTestingUtility {
         LOG.warn("Failed to delete " + dir.getAbsolutePath(), ex);
       }
     } while (ntries < 30);
-    return ntries < 30;
+
+    return false;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/test/java/org/apache/hadoop/hbase/ResourceCheckerJUnitListener.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/ResourceCheckerJUnitListener.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/ResourceCheckerJUnitListener.java
index 751b9e3..709646b 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/ResourceCheckerJUnitListener.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/ResourceCheckerJUnitListener.java
@@ -87,7 +87,9 @@ public class ResourceCheckerJUnitListener extends RunListener {
   static class OpenFileDescriptorResourceAnalyzer extends ResourceChecker.ResourceAnalyzer {
     @Override
     public int getVal(Phase phase) {
-      if (!JVM.isUnix()) return 0;
+      if (!JVM.isUnix()) {
+        return 0;
+      }
       JVM jvm = new JVM();
       return (int)jvm.getOpenFileDescriptorCount();
     }
@@ -101,16 +103,20 @@ public class ResourceCheckerJUnitListener extends RunListener {
   static class MaxFileDescriptorResourceAnalyzer extends ResourceChecker.ResourceAnalyzer {
     @Override
     public int getVal(Phase phase) {
-      if (!JVM.isUnix()) return 0;
+      if (!JVM.isUnix()) {
+        return 0;
+      }
       JVM jvm = new JVM();
       return (int)jvm.getMaxFileDescriptorCount();
-     } 
-   }
+    }
+  }
 
   static class SystemLoadAverageResourceAnalyzer extends ResourceChecker.ResourceAnalyzer {
     @Override
     public int getVal(Phase phase) {
-      if (!JVM.isUnix()) return 0;
+      if (!JVM.isUnix()) {
+        return 0;
+      }
       return (int)(new JVM().getSystemLoadAverage()*100);
     }
   }
@@ -118,7 +124,9 @@ public class ResourceCheckerJUnitListener extends RunListener {
   static class ProcessCountResourceAnalyzer extends ResourceChecker.ResourceAnalyzer {
     @Override
     public int getVal(Phase phase) {
-      if (!JVM.isUnix()) return 0;
+      if (!JVM.isUnix()) {
+        return 0;
+      }
       return new JVM().getNumberOfRunningProcess();
     }
   }
@@ -126,7 +134,9 @@ public class ResourceCheckerJUnitListener extends RunListener {
   static class AvailableMemoryMBResourceAnalyzer extends ResourceChecker.ResourceAnalyzer {
     @Override
     public int getVal(Phase phase) {
-      if (!JVM.isUnix()) return 0;
+      if (!JVM.isUnix()) {
+        return 0;
+      }
       return (int) (new JVM().getFreeMemory() / (1024L * 1024L));
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/test/java/org/apache/hadoop/hbase/TestByteBufferKeyValue.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestByteBufferKeyValue.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestByteBufferKeyValue.java
index f179bfe..26459f9 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestByteBufferKeyValue.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestByteBufferKeyValue.java
@@ -53,7 +53,7 @@ public class TestByteBufferKeyValue {
 
   @Test
   public void testByteBufferBackedKeyValue() throws Exception {
-    KeyValue kvCell = new KeyValue(row1, fam1, qual1, 0l, Type.Put, row1);
+    KeyValue kvCell = new KeyValue(row1, fam1, qual1, 0L, Type.Put, row1);
     ByteBuffer buf = ByteBuffer.allocateDirect(kvCell.getBuffer().length);
     ByteBufferUtils.copyFromArrayToBuffer(buf, kvCell.getBuffer(), 0, kvCell.getBuffer().length);
     ByteBufferCell offheapKV = new ByteBufferKeyValue(buf, 0, buf.capacity(), 0L);
@@ -96,10 +96,10 @@ public class TestByteBufferKeyValue {
     assertEquals(0L, offheapKV.getTimestamp());
     assertEquals(Type.Put.getCode(), offheapKV.getTypeByte());
 
-    kvCell = new KeyValue(row1, fam2, qual2, 0l, Type.Put, row1);
+    kvCell = new KeyValue(row1, fam2, qual2, 0L, Type.Put, row1);
     buf = ByteBuffer.allocateDirect(kvCell.getBuffer().length);
     ByteBufferUtils.copyFromArrayToBuffer(buf, kvCell.getBuffer(), 0, kvCell.getBuffer().length);
-    offheapKV = new ByteBufferKeyValue(buf, 0, buf.capacity(), 0l);
+    offheapKV = new ByteBufferKeyValue(buf, 0, buf.capacity(), 0L);
     assertEquals(
       FAM2,
       ByteBufferUtils.toStringBinary(offheapKV.getFamilyByteBuffer(),
@@ -112,7 +112,7 @@ public class TestByteBufferKeyValue {
     kvCell = new KeyValue(row1, fam1, nullQualifier, 0L, Type.Put, row1);
     buf = ByteBuffer.allocateDirect(kvCell.getBuffer().length);
     ByteBufferUtils.copyFromArrayToBuffer(buf, kvCell.getBuffer(), 0, kvCell.getBuffer().length);
-    offheapKV = new ByteBufferKeyValue(buf, 0, buf.capacity(), 0l);
+    offheapKV = new ByteBufferKeyValue(buf, 0, buf.capacity(), 0L);
     assertEquals(
       ROW1,
       ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(),
@@ -135,10 +135,10 @@ public class TestByteBufferKeyValue {
 
   @Test
   public void testByteBufferBackedKeyValueWithTags() throws Exception {
-    KeyValue kvCell = new KeyValue(row1, fam1, qual1, 0l, Type.Put, row1, tags);
+    KeyValue kvCell = new KeyValue(row1, fam1, qual1, 0L, Type.Put, row1, tags);
     ByteBuffer buf = ByteBuffer.allocateDirect(kvCell.getBuffer().length);
     ByteBufferUtils.copyFromArrayToBuffer(buf, kvCell.getBuffer(), 0, kvCell.getBuffer().length);
-    ByteBufferKeyValue offheapKV = new ByteBufferKeyValue(buf, 0, buf.capacity(), 0l);
+    ByteBufferKeyValue offheapKV = new ByteBufferKeyValue(buf, 0, buf.capacity(), 0L);
     assertEquals(
       ROW1,
       ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(),
@@ -175,7 +175,7 @@ public class TestByteBufferKeyValue {
 
   @Test
   public void testGetKeyMethods() throws Exception {
-    KeyValue kvCell = new KeyValue(row1, fam1, qual1, 0l, Type.Put, row1, tags);
+    KeyValue kvCell = new KeyValue(row1, fam1, qual1, 0L, Type.Put, row1, tags);
     ByteBuffer buf = ByteBuffer.allocateDirect(kvCell.getKeyLength());
     ByteBufferUtils.copyFromArrayToBuffer(buf, kvCell.getBuffer(), kvCell.getKeyOffset(),
       kvCell.getKeyLength());

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellBuilder.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellBuilder.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellBuilder.java
index b875414..ad18547 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellBuilder.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellBuilder.java
@@ -18,13 +18,13 @@
 
 package org.apache.hadoop.hbase;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.hadoop.hbase.testclassification.MiscTests;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.assertEquals;
-
 @Category({MiscTests.class, SmallTests.class})
 public class TestCellBuilder {
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellComparator.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellComparator.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellComparator.java
index f25925f..4746bec 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellComparator.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellComparator.java
@@ -55,16 +55,16 @@ public class TestCellComparator {
     kv2 = new KeyValue(row1, fam1, qual1, val);
     assertTrue((comparator.compareFamilies(kv1, kv2) > 0));
 
-    kv1 = new KeyValue(row1, fam1, qual1, 1l, val);
-    kv2 = new KeyValue(row1, fam1, qual1, 2l, val);
+    kv1 = new KeyValue(row1, fam1, qual1, 1L, val);
+    kv2 = new KeyValue(row1, fam1, qual1, 2L, val);
     assertTrue((comparator.compare(kv1, kv2) > 0));
 
-    kv1 = new KeyValue(row1, fam1, qual1, 1l, Type.Put);
-    kv2 = new KeyValue(row1, fam1, qual1, 1l, Type.Maximum);
+    kv1 = new KeyValue(row1, fam1, qual1, 1L, Type.Put);
+    kv2 = new KeyValue(row1, fam1, qual1, 1L, Type.Maximum);
     assertTrue((comparator.compare(kv1, kv2) > 0));
 
-    kv1 = new KeyValue(row1, fam1, qual1, 1l, Type.Put);
-    kv2 = new KeyValue(row1, fam1, qual1, 1l, Type.Put);
+    kv1 = new KeyValue(row1, fam1, qual1, 1L, Type.Put);
+    kv2 = new KeyValue(row1, fam1, qual1, 1L, Type.Put);
     assertTrue((CellUtil.equals(kv1, kv2)));
   }
 
@@ -80,18 +80,18 @@ public class TestCellComparator {
     assertTrue(
       (PrivateCellUtil.compare(comparator, kv1, kv2.getKey(), 0, kv2.getKey().length)) > 0);
 
-    kv1 = new KeyValue(row1, fam1, qual1, 1l, val);
-    kv2 = new KeyValue(row1, fam1, qual1, 2l, val);
+    kv1 = new KeyValue(row1, fam1, qual1, 1L, val);
+    kv2 = new KeyValue(row1, fam1, qual1, 2L, val);
     assertTrue(
       (PrivateCellUtil.compare(comparator, kv1, kv2.getKey(), 0, kv2.getKey().length)) > 0);
 
-    kv1 = new KeyValue(row1, fam1, qual1, 1l, Type.Put);
-    kv2 = new KeyValue(row1, fam1, qual1, 1l, Type.Maximum);
+    kv1 = new KeyValue(row1, fam1, qual1, 1L, Type.Put);
+    kv2 = new KeyValue(row1, fam1, qual1, 1L, Type.Maximum);
     assertTrue(
       (PrivateCellUtil.compare(comparator, kv1, kv2.getKey(), 0, kv2.getKey().length)) > 0);
 
-    kv1 = new KeyValue(row1, fam1, qual1, 1l, Type.Put);
-    kv2 = new KeyValue(row1, fam1, qual1, 1l, Type.Put);
+    kv1 = new KeyValue(row1, fam1, qual1, 1L, Type.Put);
+    kv2 = new KeyValue(row1, fam1, qual1, 1L, Type.Put);
     assertTrue(
       (PrivateCellUtil.compare(comparator, kv1, kv2.getKey(), 0, kv2.getKey().length)) == 0);
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java
index 397476f..0395c09 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java
@@ -26,6 +26,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.NavigableMap;
@@ -44,7 +45,7 @@ public class TestCellUtil {
   /**
    * CellScannable used in test. Returns a {@link TestCellScanner}
    */
-  private class TestCellScannable implements CellScannable {
+  private static class TestCellScannable implements CellScannable {
     private final int cellsCount;
     TestCellScannable(final int cellsCount) {
       this.cellsCount = cellsCount;
@@ -58,7 +59,7 @@ public class TestCellUtil {
   /**
    * CellScanner used in test.
    */
-  private class TestCellScanner implements CellScanner {
+  private static class TestCellScanner implements CellScanner {
     private int count = 0;
     private Cell current = null;
     private final int cellsCount;
@@ -86,7 +87,7 @@ public class TestCellUtil {
   /**
    * Cell used in test. Has row only.
    */
-  private class TestCell implements Cell {
+  private static class TestCell implements Cell {
     private final byte [] row;
 
     TestCell(final int i) {
@@ -201,7 +202,6 @@ public class TestCellUtil {
 
   /**
    * Was overflowing if 100k or so lists of cellscanners to return.
-   * @throws IOException
    */
   @Test
   public void testCreateCellScannerOverflow() throws IOException {
@@ -222,7 +222,9 @@ public class TestCellUtil {
     consume(CellUtil.createCellScanner(cells), hundredK * 1);
     NavigableMap<byte [], List<Cell>> m = new TreeMap<>(Bytes.BYTES_COMPARATOR);
     List<Cell> cellArray = new ArrayList<>(hundredK);
-    for (int i = 0; i < hundredK; i++) cellArray.add(new TestCell(i));
+    for (int i = 0; i < hundredK; i++) {
+      cellArray.add(new TestCell(i));
+    }
     m.put(new byte [] {'f'}, cellArray);
     consume(CellUtil.createCellScanner(m), hundredK * 1);
   }
@@ -252,7 +254,9 @@ public class TestCellUtil {
 
   private void consume(final CellScanner scanner, final int expected) throws IOException {
     int count = 0;
-    while (scanner.advance()) count++;
+    while (scanner.advance()) {
+      count++;
+    }
     Assert.assertEquals(expected, count);
   }
 
@@ -307,7 +311,8 @@ public class TestCellUtil {
   @Test
   public void testFindCommonPrefixInFlatKey() {
     // The whole key matching case
-    KeyValue kv1 = new KeyValue("r1".getBytes(), "f1".getBytes(), "q1".getBytes(), null);
+    KeyValue kv1 = new KeyValue("r1".getBytes(StandardCharsets.UTF_8),
+      "f1".getBytes(StandardCharsets.UTF_8), "q1".getBytes(StandardCharsets.UTF_8), null);
     Assert.assertEquals(kv1.getKeyLength(),
       PrivateCellUtil.findCommonPrefixInFlatKey(kv1, kv1, true, true));
     Assert.assertEquals(kv1.getKeyLength(),
@@ -315,30 +320,35 @@ public class TestCellUtil {
     Assert.assertEquals(kv1.getKeyLength() - KeyValue.TIMESTAMP_TYPE_SIZE,
       PrivateCellUtil.findCommonPrefixInFlatKey(kv1, kv1, true, false));
     // The rk length itself mismatch
-    KeyValue kv2 = new KeyValue("r12".getBytes(), "f1".getBytes(), "q1".getBytes(), null);
+    KeyValue kv2 = new KeyValue("r12".getBytes(StandardCharsets.UTF_8),
+        "f1".getBytes(StandardCharsets.UTF_8), "q1".getBytes(StandardCharsets.UTF_8), null);
     Assert.assertEquals(1, PrivateCellUtil.findCommonPrefixInFlatKey(kv1, kv2, true, true));
     // part of rk is same
-    KeyValue kv3 = new KeyValue("r14".getBytes(), "f1".getBytes(), "q1".getBytes(), null);
-    Assert.assertEquals(KeyValue.ROW_LENGTH_SIZE + "r1".getBytes().length,
+    KeyValue kv3 = new KeyValue("r14".getBytes(StandardCharsets.UTF_8),
+        "f1".getBytes(StandardCharsets.UTF_8), "q1".getBytes(StandardCharsets.UTF_8), null);
+    Assert.assertEquals(KeyValue.ROW_LENGTH_SIZE + "r1".getBytes(StandardCharsets.UTF_8).length,
       PrivateCellUtil.findCommonPrefixInFlatKey(kv2, kv3, true, true));
     // entire rk is same but different cf name
-    KeyValue kv4 = new KeyValue("r14".getBytes(), "f2".getBytes(), "q1".getBytes(), null);
+    KeyValue kv4 = new KeyValue("r14".getBytes(StandardCharsets.UTF_8),
+      "f2".getBytes(StandardCharsets.UTF_8), "q1".getBytes(StandardCharsets.UTF_8), null);
     Assert.assertEquals(KeyValue.ROW_LENGTH_SIZE + kv3.getRowLength() + KeyValue.FAMILY_LENGTH_SIZE
-        + "f".getBytes().length, PrivateCellUtil.findCommonPrefixInFlatKey(kv3, kv4, false, true));
+        + "f".getBytes(StandardCharsets.UTF_8).length,
+        PrivateCellUtil.findCommonPrefixInFlatKey(kv3, kv4, false, true));
     // rk and family are same and part of qualifier
-    KeyValue kv5 = new KeyValue("r14".getBytes(), "f2".getBytes(), "q123".getBytes(), null);
+    KeyValue kv5 = new KeyValue("r14".getBytes(StandardCharsets.UTF_8),
+      "f2".getBytes(StandardCharsets.UTF_8), "q123".getBytes(StandardCharsets.UTF_8), null);
     Assert.assertEquals(KeyValue.ROW_LENGTH_SIZE + kv3.getRowLength() + KeyValue.FAMILY_LENGTH_SIZE
         + kv4.getFamilyLength() + kv4.getQualifierLength(),
         PrivateCellUtil.findCommonPrefixInFlatKey(kv4, kv5, true, true));
     // rk, cf and q are same. ts differs
-    KeyValue kv6 = new KeyValue("rk".getBytes(), 1234L);
-    KeyValue kv7 = new KeyValue("rk".getBytes(), 1235L);
+    KeyValue kv6 = new KeyValue("rk".getBytes(StandardCharsets.UTF_8), 1234L);
+    KeyValue kv7 = new KeyValue("rk".getBytes(StandardCharsets.UTF_8), 1235L);
     // only last byte out of 8 ts bytes in ts part differs
     Assert.assertEquals(KeyValue.ROW_LENGTH_SIZE + kv6.getRowLength() + KeyValue.FAMILY_LENGTH_SIZE
         + kv6.getFamilyLength() + kv6.getQualifierLength() + 7,
         PrivateCellUtil.findCommonPrefixInFlatKey(kv6, kv7, true, true));
     // rk, cf, q and ts are same. Only type differs
-    KeyValue kv8 = new KeyValue("rk".getBytes(), 1234L, Type.Delete);
+    KeyValue kv8 = new KeyValue("rk".getBytes(StandardCharsets.UTF_8), 1234L, Type.Delete);
     Assert.assertEquals(KeyValue.ROW_LENGTH_SIZE + kv6.getRowLength() + KeyValue.FAMILY_LENGTH_SIZE
         + kv6.getFamilyLength() + kv6.getQualifierLength() + KeyValue.TIMESTAMP_SIZE,
         PrivateCellUtil.findCommonPrefixInFlatKey(kv6, kv8, true, true));
@@ -354,7 +364,7 @@ public class TestCellUtil {
   @Test
   public void testToString() {
     byte [] row = Bytes.toBytes("row");
-    long ts = 123l;
+    long ts = 123L;
     // Make a KeyValue and a Cell and see if same toString result.
     KeyValue kv = new KeyValue(row, HConstants.EMPTY_BYTE_ARRAY, HConstants.EMPTY_BYTE_ARRAY,
         ts, KeyValue.Type.Minimum, HConstants.EMPTY_BYTE_ARRAY);

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/test/java/org/apache/hadoop/hbase/TestChoreService.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestChoreService.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestChoreService.java
index 826c8db..7d85b97 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestChoreService.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestChoreService.java
@@ -167,14 +167,18 @@ public class TestChoreService {
       @Override
       protected boolean initialChore() {
         countOfChoreCalls++;
-        if (outputOnTicks) outputTickCount();
+        if (outputOnTicks) {
+          outputTickCount();
+        }
         return true;
       }
 
       @Override
       protected void chore() {
         countOfChoreCalls++;
-        if (outputOnTicks) outputTickCount();
+        if (outputOnTicks) {
+          outputTickCount();
+        }
       }
 
       private void outputTickCount() {
@@ -249,16 +253,16 @@ public class TestChoreService {
       int loopCount = 0;
       boolean brokeOutOfLoop = false;
 
-     while (!chore.isInitialChoreComplete() && chore.isScheduled()) {
-       Thread.sleep(failureThreshold * period);
-       loopCount++;
-       if (loopCount > 3) {
-         brokeOutOfLoop = true;
-         break;
-       }
-    }
+      while (!chore.isInitialChoreComplete() && chore.isScheduled()) {
+        Thread.sleep(failureThreshold * period);
+        loopCount++;
+        if (loopCount > 3) {
+          brokeOutOfLoop = true;
+          break;
+        }
+      }
 
-    assertFalse(brokeOutOfLoop);
+      assertFalse(brokeOutOfLoop);
     } finally {
       shutdownService(service);
     }
@@ -297,10 +301,10 @@ public class TestChoreService {
       }
     };
 
-    assertEquals("Name construction failed", chore1.getName(), NAME);
-    assertEquals("Period construction failed", chore1.getPeriod(), PERIOD);
-    assertEquals("Initial Delay construction failed", chore1.getInitialDelay(), VALID_DELAY);
-    assertEquals("TimeUnit construction failed", chore1.getTimeUnit(), UNIT);
+    assertEquals("Name construction failed", NAME, chore1.getName());
+    assertEquals("Period construction failed", PERIOD, chore1.getPeriod());
+    assertEquals("Initial Delay construction failed", VALID_DELAY, chore1.getInitialDelay());
+    assertEquals("TimeUnit construction failed", UNIT, chore1.getTimeUnit());
 
     ScheduledChore invalidDelayChore =
         new ScheduledChore(NAME, new SampleStopper(), PERIOD, INVALID_DELAY, UNIT) {
@@ -319,7 +323,8 @@ public class TestChoreService {
     final int corePoolSize = 10;
     final int defaultCorePoolSize = ChoreService.MIN_CORE_POOL_SIZE;
 
-    ChoreService customInit = new ChoreService("testChoreServiceConstruction_custom", corePoolSize, false);
+    ChoreService customInit =
+        new ChoreService("testChoreServiceConstruction_custom", corePoolSize, false);
     try {
       assertEquals(corePoolSize, customInit.getCorePoolSize());
     } finally {
@@ -475,7 +480,7 @@ public class TestChoreService {
       Thread.sleep(chorePeriod * 10);
       assertEquals("Chores are missing their start time. Should expand core pool size",
         service.getNumberOfScheduledChores(), service.getCorePoolSize());
-      assertEquals(service.getNumberOfChoresMissingStartTime(), 5);
+      assertEquals(5, service.getNumberOfChoresMissingStartTime());
 
       // Now we begin to cancel the chores that caused an increase in the core thread pool of the
       // ChoreService. These cancellations should cause a decrease in the core thread pool.
@@ -483,31 +488,31 @@ public class TestChoreService {
       Thread.sleep(chorePeriod * 10);
       assertEquals(Math.max(ChoreService.MIN_CORE_POOL_SIZE, service.getNumberOfScheduledChores()),
         service.getCorePoolSize());
-      assertEquals(service.getNumberOfChoresMissingStartTime(), 4);
+      assertEquals(4, service.getNumberOfChoresMissingStartTime());
 
       slowChore4.cancel();
       Thread.sleep(chorePeriod * 10);
       assertEquals(Math.max(ChoreService.MIN_CORE_POOL_SIZE, service.getNumberOfScheduledChores()),
         service.getCorePoolSize());
-      assertEquals(service.getNumberOfChoresMissingStartTime(), 3);
+      assertEquals(3, service.getNumberOfChoresMissingStartTime());
 
       slowChore3.cancel();
       Thread.sleep(chorePeriod * 10);
       assertEquals(Math.max(ChoreService.MIN_CORE_POOL_SIZE, service.getNumberOfScheduledChores()),
         service.getCorePoolSize());
-      assertEquals(service.getNumberOfChoresMissingStartTime(), 2);
+      assertEquals(2, service.getNumberOfChoresMissingStartTime());
 
       slowChore2.cancel();
       Thread.sleep(chorePeriod * 10);
       assertEquals(Math.max(ChoreService.MIN_CORE_POOL_SIZE, service.getNumberOfScheduledChores()),
         service.getCorePoolSize());
-      assertEquals(service.getNumberOfChoresMissingStartTime(), 1);
+      assertEquals(1, service.getNumberOfChoresMissingStartTime());
 
       slowChore1.cancel();
       Thread.sleep(chorePeriod * 10);
       assertEquals(Math.max(ChoreService.MIN_CORE_POOL_SIZE, service.getNumberOfScheduledChores()),
         service.getCorePoolSize());
-      assertEquals(service.getNumberOfChoresMissingStartTime(), 0);
+      assertEquals(0, service.getNumberOfChoresMissingStartTime());
     } finally {
       shutdownService(service);
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/f9f869f6/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java
index fc30bbe..3a6d935 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestClassFinder.java
@@ -38,7 +38,6 @@ import java.util.jar.Attributes;
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
-
 import javax.tools.JavaCompiler;
 import javax.tools.ToolProvider;
 
@@ -46,7 +45,10 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.testclassification.MiscTests;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
-import org.junit.*;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
 


Mime
View raw message