Update checkstyle library to 8.18 (#510)

* Update checkstyle library to 8.18
Update checkstyle.xml (required):
 - Move SuppressionCommentFilter under TreeWalker
 - Remove maxLineLength property of LeftCurly module
Fix new checkstyle error reported

* fix copyright

* Fix remaining copyrights.
Wrap the wercker fix in copyright.sh with a if \$WERCKER=true
This commit is contained in:
Romain Grecourt
2019-03-15 11:49:30 -07:00
committed by GitHub
parent 7084cdb60d
commit 0b5dca90e6
9 changed files with 33 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public abstract class CollectionsHelper {
*
*/
@SafeVarargs
public static <T> List<T> listOf(T ... elts){
public static <T> List<T> listOf(T... elts){
List<T> list = new ArrayList<>();
list.addAll(Arrays.asList(elts));
return Collections.unmodifiableList(list);
@@ -76,7 +76,7 @@ public abstract class CollectionsHelper {
* @return a {@code Set} containing the specified elements
*/
@SafeVarargs
public static <T> Set<T> setOf(T ... elts){
public static <T> Set<T> setOf(T... elts){
Set<T> set = new HashSet<>();
set.addAll(Arrays.asList(elts));
return Collections.unmodifiableSet(set);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -173,7 +173,7 @@ public final class PollingStrategies {
* @param modifiers the modifiers to add
* @return a modified builder instance
*/
public FilesystemWatchBuilder modifiers(Modifier ... modifiers){
public FilesystemWatchBuilder modifiers(Modifier... modifiers){
this.modifiers = modifiers;
return this;
}

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -71,15 +71,15 @@
<module name="FileLength"/>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="SuppressWarningsFilter" />
<module name="TreeWalker">
<property name="cacheFile" value="${checkstyle.cache.file}"/>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="SuppressWarningsHolder" />
<!-- Checks for Javadoc comments. -->
@@ -133,9 +133,7 @@
<module name="NeedBraces">
<property name="allowSingleLineStatement" value="true"/>
</module>
<module name="LeftCurly">
<property name="maxLineLength" value="130"/>
</module>
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="RightCurly">
<property name="option" value="alone"/>

View File

@@ -43,21 +43,23 @@ source ${WS_DIR}/etc/scripts/wercker-env.sh
die(){ echo "${1}" ; exit 1 ;}
# Workaround!!
# Wercker clones the workspace like:
# git clone --depth=50 --quiet --progress --no-single-branch
# The --depth option screws up git history, causing the
# copyright plugin to incorrectly detect when files have been
# modified.
# This fetch restores the history. Since we don't have ssh keys
# when in wercker we need to convert the repo URL to http first
readonly GIT_REMOTE=$(git config --get remote.origin.url | \
sed s,'git@github.com:','https://github.com/',g)
if [ "${WERCKER}" = "true" ] ; then
# Workaround!!
# Wercker clones the workspace like:
# git clone --depth=50 --quiet --progress --no-single-branch
# The --depth option screws up git history, causing the
# copyright plugin to incorrectly detect when files have been
# modified.
# This fetch restores the history. Since we don't have ssh keys
# when in wercker we need to convert the repo URL to http first
readonly GIT_REMOTE=$(git config --get remote.origin.url | \
sed s,'git@github.com:','https://github.com/',g)
git remote add origin-https "${GIT_REMOTE}" > /dev/null 2>&1 || \
git remote set-url origin-https "${GIT_REMOTE}"
git remote add origin-https "${GIT_REMOTE}" > /dev/null 2>&1 || \
git remote set-url origin-https "${GIT_REMOTE}"
git fetch --unshallow origin-https
git fetch --unshallow origin-https
fi
mvn -q org.glassfish.copyright:glassfish-copyright-maven-plugin:copyright \
-f ${WS_DIR}/pom.xml \

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import java.nio.file.Path;
import java.util.List;
import io.helidon.config.Config;
import static io.helidon.config.ConfigSources.classpath;
/**

View File

@@ -21,10 +21,10 @@ import java.util.logging.Logger;
import io.helidon.common.reactive.Flow;
import io.helidon.config.Config;
import io.helidon.config.PollingStrategies;
import static io.helidon.config.ConfigSources.classpath;
import static io.helidon.config.ConfigSources.file;
import static io.helidon.config.PollingStrategies.regular;
import static java.time.Duration.ofSeconds;
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
package io.helidon.config.examples.sources;
import io.helidon.config.Config;
import static io.helidon.config.ConfigSources.directory;
/**

View File

@@ -33,7 +33,6 @@ import org.apache.commons.configuration.AbstractConfiguration;
import org.eclipse.microprofile.metrics.Histogram;
import static com.netflix.hystrix.HystrixCommandProperties.ExecutionIsolationStrategy.THREAD;
import static io.helidon.microprofile.faulttolerance.CircuitBreakerHelper.State;
import static io.helidon.microprofile.faulttolerance.FaultToleranceExtension.isFaultToleranceMetricsEnabled;
import static io.helidon.microprofile.faulttolerance.FaultToleranceMetrics.BREAKER_CALLS_FAILED_TOTAL;

View File

@@ -105,7 +105,7 @@
<version.lib.asciidoctor.diagram>1.5.4.1</version.lib.asciidoctor.diagram>
<version.lib.brave-opentracing>0.31.0</version.lib.brave-opentracing>
<version.lib.cdi-api>2.0</version.lib.cdi-api>
<version.lib.checkstyle>7.4</version.lib.checkstyle>
<version.lib.checkstyle>8.18</version.lib.checkstyle>
<version.lib.el-api>3.0.0</version.lib.el-api>
<version.lib.el-impl>3.0.0</version.lib.el-impl>
<version.lib.etcd4j>2.16.0</version.lib.etcd4j>