[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-26 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769323#comment-17769323
 ] 

ASF GitHub Bot commented on MNG-7416:
-

timtebeek commented on code in PR #227:
URL: 
https://github.com/apache/maven-plugin-tools/pull/227#discussion_r1337690988


##
maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java:
##
@@ -510,7 +510,7 @@ private Map 
extractFieldParameterTags(JavaClass javaClass) {
 if (superClass != null) {
 rawParams = extractFieldParameterTags(superClass);
 } else {
-rawParams = new TreeMap();
+rawParams = new TreeMap<>();

Review Comment:
   I'll keep an eye out of future PRs for this pattern, although I think we've 
gone through the vast majority by now. There's a  couple projects left with one 
or two cases, which I hope to pick up along with other more meaningful changes.





> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-26 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769203#comment-17769203
 ] 

ASF GitHub Bot commented on MNG-7416:
-

elharo merged PR #227:
URL: https://github.com/apache/maven-plugin-tools/pull/227




> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-26 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769204#comment-17769204
 ] 

ASF GitHub Bot commented on MNG-7416:
-

elharo commented on code in PR #227:
URL: 
https://github.com/apache/maven-plugin-tools/pull/227#discussion_r1337283480


##
maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java:
##
@@ -510,7 +510,7 @@ private Map 
extractFieldParameterTags(JavaClass javaClass) {
 if (superClass != null) {
 rawParams = extractFieldParameterTags(superClass);
 } else {
-rawParams = new TreeMap();
+rawParams = new TreeMap<>();

Review Comment:
   Doesn't matter that much. The variable declaration wasn't in view by default 
in Github code review. I do think there's a real tendency for devs to argue 
that, "In my tool it's obvious" when advocating for more compact, less 
redundant syntax without really considering how it looks in other environments. 
I often hear folks claim that IDEs make certain constructs unnecessary. We can 
be really myopic about that, even to the point of saving a few milliseconds of 
typing right now at the cost of hours of debugging to our future selves. The 
real cost here is in lambdas and method chaining, which are extremely opaque 
and hard to read, all to save the trivial effort of typing a few more local 
variables.





> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-26 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769192#comment-17769192
 ] 

ASF GitHub Bot commented on MNG-7416:
-

timtebeek commented on code in PR #227:
URL: 
https://github.com/apache/maven-plugin-tools/pull/227#discussion_r1337254040


##
maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java:
##
@@ -510,7 +510,7 @@ private Map 
extractFieldParameterTags(JavaClass javaClass) {
 if (superClass != null) {
 rawParams = extractFieldParameterTags(superClass);
 } else {
-rawParams = new TreeMap();
+rawParams = new TreeMap<>();

Review Comment:
   Hmm, yes I guess that's true; would you want me to revert it here? Or keep 
it since the variable is still mostly in view?
   
   Alternatively we can pull down the variable declaration to just above the if 
statement, as that would also clear up any ambiguity.





> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-26 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769151#comment-17769151
 ] 

ASF GitHub Bot commented on MNG-7416:
-

elharo merged PR #63:
URL: https://github.com/apache/maven-project-info-reports-plugin/pull/63




> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-26 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769145#comment-17769145
 ] 

ASF GitHub Bot commented on MNG-7416:
-

elharo merged PR #333:
URL: https://github.com/apache/maven-resolver/pull/333




> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-26 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769139#comment-17769139
 ] 

ASF GitHub Bot commented on MNG-7416:
-

elharo commented on code in PR #227:
URL: 
https://github.com/apache/maven-plugin-tools/pull/227#discussion_r1337100795


##
maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java:
##
@@ -510,7 +510,7 @@ private Map 
extractFieldParameterTags(JavaClass javaClass) {
 if (superClass != null) {
 rawParams = extractFieldParameterTags(superClass);
 } else {
-rawParams = new TreeMap();
+rawParams = new TreeMap<>();

Review Comment:
   Looking at this one, I realize the diamond operator with no params is more 
useful for the case where it's declared on the same line. 
   
   TreeMap rawParams = new TreeMap();
   
   does seem redundant
   
   rawParams = new TreeMap();
   
   is not. Haven't noticed that before.





> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-25 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17768916#comment-17768916
 ] 

ASF GitHub Bot commented on MNG-7416:
-

timtebeek opened a new pull request, #333:
URL: https://github.com/apache/maven-resolver/pull/333

   @elharo since there's a long tail of projects that can still pick up diamond 
operators, I've started to combine those with the low volume simplify 
conditional expression. 
   - https://issues.apache.org/jira/browse/MNG-6847
   - https://issues.apache.org/jira/browse/MNG-7416
   
   Figured that'd strike the right balance between still delivering value, 
while also minimizing PRs and reviews.
   
   Use this link to re-run the recipe: 
https://app.moderne.io/recipes/builder/SEvWu02zw?organizationId=QXBhY2hlIE1hdmVu




> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-25 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17768915#comment-17768915
 ] 

ASF GitHub Bot commented on MNG-7416:
-

timtebeek opened a new pull request, #63:
URL: https://github.com/apache/maven-project-info-reports-plugin/pull/63

   @elharo since there's a long tail of projects that can still pick up diamond 
operators, I've started to combine those with the low volume simplify 
conditional expression. 
   - https://issues.apache.org/jira/browse/MNG-6847
   - https://issues.apache.org/jira/browse/MNG-7416
   
   Figured that'd strike the right balance between still delivering value, 
while also minimizing PRs and reviews.
   
   Use this link to re-run the recipe: 
https://app.moderne.io/recipes/builder/SEvWu02zw?organizationId=QXBhY2hlIE1hdmVu




> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-09-25 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17768914#comment-17768914
 ] 

ASF GitHub Bot commented on MNG-7416:
-

timtebeek opened a new pull request, #227:
URL: https://github.com/apache/maven-plugin-tools/pull/227

   @elharo since there's a long tail of projects that can still pick up diamond 
operators, I've started to combine those with the low volume simplify 
conditional expression. 
   - https://issues.apache.org/jira/browse/MNG-6847
   - https://issues.apache.org/jira/browse/MNG-7416
   
   Figured that'd strike the right balance between 
   
   Use this link to re-run the recipe: 
https://app.moderne.io/recipes/builder/SEvWu02zw?organizationId=QXBhY2hlIE1hdmVu




> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-06-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17735761#comment-17735761
 ] 

ASF GitHub Bot commented on MNG-7416:
-

arturobernalg closed pull request #679: MNG-7416 - Simplify conditional 
expression.
URL: https://github.com/apache/maven/pull/679




> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7416) Simplify conditional expression.

2023-03-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17702261#comment-17702261
 ] 

ASF GitHub Bot commented on MNG-7416:
-

michael-o commented on PR #679:
URL: https://github.com/apache/maven/pull/679#issuecomment-1475209942

   @arturobernalg Can you please rebase, I will try to take another look.




> Simplify conditional expression.
> 
>
> Key: MNG-7416
> URL: https://issues.apache.org/jira/browse/MNG-7416
> Project: Maven
>  Issue Type: Improvement
>Reporter: Arturo Bernal
>Priority: Minor
>
> Simplify conditional expression and avoid extra computations. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)