You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/08/10 07:35:27 UTC

[GitHub] [maven-jar-plugin] rhowe opened a new pull request, #47: Code simplifications

rhowe opened a new pull request, #47:
URL: https://github.com/apache/maven-jar-plugin/pull/47

   I saw a few opportunities to simplify the codebase - if these look OK, I'm happy to create a Jira ticket and amend this PR to reference it, etc.


-- 
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: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-jar-plugin] olamy merged pull request #47: Code simplifications in AbstractMojo

Posted by GitBox <gi...@apache.org>.
olamy merged PR #47:
URL: https://github.com/apache/maven-jar-plugin/pull/47


-- 
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: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-jar-plugin] rhowe commented on a diff in pull request #47: Code simplifications in AbstractMojo

Posted by GitBox <gi...@apache.org>.
rhowe commented on code in PR #47:
URL: https://github.com/apache/maven-jar-plugin/pull/47#discussion_r945105160


##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -196,16 +196,17 @@ protected File getJarFile( File basedir, String resultFinalName, String classifi
             throw new IllegalArgumentException( "finalName is not allowed to be null" );
         }
 
-        StringBuilder fileName = new StringBuilder( resultFinalName );
-
+        final String fileName;

Review Comment:
   Oops, OK the final `final` is gone



-- 
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: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-jar-plugin] rhowe commented on a diff in pull request #47: Code simplifications

Posted by GitBox <gi...@apache.org>.
rhowe commented on code in PR #47:
URL: https://github.com/apache/maven-jar-plugin/pull/47#discussion_r943145103


##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -196,16 +196,17 @@ protected File getJarFile( File basedir, String resultFinalName, String classifi
             throw new IllegalArgumentException( "finalName is not allowed to be null" );
         }
 
-        StringBuilder fileName = new StringBuilder( resultFinalName );
-
+        final String fileName;

Review Comment:
   The less I need to touch Jira the better. OK, I've removed the `final`s and updated the PR description



-- 
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: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-jar-plugin] olamy commented on a diff in pull request #47: Code simplifications in AbstractMojo

Posted by GitBox <gi...@apache.org>.
olamy commented on code in PR #47:
URL: https://github.com/apache/maven-jar-plugin/pull/47#discussion_r944120213


##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -196,16 +196,17 @@ protected File getJarFile( File basedir, String resultFinalName, String classifi
             throw new IllegalArgumentException( "finalName is not allowed to be null" );
         }
 
-        StringBuilder fileName = new StringBuilder( resultFinalName );
-
+        final String fileName;

Review Comment:
   @rhowe great. Thanks! Still on final to remove  ;) 



-- 
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: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-jar-plugin] michael-o commented on a diff in pull request #47: Code simplifications

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #47:
URL: https://github.com/apache/maven-jar-plugin/pull/47#discussion_r942298190


##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -243,18 +244,11 @@ public File createArchive()
             }
         }
 
+        final String archiverName = containsModuleDescriptor ? "mjar" : "jar";

Review Comment:
   oh oh, I know people they insinst on final...



-- 
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: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-jar-plugin] rhowe commented on a diff in pull request #47: Code simplifications

Posted by GitBox <gi...@apache.org>.
rhowe commented on code in PR #47:
URL: https://github.com/apache/maven-jar-plugin/pull/47#discussion_r942610239


##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -196,16 +196,17 @@ protected File getJarFile( File basedir, String resultFinalName, String classifi
             throw new IllegalArgumentException( "finalName is not allowed to be null" );
         }
 
-        StringBuilder fileName = new StringBuilder( resultFinalName );
-
+        final String fileName;

Review Comment:
   No real need, it's mostly just syntactic sugar in this case. It's somewhat a statement of intent indicating that the value will be calculated only once.
   This was the kind of feedback I was seeking though - if you're happy with the changeset in principle, I'll take the `final`s out, cut a Jira ticket and make the PR more presentable etc.



-- 
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: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-jar-plugin] olamy commented on a diff in pull request #47: Code simplifications

Posted by GitBox <gi...@apache.org>.
olamy commented on code in PR #47:
URL: https://github.com/apache/maven-jar-plugin/pull/47#discussion_r943016081


##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -196,16 +196,17 @@ protected File getJarFile( File basedir, String resultFinalName, String classifi
             throw new IllegalArgumentException( "finalName is not allowed to be null" );
         }
 
-        StringBuilder fileName = new StringBuilder( resultFinalName );
-
+        final String fileName;

Review Comment:
   all good. please remove those `final` as I don't think they make sense for a local variable. except adding more useless code.
   btw I'm more a sugar free person if it's not really needed 🤣 
   if you want to create a jira why not but I'm not sure we need a Jira for such code polishing.
   it's up2u



-- 
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: issues-unsubscribe@maven.apache.org

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


[GitHub] [maven-jar-plugin] olamy commented on a diff in pull request #47: Code simplifications

Posted by GitBox <gi...@apache.org>.
olamy commented on code in PR #47:
URL: https://github.com/apache/maven-jar-plugin/pull/47#discussion_r942293720


##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -196,16 +196,17 @@ protected File getJarFile( File basedir, String resultFinalName, String classifi
             throw new IllegalArgumentException( "finalName is not allowed to be null" );
         }
 
-        StringBuilder fileName = new StringBuilder( resultFinalName );
-
+        final String fileName;

Review Comment:
   not sure what is the need if final here?



##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -243,18 +244,11 @@ public File createArchive()
             }
         }
 
+        final String archiverName = containsModuleDescriptor ? "mjar" : "jar";

Review Comment:
   why final? no real need of this



-- 
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: issues-unsubscribe@maven.apache.org

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