From 3ed68fd70d7ee187553627998ee39581309296e2 Mon Sep 17 00:00:00 2001 From: Jan Hentschel Date: Sun, 24 Dec 2017 13:59:27 +0100 Subject: [PATCH] HBASE-19610 Fixed Checkstyle errors in hbase-protocol and enabled Checkstyle to fail on violations --- hbase-protocol/pom.xml | 16 ++++++++++++++++ .../google/protobuf/HBaseZeroCopyByteString.java | 2 +- .../apache/hadoop/hbase/util/ByteStringer.java | 8 ++++---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/hbase-protocol/pom.xml b/hbase-protocol/pom.xml index d07a031dfed..ec7f66a97f9 100644 --- a/hbase-protocol/pom.xml +++ b/hbase-protocol/pom.xml @@ -112,6 +112,22 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + + checkstyle + validate + + check + + + true + + + + diff --git a/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java b/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java index 9d756121c43..3d1953ef87e 100644 --- a/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java +++ b/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java @@ -61,7 +61,7 @@ public final class HBaseZeroCopyByteString extends LiteralByteString { /** * Extracts the byte array from the given {@link ByteString} without copy. * @param buf A buffer from which to extract the array. This buffer must be - * actually an instance of a {@code LiteralByteString}. + * actually an instance of a {@code LiteralByteString}. * @return byte[] representation */ public static byte[] zeroCopyGetBytes(final ByteString buf) { diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/util/ByteStringer.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/util/ByteStringer.java index 65f1cc67214..581741d835b 100644 --- a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/util/ByteStringer.java +++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/util/ByteStringer.java @@ -17,18 +17,18 @@ */ package org.apache.hadoop.hbase.util; +import com.google.protobuf.ByteString; +import com.google.protobuf.HBaseZeroCopyByteString; + import org.apache.yetus.audience.InterfaceAudience; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.protobuf.ByteString; -import com.google.protobuf.HBaseZeroCopyByteString; - /** * Hack to workaround HBASE-10304 issue that keeps bubbling up when a mapreduce context. */ @InterfaceAudience.Private -public class ByteStringer { +public final class ByteStringer { private static final Logger LOG = LoggerFactory.getLogger(ByteStringer.class); /**