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.

Bug 139965 - Project [...] is not open and cannot be set as main.
Summary: Project [...] is not open and cannot be set as main.
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-15 01:19 UTC by Jesse Glick
Modified: 2008-07-17 04:43 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2008-07-15 01:19:37 UTC
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)
[...]
Comment 1 Milos Kleint 2008-07-15 11:02:31 UTC
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>
Comment 2 Jesse Glick 2008-07-15 13:26:52 UTC
<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").</>
Comment 3 Milos Kleint 2008-07-15 14:55:53 UTC
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.

Comment 4 Andrei Badea 2008-07-16 09:48:24 UTC
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.
Comment 5 Milos Kleint 2008-07-16 10:36:23 UTC
http://hg.netbeans.org/main/rev/ab36dd38b95c
Comment 6 Jesse Glick 2008-07-16 17:52:53 UTC
Is this not for M2? (See Target Milestone.)
Comment 7 Quality Engineering 2008-07-17 04:43:04 UTC
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.