Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Update checkstyle plugin version, javadoc, and license (#241)
Browse files Browse the repository at this point in the history
* Update checkstyle plugin version

* Update checkstyle and licenses

* Update javadoc
  • Loading branch information
Rafał Leszko authored Aug 5, 2020
1 parent aff6c86 commit cd4640a
Show file tree
Hide file tree
Showing 26 changed files with 83 additions and 119 deletions.
3 changes: 1 addition & 2 deletions checkstyle/ClassHeader.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand All @@ -13,4 +13,3 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

33 changes: 17 additions & 16 deletions checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
~ Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
~ Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down Expand Up @@ -59,7 +59,9 @@
</module>

<!-- Enable suppression of file contents using //CHECKSTYLE:[ON|OFF] comments -->
<!--
<module name="SuppressionCommentFilter"/>
-->

<!-- Enable the suppression annotation @SuppressWarnings("checkstyle:lowercasecheckname"} -->
<module name="SuppressWarningsFilter"/>
Expand All @@ -71,7 +73,7 @@
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf" />
<property name="lineSeparator" value="lf"/>
</module>

<!-- Checks that property files contain the same keys. -->
Expand Down Expand Up @@ -104,10 +106,11 @@
<property name="fileExtensions" value="java"/>
</module>

<module name="TreeWalker">
<!-- Activate comment suppression filters -->
<module name="FileContentsHolder"/>
<module name="LineLength">
<property name="max" value="130"/>
</module>

<module name="TreeWalker">
<!-- Needed for SuppressWarningsFilter to work -->
<module name="SuppressWarningsHolder"/>

Expand Down Expand Up @@ -159,9 +162,6 @@

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="130"/>
</module>
<module name="MethodLength">
<property name="tokens" value="METHOD_DEF"/>
<property name="max" value="60"/>
Expand Down Expand Up @@ -225,7 +225,6 @@

<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<module name="ArrayTrailingComma"/>
<module name="CovariantEquals"/>
<module name="DeclarationOrder"/>
<module name="ExplicitInitialization"/>
Expand All @@ -249,9 +248,9 @@
<property name="tokens" value="PARAMETER_DEF, METHOD_DEF"/>
</module>
<module name="InnerAssignment"/>
<module name="JUnitTestCase"/>
<module name="ReturnCount">
<property name="max" value="8"/>
<property name="maxForVoid" value="8"/>
</module>
<module name="NestedIfDepth">
<property name="max" value="2"/>
Expand All @@ -260,10 +259,6 @@
<property name="max" value="2"/>
</module>
<module name="PackageDeclaration"/>
<module name="RedundantThrows">
<property name="severity" value="warning"/>
<property name="allowUnchecked" value="true"/>
</module>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
Expand Down Expand Up @@ -303,7 +298,12 @@
<property name="max" value="12"/>
</module>
<module name="NPathComplexity">
<property name="max" value="50"/>
<!-- TODO Agree on the value
Checkstyle 7.7 improved the NPath algorithm further that leads to higher NPath counts.
7.6 passes with max 50, 7.7 needs it to be set to at least 216
the default threshold is 200
-->
<property name="max" value="250"/>
</module>

<!-- Miscellaneous other checks. -->
Expand All @@ -315,7 +315,8 @@
<module name="RegexpSinglelineJava">
<property name="format" value="(import static java\.util\.UUID\.randomUUID|UUID\.randomUUID\(\))"/>
<property name="ignoreComments" value="true"/>
<property name="message" value="Please use UuidUtil.buildRandomUUID() instead of UUID.randomUUID()!"/>
<property name="message"
value="Please use UuidUtil.newUnsecureUUID() or UuidUtil.newSecureUUID() instead of UUID.randomUUID()"/>
</module>
</module>
</module>
11 changes: 1 addition & 10 deletions checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>

<!--
~ Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
~ Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand All @@ -22,13 +22,4 @@

<suppressions>

<!-- Suppress strict duplicate code checking -->
<suppress checks="StrictDuplicateCode" files="\.java" lines="1-15"/>

<!-- Kubernetes -->
<suppress checks="JavadocType" files="com/hazelcast/kubernetes/"/>

<!-- Exclude Clover instrumented sources -->
<suppress checks="" files="/src-instrumented/"/>

</suppressions>
2 changes: 1 addition & 1 deletion findbugs/findbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
~ Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
19 changes: 4 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
~ Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand All @@ -12,19 +12,8 @@
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
--><!--
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.hazelcast</groupId>
Expand Down Expand Up @@ -53,7 +42,7 @@

<hazelcast.version>4.1-SNAPSHOT</hazelcast.version>

<maven.checkstyle.plugin.version>2.15</maven.checkstyle.plugin.version>
<maven.checkstyle.plugin.version>3.1.1</maven.checkstyle.plugin.version>
<maven.findbugs.plugin.version>3.0.5</maven.findbugs.plugin.version>
<maven.surefire.plugin.version>2.22.2</maven.surefire.plugin.version>
<maven.sonar.plugin.version>3.3.0.603</maven.sonar.plugin.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
42 changes: 21 additions & 21 deletions src/main/java/com/hazelcast/kubernetes/KubernetesProperties.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down Expand Up @@ -31,7 +31,7 @@
public final class KubernetesProperties {

/**
* <p>Configuration System Environment Prefix: <tt>hazelcast.kubernetes.</tt></p>
* <p>Configuration System Environment Prefix: <code>hazelcast.kubernetes.</code></p>
* Defines the prefix for system environment variables and JVM command line parameters.<br>
* Defining or overriding properties as JVM parameters or using the system environment, those
* properties need to be prefixed to prevent collision on property names.<br>
Expand All @@ -49,95 +49,95 @@ public final class KubernetesProperties {
public static final String KUBERNETES_SYSTEM_PREFIX = "hazelcast.kubernetes.";

/**
* <p>Configuration key: <tt>service-dns</tt></p>
* <p>Configuration key: <code>service-dns</code></p>
* Defines the DNS service lookup domain. This is defined as something similar
* to <tt>my-svc.my-namespace.svc.cluster.local</tt>.<br>
* to <code>my-svc.my-namespace.svc.cluster.local</code>.<br>
* For more information please refer to the official documentation of the Kubernetes DNS addon,
* <a href="https://github.com/kubernetes/kubernetes/tree/v1.0.6/cluster/addons/dns">here</a>.
*/
public static final PropertyDefinition SERVICE_DNS = property("service-dns", STRING);

/**
* <p>Configuration key: <tt>service-dns-timeout</tt></p>
* <p>Configuration key: <code>service-dns-timeout</code></p>
* Defines the DNS service lookup timeout in seconds. Defaults to: 5 secs.
*/
public static final PropertyDefinition SERVICE_DNS_TIMEOUT = property("service-dns-timeout", INTEGER);

/**
* <p>Configuration key: <tt>service-name</tt></p>
* <p>Configuration key: <code>service-name</code></p>
* Defines the service name of the POD to lookup through the Service Discovery REST API of Kubernetes.
*/
public static final PropertyDefinition SERVICE_NAME = property("service-name", STRING);
/**
* <p>Configuration key: <tt>service-label-name</tt></p>
* <p>Configuration key: <code>service-label-name</code></p>
* Defines the service label to lookup through the Service Discovery REST API of Kubernetes.
*/
public static final PropertyDefinition SERVICE_LABEL_NAME = property("service-label-name", STRING);
/**
* <p>Configuration key: <tt>service-label-value</tt></p>
* <p>Configuration key: <code>service-label-value</code></p>
* Defines the service label value to lookup through the Service Discovery REST API of Kubernetes.
*/
public static final PropertyDefinition SERVICE_LABEL_VALUE = property("service-label-value", STRING);

/**
* <p>Configuration key: <tt>namespace</tt></p>
* <p>Configuration key: <code>namespace</code></p>
* Defines the namespace of the application POD through the Service Discovery REST API of Kubernetes.
*/
public static final PropertyDefinition NAMESPACE = property("namespace", STRING);

/**
* <p>Configuration key: <tt>pod-label-name</tt></p>
* <p>Configuration key: <code>pod-label-name</code></p>
* Defines the pod label to lookup through the Service Discovery REST API of Kubernetes.
*/
public static final PropertyDefinition POD_LABEL_NAME = property("pod-label-name", STRING);
/**
* <p>Configuration key: <tt>pod-label-value</tt></p>
* <p>Configuration key: <code>pod-label-value</code></p>
* Defines the pod label value to lookup through the Service Discovery REST API of Kubernetes.
*/
public static final PropertyDefinition POD_LABEL_VALUE = property("pod-label-value", STRING);

/**
* <p>Configuration key: <tt>resolve-not-ready-addresses</tt></p>
* <p>Configuration key: <code>resolve-not-ready-addresses</code></p>
* Defines if not ready addresses should be evaluated to be discovered on startup.
*/
public static final PropertyDefinition RESOLVE_NOT_READY_ADDRESSES = property("resolve-not-ready-addresses", BOOLEAN);

/**
* <p>Configuration key: <tt>use-node-name-as-external-address</tt></p>
* <p>Configuration key: <code>use-node-name-as-external-address</code></p>
* Defines if the node name should be used as external address, instead of looking up the external IP using
* the <code>/nodes</code> resource. Default is false.
*/
public static final PropertyDefinition USE_NODE_NAME_AS_EXTERNAL_ADDRESS = property("use-node-name-as-external-address",
BOOLEAN);

/**
* <p>Configuration key: <tt>kubernetes-api-retries</tt></p>
* <p>Configuration key: <code>kubernetes-api-retries</code></p>
* Defines the number of retries to Kubernetes API. Defaults to: 3.
*/
public static final PropertyDefinition KUBERNETES_API_RETIRES = property("kubernetes-api-retries", INTEGER);

/**
* <p>Configuration key: <tt>kubernetes-master</tt></p>
* Defines an alternative address for the kubernetes master. Defaults to: <tt>https://kubernetes.default.svc</tt>
* <p>Configuration key: <code>kubernetes-master</code></p>
* Defines an alternative address for the kubernetes master. Defaults to: <code>https://kubernetes.default.svc</code>
*/
public static final PropertyDefinition KUBERNETES_MASTER_URL = property("kubernetes-master", STRING);

/**
* <p>Configuration key: <tt>api-token</tt></p>
* <p>Configuration key: <code>api-token</code></p>
* Defines an oauth token for the kubernetes client to access the kubernetes REST API. Defaults to reading the
* token from the auto-injected file at: <tt>/var/run/secrets/kubernetes.io/serviceaccount/token</tt>
* token from the auto-injected file at: <code>/var/run/secrets/kubernetes.io/serviceaccount/token</code>
*/
public static final PropertyDefinition KUBERNETES_API_TOKEN = property("api-token", STRING);

/**
* Configuration key: <tt>ca-certificate</tt>
* Configuration key: <code>ca-certificate</code>
* CA Authority certificate from Kubernetes Master, defaults to reading the certificate from the auto-injected file at:
* <tt>/var/run/secrets/kubernetes.io/serviceaccount/ca.crt</tt>
* <code>/var/run/secrets/kubernetes.io/serviceaccount/ca.crt</code>
*/
public static final PropertyDefinition KUBERNETES_CA_CERTIFICATE = property("ca-certificate", STRING);

/**
* <p>Configuration key: <tt>service-port</tt></p>
* <p>Configuration key: <code>service-port</code></p>
* If specified with a value greater than 0, its value defines the endpoint port of the service (overriding the default).
*/
public static final PropertyDefinition SERVICE_PORT = property("service-port", INTEGER);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/hazelcast/kubernetes/RestClient.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/hazelcast/kubernetes/RetryUtils.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/hazelcast/kubernetes/package-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
Expand Down
Loading

0 comments on commit cd4640a

Please sign in to comment.