jtulach commented on code in PR #9821:
URL: https://github.com/apache/netbeans/pull/9821#discussion_r4732583750


##########
ide/projectui/src/org/netbeans/modules/project/ui/groups/Group.java:
##########
@@ -591,12 +594,14 @@ static void open(final Group g, String oldGroupName, 
boolean isNewGroup, Prefere
             IndexingBridge.Lock lock = 
IndexingBridge.getDefault().protectedMode();
             try {
                 h.progress(Group_progress_closing(toClose.size()), 110);
+                Project[] arrClose = toClose.toArray(new Project[0]);
                 //close and remember the last opened files in the old group
-                opl.close(toClose.toArray(new Project[0]), false, 
oldGroupName);
+                opl.close(arrClose, false, oldGroupName);
                 h.switchToIndeterminate();
                 h.progress(Group_progress_opening(toOpen.size()));
                 //open the projects with current group
-                opl.open(toOpen.toArray(new Project[0]), false, false, h, 
null);
+                Project[] arrOpen = toOpen.toArray(new Project[0]);
+                opl.open(arrOpen, false, g != null && g.isSubprojects(), h, 
null);

Review Comment:
   Well, this one is tough!
   - if we want to defer computing subprojects for later
   - then they cannot be known here and `newOpen` is clearly not containing all 
the projects
   - the best I can think of is to **move this logic into open logic** itself
   - have `OpenProjectList.open(... boolean replacePrevious ...)` and let it 
return added/remove projects
   
   I have to think about 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: [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

Reply via email to