jtulach commented on code in PR #9834:
URL: https://github.com/apache/netbeans/pull/9834#discussion_r4730218700
##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectsRootKeys.java:
##########
@@ -111,15 +124,21 @@ Collection<PrjInfo> getKeys() {
var nestedSize = nested.size();
nestedArr[0] = nestedSize;
- var p = new ProjectsRootKeys.PrjInfo(prj, type, nestedArr);
- nested.add(prj.getProjectDirectory());
- dirs.add(p);
- snapshot.put(prj, p);
+ PrjInfo parent = nested.isEmpty() ? null : nested.peekLast();
+ PrjInfo info = new ProjectsRootKeys.PrjInfo(prj, type, nestedArr);
+ nested.add(info);
+ var children = parentship.get(parent);
+ if (children == null) {
+ children = new TreeSet<>(byProjectDisplayName);
+ parentship.put(parent, children);
+ }
+ children.add(info);
Review Comment:
I tried to use the “lambda style”, but then resortem back to old good if…
--
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