From 798119cf76a71f84d6194f63b4eab246694f7016 Mon Sep 17 00:00:00 2001 From: Jan Hentschel Date: Sat, 23 Dec 2017 17:38:49 +0100 Subject: [PATCH] HBASE-19604 Fixed Checkstyle errors in hbase-protocol-shaded and enabled Checkstyle to fail on violations --- hbase-protocol-shaded/pom.xml | 16 ++++++++++++++++ .../apache/hadoop/hbase/util/ForeignExceptionUtil.java | 10 ++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/hbase-protocol-shaded/pom.xml b/hbase-protocol-shaded/pom.xml index e71a21bafc..74f192ba0a 100644 --- a/hbase-protocol-shaded/pom.xml +++ b/hbase-protocol-shaded/pom.xml @@ -179,6 +179,22 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + + checkstyle + validate + + check + + + true + + + + diff --git a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/util/ForeignExceptionUtil.java b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/util/ForeignExceptionUtil.java index 0e4bb94973..f8cef893d7 100644 --- a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/util/ForeignExceptionUtil.java +++ b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/util/ForeignExceptionUtil.java @@ -93,7 +93,10 @@ public final class ForeignExceptionUtil { GenericExceptionMessage payload = gemBuilder.build(); ForeignExceptionMessage.Builder exception = ForeignExceptionMessage.newBuilder(); exception.setGenericException(payload); - if (source != null) exception.setSource(source); + if (source != null) { + exception.setSource(source); + } + return exception.build(); } @@ -104,7 +107,10 @@ public final class ForeignExceptionUtil { */ public static List toProtoStackTraceElement(StackTraceElement[] trace) { // if there is no stack trace, ignore it and just return the message - if (trace == null) return null; + if (trace == null) { + return null; + } + // build the stack trace for the message List pbTrace = new ArrayList<>(trace.length); for (StackTraceElement elem : trace) { -- 2.14.3 (Apple Git-98)