This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 8fd676eb2a4 [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)
8fd676eb2a4 is described below

commit 8fd676eb2a43f33dee1da3f797e0097703b87c3e
Author: Zixuan Liu <[email protected]>
AuthorDate: Mon Mar 18 21:37:03 2024 +0800

    [improve][misc] Upgrade checkstyle to 10.14.2 (#22291)
    
    (cherry picked from commit cd512e4da6a04c68d448a452c76b10b49014033d)
    
    # Conflicts:
    #       pom.xml
---
 buildtools/pom.xml                                       |  2 +-
 buildtools/src/main/resources/pulsar/checkstyle.xml      |  2 +-
 pom.xml                                                  |  2 +-
 .../broker/service/persistent/PersistentTopic.java       |  4 ++--
 .../org/apache/pulsar/compaction/CompactedTopicTest.java |  5 -----
 .../java/org/apache/pulsar/client/impl/ProducerImpl.java |  6 +++---
 .../org/apache/pulsar/common/tls/InetAddressUtils.java   | 16 +++++++++-------
 .../pulsar/common/util/collections/LongPairSet.java      |  4 ++--
 8 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/buildtools/pom.xml b/buildtools/pom.xml
index 36ed4b92c13..6b55e5e02e5 100644
--- a/buildtools/pom.xml
+++ b/buildtools/pom.xml
@@ -45,7 +45,7 @@
     <testng.version>7.7.1</testng.version>
     <commons-lang3.version>3.11</commons-lang3.version>
     <license-maven-plugin.version>4.1</license-maven-plugin.version>
-    <puppycrawl.checkstyle.version>8.37</puppycrawl.checkstyle.version>
+    <puppycrawl.checkstyle.version>10.14.2</puppycrawl.checkstyle.version>
     <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
     <netty.version>4.1.100.Final</netty.version>
     <guice.version>4.2.3</guice.version>
diff --git a/buildtools/src/main/resources/pulsar/checkstyle.xml 
b/buildtools/src/main/resources/pulsar/checkstyle.xml
index b3812ca8ccc..18075c8a8eb 100644
--- a/buildtools/src/main/resources/pulsar/checkstyle.xml
+++ b/buildtools/src/main/resources/pulsar/checkstyle.xml
@@ -179,7 +179,7 @@ page at http://checkstyle.sourceforge.net/config.html -->
         <!-- Checks for Javadoc comments.                     -->
         <!-- See http://checkstyle.sf.net/config_javadoc.html -->
         <module name="JavadocMethod">
-            <property name="scope" value="protected"/>
+            <property name="accessModifiers" value="protected"/>
             <property name="severity" value="error"/>
             <property name="allowMissingParamTags" value="true"/>
             <property name="allowMissingReturnTag" value="true"/>
diff --git a/pom.xml b/pom.xml
index aa7ceb933d8..1cd940ba7ed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,7 +158,7 @@ flexible messaging model and an intuitive client 
API.</description>
     <jackson.version>2.14.2</jackson.version>
     <reflections.version>0.10.2</reflections.version>
     <swagger.version>1.6.10</swagger.version>
-    <puppycrawl.checkstyle.version>8.37</puppycrawl.checkstyle.version>
+    <puppycrawl.checkstyle.version>10.14.2</puppycrawl.checkstyle.version>
     <docker-maven.version>0.43.3</docker-maven.version>
     <docker.verbose>true</docker.verbose>
     <typetools.version>0.5.0</typetools.version>
diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
index 24a223fe82a..a6087490744 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
@@ -885,8 +885,8 @@ public class PersistentTopic extends AbstractTopic 
implements Topic, AddEntryCal
                 lock.readLock().unlock();
             }
 
-            CompletableFuture<? extends Subscription> subscriptionFuture = 
isDurable ? //
-                    getDurableSubscription(subscriptionName, initialPosition, 
startMessageRollbackDurationSec,
+            CompletableFuture<? extends Subscription> subscriptionFuture = 
isDurable
+                    ? getDurableSubscription(subscriptionName, 
initialPosition, startMessageRollbackDurationSec,
                             replicatedSubscriptionState, 
subscriptionProperties)
                     : getNonDurableSubscription(subscriptionName, 
startMessageId, initialPosition,
                     startMessageRollbackDurationSec, readCompacted, 
subscriptionProperties);
diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java
 
b/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java
index 8524eb27aac..44272f4021e 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java
@@ -21,10 +21,8 @@ package org.apache.pulsar.compaction;
 import static org.apache.pulsar.compaction.Compactor.COMPACTION_SUBSCRIPTION;
 import com.github.benmanes.caffeine.cache.AsyncLoadingCache;
 import com.google.common.collect.Sets;
-
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -36,9 +34,7 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.stream.IntStream;
-
 import lombok.Cleanup;
-
 import org.apache.bookkeeper.client.BKException;
 import org.apache.bookkeeper.client.BookKeeper;
 import org.apache.bookkeeper.client.LedgerHandle;
@@ -47,7 +43,6 @@ import org.apache.bookkeeper.mledger.impl.PositionImpl;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.commons.lang3.tuple.Triple;
 import org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest;
-import org.apache.pulsar.broker.service.Consumer;
 import org.apache.pulsar.broker.service.Topic;
 import org.apache.pulsar.broker.service.persistent.PersistentTopic;
 import org.apache.pulsar.client.admin.LongRunningProcessStatus;
diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
index 8d2d917d7b8..3fc3bbf3cf7 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
@@ -1831,9 +1831,9 @@ public class ProducerImpl<T> extends ProducerBase<T> 
implements TimerTask, Conne
                         producerCreatedFuture.completeExceptionally(cause);
                         closeProducerTasks();
                         client.cleanupProducer(this);
-                    } else if (producerCreatedFuture.isDone() || //
-                               (cause instanceof PulsarClientException && 
PulsarClientException.isRetriableError(cause)
-                                && System.currentTimeMillis() < 
PRODUCER_DEADLINE_UPDATER.get(ProducerImpl.this))) {
+                    } else if (producerCreatedFuture.isDone()
+                            || (cause instanceof PulsarClientException && 
PulsarClientException.isRetriableError(cause)
+                            && System.currentTimeMillis() < 
PRODUCER_DEADLINE_UPDATER.get(ProducerImpl.this))) {
                         // Either we had already created the producer once 
(producerCreatedFuture.isDone()) or we are
                         // still within the initial timeout budget and we are 
dealing with a retriable error
                         future.completeExceptionally(cause);
diff --git 
a/pulsar-common/src/main/java/org/apache/pulsar/common/tls/InetAddressUtils.java
 
b/pulsar-common/src/main/java/org/apache/pulsar/common/tls/InetAddressUtils.java
index a8bf837ef56..d0f3c81a074 100644
--- 
a/pulsar-common/src/main/java/org/apache/pulsar/common/tls/InetAddressUtils.java
+++ 
b/pulsar-common/src/main/java/org/apache/pulsar/common/tls/InetAddressUtils.java
@@ -35,9 +35,12 @@ public class InetAddressUtils {
     }
 
     private static final String IPV4_BASIC_PATTERN_STRING =
-            "(([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){1}" + // 
initial first field, 1-255
-            "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){2}" + // 
following 2 fields, 0-255 followed by .
-             "([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"; // final 
field, 0-255
+            // initial first field, 1-255
+            "(([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){1}"
+                    // following 2 fields, 0-255 followed by .
+                    + 
"(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){2}"
+                    // final field, 0-255
+                    + "([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])";
 
     private static final Pattern IPV4_PATTERN =
         Pattern.compile("^" + IPV4_BASIC_PATTERN_STRING + "$");
@@ -50,10 +53,9 @@ public class InetAddressUtils {
                 "^[0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){7}$");
 
     private static final Pattern IPV6_HEX_COMPRESSED_PATTERN =
-        Pattern.compile(
-                "^(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){0,5})?)" + // 0-6 hex 
fields
-                 "::" + // concat
-                 "(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){0,5})?)$"); // 0-6 hex 
fields
+            Pattern.compile("^(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){0,5})?)" 
// 0-6 hex fields
+                    + "::"  // concat
+                    + "(([0-9A-Fa-f]{1,4}(:[0-9A-Fa-f]{1,4}){0,5})?)$"); // 
0-6 hex fields
 
     /*
      *  The above pattern is not totally rigorous as it allows for more than 7 
hex fields in total
diff --git 
a/pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/LongPairSet.java
 
b/pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/LongPairSet.java
index 3750d8c2202..e699d01b9c2 100644
--- 
a/pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/LongPairSet.java
+++ 
b/pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/LongPairSet.java
@@ -96,7 +96,7 @@ public interface LongPairSet {
     /**
      * Predicate to checks for a key-value pair where both of them have long 
types.
      */
-    public interface LongPairPredicate {
+    interface LongPairPredicate {
         boolean test(long v1, long v2);
     }
 
@@ -132,7 +132,7 @@ public interface LongPairSet {
      *
      */
     @FunctionalInterface
-    public interface LongPairFunction<T> {
+    interface LongPairFunction<T> {
 
         /**
          * Applies this function to the given arguments.

Reply via email to