sonatype-lift[bot] commented on code in PR #1766:
URL: https://github.com/apache/groovy/pull/1766#discussion_r948409220


##########
src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java:
##########
@@ -1103,6 +1104,21 @@ Person foo(B b) {}
                     onlyExtensionMethods.add(choice);
                 }
             }
+            if (onlyExtensionMethods.size() > 1) {
+                // GROOVY-8788: prefer closer parameter match over closer 
self-type match
+                bestDist = Integer.MAX_VALUE; List<MethodNode> bestExtensions 
= new LinkedList<>();

Review Comment:
   *[JdkObsolete](https://errorprone.info/bugpattern/JdkObsolete):*  It is very 
rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless 
you're willing to invest a lot of time into benchmarking. Caveat: LinkedList 
supports null elements, but ArrayDeque does not.
   
   ---
   
   
   ```suggestion
                   bestDist = Integer.MAX_VALUE; List<MethodNode> 
bestExtensions = new ArrayList<>();
   ```
   
   
   
   ---
   
   Reply with *"**@sonatype-lift help**"* for info about LiftBot commands.
   Reply with *"**@sonatype-lift ignore**"* to tell LiftBot to leave out the 
above finding from this PR.
   Reply with *"**@sonatype-lift ignoreall**"* to tell LiftBot to leave out all 
the findings from this PR and from the status bar in Github.
   
   When talking to LiftBot, you need to **refresh** the page to see its 
response. [Click here](https://help.sonatype.com/lift/talking-to-lift) to get 
to know more about LiftBot commands.
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not 
relevant](https://www.sonatype.com/lift-comment-rating?comment=317131720&lift_comment_rating=1)
 ] - [ [😕 Won't 
fix](https://www.sonatype.com/lift-comment-rating?comment=317131720&lift_comment_rating=2)
 ] - [ [😑 Not critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=317131720&lift_comment_rating=3)
 ] - [ [🙂 Critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=317131720&lift_comment_rating=4)
 ] - [ [😊 Critical, fixing 
now](https://www.sonatype.com/lift-comment-rating?comment=317131720&lift_comment_rating=5)
 ]



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to