MartinBalin commented on code in PR #9680:
URL: https://github.com/apache/netbeans/pull/9680#discussion_r4221272268


##########
ide/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java:
##########
@@ -890,74 +567,88 @@ public void finished(boolean success) {
 
         MUTEX.writeAccess(new Mutex.Action<Void>() {
             public @Override Void run() {
-                newprjs.addAll(openProjects);
+                newprjs.addAll(openMainProjects.openProjects());
                 saveProjectList(openProjectsData);
                 if (_recentProjectsChanged) {
                     recentProjects.save();
                 }
                 return null;
             }
         });
-        
+
         final boolean recentProjectsChangedCopy = recentProjectsChanged;
-        
-        LogRecord[] addedRec = createRecord("UI_OPEN_PROJECTS", 
projectsToOpen.toArray(new Project[0])); // NOI18N
-        log(addedRec,"org.netbeans.ui.projects");
-        addedRec = createRecordMetrics("USG_PROJECT_OPEN", 
projectsToOpen.toArray(new Project[0])); // NOI18N
-        log(addedRec,"org.netbeans.ui.metrics.projects");
-        
+
+        LogRecord[] addedRec = 
OpenProjectsLogging.createRecord("UI_OPEN_PROJECTS", projectsToOpen.toArray(new 
Project[0])); // NOI18N
+            OpenProjectsLogging.log(addedRec,"org.netbeans.ui.projects");
+        addedRec = OpenProjectsLogging.createRecordMetrics("USG_PROJECT_OPEN", 
projectsToOpen.toArray(new Project[0])); // NOI18N
+            
OpenProjectsLogging.log(addedRec,"org.netbeans.ui.metrics.projects");
+
         Mutex.EVENT.readAccess(new Action<Void>() {
             @Override
             public Void run() {
                 pchSupport.firePropertyChange(PROPERTY_OPEN_PROJECTS, 
oldprjs.toArray(new Project[0]), newprjs.toArray(new Project[0]));
                 if ( recentProjectsChangedCopy ) {
                     pchSupport.firePropertyChange( PROPERTY_RECENT_PROJECTS, 
null, null );
                 }
-                
+
                 return null;
             }
         });
         } finally {
-            LOAD.exit();
+            openMainProjects.exit();
+    }
+    }
+
+    public final void replaceProjects(Collection<URL> urls, URL mainProject) {

Review Comment:
   **Replaced projects are not persisted for restart.**
   `replaceProjects() closes the previous set, which saves an empty list, but 
loading its replacement updates only memory. Replacing A with B leaves B open 
while saved URLs remain`[]`. Restart therefore loses the replacement set.



-- 
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