From 0b5dca90e6e68631fe44f37afc1f5406a57d08e5 Mon Sep 17 00:00:00 2001 From: Romain Grecourt Date: Fri, 15 Mar 2019 11:49:30 -0700 Subject: [PATCH] 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 --- .../io/helidon/common/CollectionsHelper.java | 6 ++-- .../io/helidon/config/PollingStrategies.java | 4 +-- etc/checkstyle.xml | 16 +++++------ etc/scripts/copyright.sh | 28 ++++++++++--------- .../helidon/config/examples/basics/Main.java | 3 +- .../changes/ChangesSubscriberExample.java | 2 +- .../sources/DirectorySourceExample.java | 3 +- .../faulttolerance/FaultToleranceCommand.java | 1 - pom.xml | 2 +- 9 files changed, 33 insertions(+), 32 deletions(-) diff --git a/common/common/src/main/java/io/helidon/common/CollectionsHelper.java b/common/common/src/main/java/io/helidon/common/CollectionsHelper.java index 45f033d66..d43cedec3 100644 --- a/common/common/src/main/java/io/helidon/common/CollectionsHelper.java +++ b/common/common/src/main/java/io/helidon/common/CollectionsHelper.java @@ -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 List listOf(T ... elts){ + public static List listOf(T... elts){ List 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 Set setOf(T ... elts){ + public static Set setOf(T... elts){ Set set = new HashSet<>(); set.addAll(Arrays.asList(elts)); return Collections.unmodifiableSet(set); diff --git a/config/config/src/main/java/io/helidon/config/PollingStrategies.java b/config/config/src/main/java/io/helidon/config/PollingStrategies.java index 5dd58870e..849679111 100644 --- a/config/config/src/main/java/io/helidon/config/PollingStrategies.java +++ b/config/config/src/main/java/io/helidon/config/PollingStrategies.java @@ -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; } diff --git a/etc/checkstyle.xml b/etc/checkstyle.xml index 9b199f42d..c8849bc8a 100644 --- a/etc/checkstyle.xml +++ b/etc/checkstyle.xml @@ -1,7 +1,7 @@ @@ -133,9 +133,7 @@ - - - + diff --git a/etc/scripts/copyright.sh b/etc/scripts/copyright.sh index cdb140073..f00c7da23 100755 --- a/etc/scripts/copyright.sh +++ b/etc/scripts/copyright.sh @@ -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 \ diff --git a/examples/config/basics/src/main/java/io/helidon/config/examples/basics/Main.java b/examples/config/basics/src/main/java/io/helidon/config/examples/basics/Main.java index 4f3b02865..2c777083f 100644 --- a/examples/config/basics/src/main/java/io/helidon/config/examples/basics/Main.java +++ b/examples/config/basics/src/main/java/io/helidon/config/examples/basics/Main.java @@ -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; /** diff --git a/examples/config/changes/src/main/java/io/helidon/config/examples/changes/ChangesSubscriberExample.java b/examples/config/changes/src/main/java/io/helidon/config/examples/changes/ChangesSubscriberExample.java index 5a1d94341..28c477641 100644 --- a/examples/config/changes/src/main/java/io/helidon/config/examples/changes/ChangesSubscriberExample.java +++ b/examples/config/changes/src/main/java/io/helidon/config/examples/changes/ChangesSubscriberExample.java @@ -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; /** diff --git a/examples/config/sources/src/main/java/io/helidon/config/examples/sources/DirectorySourceExample.java b/examples/config/sources/src/main/java/io/helidon/config/examples/sources/DirectorySourceExample.java index 17c82c287..94251d236 100644 --- a/examples/config/sources/src/main/java/io/helidon/config/examples/sources/DirectorySourceExample.java +++ b/examples/config/sources/src/main/java/io/helidon/config/examples/sources/DirectorySourceExample.java @@ -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; /** diff --git a/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/FaultToleranceCommand.java b/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/FaultToleranceCommand.java index fe20a8b72..7a4ff55f8 100644 --- a/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/FaultToleranceCommand.java +++ b/microprofile/fault-tolerance/src/main/java/io/helidon/microprofile/faulttolerance/FaultToleranceCommand.java @@ -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; diff --git a/pom.xml b/pom.xml index b42a77ee7..8b9d66ae4 100644 --- a/pom.xml +++ b/pom.xml @@ -105,7 +105,7 @@ 1.5.4.1 0.31.0 2.0 - 7.4 + 8.18 3.0.0 3.0.0 2.16.0