sid-srini commented on code in PR #8827:
URL: https://github.com/apache/netbeans/pull/8827#discussion_r2348257414
##########
java/java.hints/src/org/netbeans/modules/java/hints/OrganizeImports.java:
##########
@@ -213,21 +223,27 @@ public int compare(ImportTree o1, ImportTree o2) {
return 0;
String s1 = o1.getQualifiedIdentifier().toString();
String s2 = o2.getQualifiedIdentifier().toString();
- int bal = groups.getGroupId(s1, o1.isStatic()) -
groups.getGroupId(s2, o2.isStatic());
+ int bal;
+ if (o1.isModule()) bal = o2.isModule() ? 0 : 1; // Place
module imports last
+ else if (o2.isModule()) bal = -1; // Place
module imports last
+ else bal = groups.getGroupId(s1, o1.isStatic()) -
groups.getGroupId(s2, o2.isStatic());
return bal == 0 ? s1.compareTo(s2) : bal;
}
});
}
CompilationUnitTree cut =
maker.CompilationUnit(cu.getPackageAnnotations(), cu.getPackageName(), imps,
cu.getTypeDecls(), cu.getSourceFile());
((JCCompilationUnit)cut).packge = ((JCCompilationUnit)cu).packge;
- if (starImports != null || staticStarImports != null) {
+ if (!starImports.isEmpty() || !staticStarImports.isEmpty()) {
Review Comment:
Thank you. I presumed wrongly that the null check was meant to perform
conditional assignment. I have updated this now to do unconditional assignment.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists