You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "junichi11 (via GitHub)" <gi...@apache.org> on 2023/04/08 14:11:29 UTC

[GitHub] [netbeans] junichi11 opened a new pull request, #5797: Sort overload methods in the Navigator

junichi11 opened a new pull request, #5797:
URL: https://github.com/apache/netbeans/pull/5797

   #### Before:
   
   ![java-navigator-sort-overload-methods-before](https://user-images.githubusercontent.com/738383/230725665-0acd9f66-cac6-4b83-a358-36d945a007ec.png)
   
   
   #### After:
   
   ![java-navigator-sort-overload-methods-after](https://user-images.githubusercontent.com/738383/230725670-38fefdeb-5989-4bfd-aeee-fdf520adf160.png)
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #5797: Sort overload methods in the Navigator

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #5797:
URL: https://github.com/apache/netbeans/pull/5797#issuecomment-1502466424

   Applied the suggested change from @matthiasblaesing . Thank you for it!


-- 
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: notifications-unsubscribe@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on a diff in pull request #5797: Sort overload methods in the Navigator

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on code in PR #5797:
URL: https://github.com/apache/netbeans/pull/5797#discussion_r1162039142


##########
java/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java:
##########
@@ -673,7 +673,12 @@ int alphaCompare( Description d1, Description d2 ) {
                 if (d1.posInKind != d2.posInKind) {
                     return d1.posInKind - d2.posInKind;
                 }
-                return d1.name.compareTo(d2.name);
+                int compareToName = d1.name.compareTo(d2.name);
+                if (compareToName == 0) {
+                    return d1.htmlHeader.compareTo(d2.htmlHeader);

Review Comment:
   If I read the code correctly, `htmlHeader` of `Description` can be `null` - at least one place explicitly checks for it:
   
   https://github.com/apache/netbeans/blob/58c281ff2b9d06bfc9cb3204d99895c8b4b7979f/java/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java#L302-L305
   
   Without having done a deep analysis, this looks as if `htmlHeader` might stay uninitialized here:
   
   https://github.com/apache/netbeans/blob/58c281ff2b9d06bfc9cb3204d99895c8b4b7979f/java/java.navigation/src/org/netbeans/modules/java/navigation/ElementScanningTask.java#L357-L370
   
   I suggest this:
   
   ```suggestion
                       String htmlHeader1 = d1.htmlHeader != null ? d1.htmlHeader : "";
                       String htmlHeader2 = d2.htmlHeader != null ? d2.htmlHeader : "";
                       return htmlHeader1.compareTo(htmlHeader2);
   ```
   
   I expect only minimal impact by the `null` check.



-- 
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: notifications-unsubscribe@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #5797: Sort overload methods in the Navigator

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #5797:
URL: https://github.com/apache/netbeans/pull/5797#discussion_r1162150801


##########
java/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java:
##########
@@ -673,7 +673,12 @@ int alphaCompare( Description d1, Description d2 ) {
                 if (d1.posInKind != d2.posInKind) {
                     return d1.posInKind - d2.posInKind;
                 }
-                return d1.name.compareTo(d2.name);
+                int compareToName = d1.name.compareTo(d2.name);
+                if (compareToName == 0) {
+                    return d1.htmlHeader.compareTo(d2.htmlHeader);

Review Comment:
   You are right! Will fix it. Thanks!



-- 
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: notifications-unsubscribe@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 merged pull request #5797: Sort overload methods in the Navigator

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 merged PR #5797:
URL: https://github.com/apache/netbeans/pull/5797


-- 
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: notifications-unsubscribe@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #5797: Sort overload methods in the Navigator

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #5797:
URL: https://github.com/apache/netbeans/pull/5797#issuecomment-1504164691

   @matthiasblaesing Thank you for your review and your time. I'll merge 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: notifications-unsubscribe@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists