HBASE-19604 Fixed Checkstyle errors in hbase-protocol-shaded and enabled Checkstyle...
authorJan Hentschel <jan.hentschel@ultratendency.com>
Sat, 23 Dec 2017 16:38:49 +0000 (17:38 +0100)
committerJan Hentschel <jan.hentschel@ultratendency.com>
Wed, 3 Jan 2018 10:41:47 +0000 (13:41 +0300)
hbase-protocol-shaded/pom.xml
hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/util/ForeignExceptionUtil.java

index ab04e98..03030b8 100644 (file)
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>checkstyle</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+            <configuration>
+              <failOnViolation>true</failOnViolation>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>
index 0e4bb94..f8cef89 100644 (file)
@@ -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<StackTraceElementMessage> 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<StackTraceElementMessage> pbTrace = new ArrayList<>(trace.length);
     for (StackTraceElement elem : trace) {