HBASE-19604 Fixed Checkstyle errors in hbase-protocol-shaded and enabled Checkstyle to fail on violations

This commit is contained in:
Jan Hentschel 2017-12-23 17:38:49 +01:00
parent 1fa3637b4d
commit 777ad8caa2
2 changed files with 24 additions and 2 deletions

View File

@ -179,6 +179,22 @@
</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>

View 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) {