You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by eo...@apache.org on 2021/05/13 07:46:16 UTC

[pulsar] 22/46: Fix checkstyle

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

eolivelli pushed a commit to branch 2.7.2_ds_tmp
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 4d1a8d79200bae83d0d26f530c46ef87d4fd0081
Author: Enrico Olivelli <eo...@apache.org>
AuthorDate: Wed May 12 11:50:43 2021 +0200

    Fix checkstyle
---
 .../src/main/resources/pulsar/checkstyle.xml       | 28 ++++++++++++----------
 .../org/apache/pulsar/client/impl/ClientCnx.java   |  1 -
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/buildtools/src/main/resources/pulsar/checkstyle.xml b/buildtools/src/main/resources/pulsar/checkstyle.xml
index 1d01c81..ecfcdb0 100644
--- a/buildtools/src/main/resources/pulsar/checkstyle.xml
+++ b/buildtools/src/main/resources/pulsar/checkstyle.xml
@@ -36,7 +36,7 @@ page at http://checkstyle.sourceforge.net/config.html -->
 
     <module name="LineLength">
         <!-- Checks if a line is too long. -->
-        <property name="max" value="120"/>
+        <property name="max" value="200"/>
         <property name="severity" value="error"/>
 
         <!--
@@ -86,8 +86,9 @@ page at http://checkstyle.sourceforge.net/config.html -->
         <property name="file" value="${checkstyle.suppressions.file}" default="suppressions.xml" />
     </module>
 
-    <!-- Check that every module has a package-info.java -->
+    <!-- Check that every module has a package-info.java 
     <module name="JavadocPackage"/>
+    -->
 
     <!-- All Java AST specific tests live under TreeWalker module. -->
     <module name="TreeWalker">
@@ -154,12 +155,14 @@ page at http://checkstyle.sourceforge.net/config.html -->
             <property name="message" value="Static import functions from Guava Preconditions"/>
         </module>
 
+	<!-- This rules makes harder cherry picks 
         <module name="UnusedImports">
             <property name="severity" value="error"/>
             <property name="processJavadoc" value="true"/>
             <message key="import.unused"
                      value="Unused import: {0}."/>
         </module>
+        -->
 
         <!--
 
@@ -185,11 +188,12 @@ page at http://checkstyle.sourceforge.net/config.html -->
             <property name="allowMissingParamTags" value="true"/>
         </module>
 
+	<!-- Disabled rules, in order to ease cherry picks
         <module name="JavadocStyle">
             <property name="severity" value="error"/>
             <property name="checkHtml" value="true"/>
         </module>
-
+        -->
         <!--
 
         NAMING CHECKS
@@ -252,13 +256,15 @@ page at http://checkstyle.sourceforge.net/config.html -->
             <property name="severity" value="error"/>
         </module>
 
+
+	<!--
         <module name="MethodNameCheck">
-            <!-- Validates identifiers for method names. -->
             <metadata name="altname" value="MethodName"/>
             <property name="format" value="(^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$|Void)"/>
             <property name="severity" value="error"/>
         </module>
-
+        -->
+        
         <module name="ParameterName">
             <!-- Validates identifiers for method parameters against the
               expression "^[a-z][a-zA-Z0-9]*$". -->
@@ -355,11 +361,8 @@ page at http://checkstyle.sourceforge.net/config.html -->
 
         -->
 
+        <!-- disabled rule, in order to ease cherry picks 
         <module name="WhitespaceAround">
-            <!-- Checks that various tokens are surrounded by whitespace.
-                 This includes most binary operators and keywords followed
-                 by regular or curly braces.
-            -->
             <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR,
         BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN,
         EQUAL, GE, GT, LAND, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
@@ -369,6 +372,7 @@ page at http://checkstyle.sourceforge.net/config.html -->
         SL, SL_ASSIGN, SR_ASSIGN, STAR, STAR_ASSIGN"/>
             <property name="severity" value="error"/>
         </module>
+        -->
 
         <module name="WhitespaceAfter">
             <!-- Checks that commas, semicolons and typecasts are followed by
@@ -396,15 +400,15 @@ page at http://checkstyle.sourceforge.net/config.html -->
             <property name="severity" value="error"/>
         </module>
 
+
+	<!-- disabled rule 
         <module name="OperatorWrap">
-            <!-- Checks that operators like + and ? appear at newlines rather than
-                 at the end of the previous line.
-            -->
             <property name="option" value="NL"/>
             <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL,
         GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD,
         NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
         </module>
+        -->
 
         <module name="OperatorWrap">
             <!-- Checks that assignment operators are at the end of the line. -->
diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
index 4fb10e4..91896ab 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
@@ -62,7 +62,6 @@ import org.apache.pulsar.client.impl.BinaryProtoLookupService.LookupDataResult;
 import org.apache.pulsar.client.impl.conf.ClientConfigurationData;
 import org.apache.pulsar.common.tls.TlsHostnameVerifier;
 import org.apache.pulsar.client.impl.transaction.TransactionBufferHandler;
-import org.apache.pulsar.client.util.TimedCompletableFuture;
 import org.apache.pulsar.common.api.AuthData;
 import org.apache.pulsar.common.api.proto.PulsarApi;
 import org.apache.pulsar.common.protocol.Commands;