You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/10/03 14:42:41 UTC

[GitHub] [pulsar] MarvinCai opened a new pull request #12270: Add Maven Modernizer plugin in pulsar-common module and fix violation.

MarvinCai opened a new pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270


   Master Issue: #<xyz>
   
   ### Motivation
   Apply Maven Modernizer plugin to enforce we move away from legacy APIs.
   
   ### Modifications
   Add Maven Modernizer plugin in pulsar-common module and fix violation.
   
   ### Verifying this change
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
     
   - [x] no-need-doc 
     
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] MarvinCai commented on pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
MarvinCai commented on pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#issuecomment-941855525


   @eolivelli PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] MarvinCai commented on a change in pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
MarvinCai commented on a change in pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#discussion_r727647934



##########
File path: pulsar-common/pom.xml
##########
@@ -196,6 +196,24 @@
 
   <build>
   <plugins>
+    <plugin>
+      <groupId>org.gaul</groupId>
+      <artifactId>modernizer-maven-plugin</artifactId>

Review comment:
       sure, added Modernizer into parent pom `pluginManagement` to define version in central place.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] MarvinCai commented on a change in pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
MarvinCai commented on a change in pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#discussion_r727648797



##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PersistentOfflineTopicStats.java
##########
@@ -55,8 +55,8 @@
     public PersistentOfflineTopicStats(String topicName, String brokerName) {
         this.brokerName = brokerName;
         this.topicName = topicName;
-        this.dataLedgerDetails = Lists.newArrayList();
-        this.cursorDetails = Maps.newHashMap();
+        this.dataLedgerDetails = new ArrayList<>();

Review comment:
        yeah, as discussed, it's gonna be removed module by module, not all at a time, most Guava helper newXXX without parameter is just wrapper around the diamond syntax, so should be any different switching, also it's good to encourage using native language support whenever possible




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] MarvinCai commented on a change in pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
MarvinCai commented on a change in pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#discussion_r727647934



##########
File path: pulsar-common/pom.xml
##########
@@ -196,6 +196,24 @@
 
   <build>
   <plugins>
+    <plugin>
+      <groupId>org.gaul</groupId>
+      <artifactId>modernizer-maven-plugin</artifactId>

Review comment:
       sure, added Modernizer into parent pom `pluginManagement` to define version in central place.

##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PersistentOfflineTopicStats.java
##########
@@ -55,8 +55,8 @@
     public PersistentOfflineTopicStats(String topicName, String brokerName) {
         this.brokerName = brokerName;
         this.topicName = topicName;
-        this.dataLedgerDetails = Lists.newArrayList();
-        this.cursorDetails = Maps.newHashMap();
+        this.dataLedgerDetails = new ArrayList<>();

Review comment:
        yeah, as discussed, it's gonna be removed module by module, not all at a time, most Guava helper newXXX without parameter is just wrapper around the diamond syntax, so should be any different switching, also it's good to encourage using native language support whenever possible




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] MarvinCai commented on pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
MarvinCai commented on pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#issuecomment-941855525


   @eolivelli PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] merlimat commented on a change in pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#discussion_r721651638



##########
File path: pulsar-common/pom.xml
##########
@@ -196,6 +196,24 @@
 
   <build>
   <plugins>
+    <plugin>
+      <groupId>org.gaul</groupId>
+      <artifactId>modernizer-maven-plugin</artifactId>

Review comment:
       If it's on parent pom, it will mean all the changes have to be done in a single commit which is not good. 
   
   Though the plugin version should be defined in the pluginManagement section in parent pom




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] MarvinCai commented on pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
MarvinCai commented on pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#issuecomment-941053227


   /pulsarbot run-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] merlimat commented on a change in pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#discussion_r721650563



##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PersistentOfflineTopicStats.java
##########
@@ -55,8 +55,8 @@
     public PersistentOfflineTopicStats(String topicName, String brokerName) {
         this.brokerName = brokerName;
         this.topicName = topicName;
-        this.dataLedgerDetails = Lists.newArrayList();
-        this.cursorDetails = Maps.newHashMap();
+        this.dataLedgerDetails = new ArrayList<>();

Review comment:
       I think this was already covered in the discussion here: https://lists.apache.org/thread.html/re99b342765b2cfb26f3da0eedfb78e7312de158bf6c7ed0085d32781%40%3Cdev.pulsar.apache.org%3E




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on a change in pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#discussion_r720880279



##########
File path: pulsar-common/pom.xml
##########
@@ -196,6 +196,24 @@
 
   <build>
   <plugins>
+    <plugin>
+      <groupId>org.gaul</groupId>
+      <artifactId>modernizer-maven-plugin</artifactId>

Review comment:
       We should define the plugin in the parent pom

##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PersistentOfflineTopicStats.java
##########
@@ -55,8 +55,8 @@
     public PersistentOfflineTopicStats(String topicName, String brokerName) {
         this.brokerName = brokerName;
         this.topicName = topicName;
-        this.dataLedgerDetails = Lists.newArrayList();
-        this.cursorDetails = Maps.newHashMap();
+        this.dataLedgerDetails = new ArrayList<>();

Review comment:
       I prefer this version (as probably the JVM deals better with having the constructor call insteadof havingan indirection), but we are using these helpers everywhere.
   Probably we should ask on dev@ about this style change.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on a change in pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270#discussion_r721730509



##########
File path: pulsar-common/pom.xml
##########
@@ -196,6 +196,24 @@
 
   <build>
   <plugins>
+    <plugin>
+      <groupId>org.gaul</groupId>
+      <artifactId>modernizer-maven-plugin</artifactId>

Review comment:
       Yes I meant to use pluginManagement  in order to set the version.

##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PersistentOfflineTopicStats.java
##########
@@ -55,8 +55,8 @@
     public PersistentOfflineTopicStats(String topicName, String brokerName) {
         this.brokerName = brokerName;
         this.topicName = topicName;
-        this.dataLedgerDetails = Lists.newArrayList();
-        this.cursorDetails = Maps.newHashMap();
+        this.dataLedgerDetails = new ArrayList<>();

Review comment:
       Correct.
   Thanks for the pointer 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui merged pull request #12270: [Modernizer]Add Maven Modernizer plugin in pulsar-common module and fix violation.

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #12270:
URL: https://github.com/apache/pulsar/pull/12270


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org