This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I had shut down the IDE with one project open (not set as main) and with the Output Window maximized. I restarted the IDE and pressed F11. I was asked to pick a main project, so I picked the open project. Then this exception was thrown. Of course the project really was open. Perhaps a side effect of lazy project loading? (When I pressed F11, the OW was still the only window showing; in particular, I had not expanded the project node in that IDE session.) java.lang.IllegalArgumentException: NB_REPORTER_IGNORE: Project [...] is not open and cannot be set as main. at org.netbeans.modules.project.ui.OpenProjectList.setMainProject(OpenProjectList.java:774) at org.netbeans.modules.project.ui.actions.MainProjectAction.showNoMainProjectWarning(MainProjectAction.java:211) at org.netbeans.modules.project.ui.actions.MainProjectAction.actionPerformed(MainProjectAction.java:111) [...]
yet another issue connected with lazy project loading. <rant> i'm wondering if the destabilization of the codebase is worth the perceived performance improvement. We've just traded the complaints about "slow IDE" for "buggy IDE". </rant>
<off-topic>I've also found the lazy project loading to be rather buggy. Would seem like a better strategy to just profile what is slowest about loading real projects and optimize that. Anyway the projects you have open will most likely need to be loaded before you can begin any real work. Generally speaking it is better to do necessary work (as quickly as possible) during startup, rather than asynchronously later (i.e. "Windows XP syndrome").</>
I can see 2 main problems with lazy loading. 1. while previously the projects were loaded from single thread and prepared for work, now the IDE startup starts loading projects left and right, not even sure it's reasonably delayed anyway. 2. as shown by this issue, lazy loading makes ProjectManager out of sync with OpenProjects on startup. Since actions and other features use open projects as limiting scope, the IDE is not usable anyway until an undefined moment in future when open projects get loaded. I agree with jesse that lazy project loading was a mistake and more in depth analysis of the problem shall have been done.
For me, lazy project loading hasn't made the startup noticeably faster, since I still need to wait until the projects have loaded, initial scanning has finished, etc. Yes, the main window pops up quickly, but that could probably have been achieved in a simpler and less asynchronous way. For example, the four-letter competitor displays a tips & tricks window while doing the startup work.
http://hg.netbeans.org/main/rev/ab36dd38b95c
Is this not for M2? (See Target Milestone.)
Integrated into 'main-golden', available in NB_Trunk_Production #324 build Changeset: http://hg.netbeans.org/main/rev/ab36dd38b95c User: Milos Kleint <mkleint@netbeans.org> Log: #139965 the project passed in here can be different from the current one. eg when the ManProjectAction shows a list of opened projects, it lists the "non-loaded skeletons" but when the user eventually selects one, the openProjects list already might hold the correct loaded list.