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 65349 - Project opening takes a long time blocking AWT thread without any progress indication
Summary: Project opening takes a long time blocking AWT thread without any progress in...
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords: PERFORMANCE
Depends on: 144641
Blocks:
  Show dependency tree
 
Reported: 2005-09-29 14:17 UTC by Antonin Nebuzelsky
Modified: 2011-10-11 22:11 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The patch. (20.80 KB, patch)
2005-10-11 15:08 UTC, Jan Lahoda
Details | Diff
The commit log. (2.17 KB, text/plain)
2005-10-14 08:40 UTC, Jan Lahoda
Details
screenshot of modal dialog (38.90 KB, image/png)
2005-10-18 10:39 UTC, Jindrich Dinga
Details
proposal of modal dialog (46.26 KB, image/png)
2005-10-18 10:39 UTC, Jindrich Dinga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2005-09-29 14:17:08 UTC
Opening project of any project type takes a long time, blocks AWT thread and
does not provide any busy indication at all. The opening should be made faster,
but first of all it should not make NB gray for many seconds without even
hour-glass cursor.
Comment 1 Jan Lahoda 2005-09-29 19:33:45 UTC
Agree with the busy indication. I did some experiments some time ago, and it
should be possible to show a progress bar during opening the projects.

OTOH, some profiling will be necessary to find out if the projects
infrastructure can make the opening faster, or if the opening is slow because of
individual project types.
Comment 2 Jesse Glick 2005-09-30 01:23:55 UTC
I think the slowness is caused by individual project types (and/or ant/project),
but the Open Project dialog still needs to show progress anyway.
Comment 3 Jan Lahoda 2005-10-11 15:02:39 UTC
I will attach a patch that does the following:
1. Adds a method OpenProjectList.open(Project[], boolean, boolean
asynchronously). Argument asynchronously causes the open to run in a reuqest
processor, showing a progress dialog. (The open method returns after all the
project are opened.)
2. All calls through OpenProjects API have asynchronously == false and so the
projects are opened in the caller thread.
3. Calls from:
a)Open project dialog
b)New project dialog
c)Open required projects action
use asynchronously == true and so run on background with a progress dialog.

To make it all work well, it is necessary to call
ProjectOpenedHook.projectOpened in the request processor thread if
asynchronously == true.

Jesse, could you please do a quick review of the patch? (I will remove dependecy
on jdesktop.layout before commit, as it is not necessary.)

Thanks.
Comment 4 Jan Lahoda 2005-10-11 15:08:59 UTC
Created attachment 25805 [details]
The patch.
Comment 5 Jesse Glick 2005-10-11 16:54:37 UTC
I guess it's OK (no time for a detailed review). But wouldn't it be simpler to
have just one method, which would have current behavior if called from EQ, and
new behavior if called from any other thread? Method would continue to only
return when really finished.
Comment 6 Jan Lahoda 2005-10-11 17:06:55 UTC
Not sure if it would be simplier. But, there (I think) has to be a modal dialog
during project open in order to disallow the user to mess with the IDE. So
either the caller would have to show the dialog, or the open method would have
to detect it is not in AWT thread and show the dialog somehow.
Comment 7 Jan Lahoda 2005-10-14 08:38:22 UTC
I have committed the patch, commit log attached.
Comment 8 Jan Lahoda 2005-10-14 08:40:07 UTC
Created attachment 25945 [details]
The commit log.
Comment 9 Antonin Nebuzelsky 2005-10-17 12:04:20 UTC
Thanks!
I like it better than the gray window we had before this fix.

It would be great if the CP scanning task could start only after all projects
are opened and classpath construction is complete. I know you looked into this
possibility. Could you file an issue on javacore if you think this is possible?
(put me on CC, please). Thanks.
Comment 10 Marian Mirilovic 2005-10-17 13:14:40 UTC
Sorry guys, I don't think it's final, so please don't verify it ;)

Anyway, instead of grey menu, there is a grey dialog. So I don't think it's the
better fix. 

Also please wait for UI comments, Jindra ???
Comment 11 Jindrich Dinga 2005-10-18 10:38:12 UTC
From my point of view, the current implementation is much better than the previous one.

My comments regarding the current implementation are as follows:
1) Currently, when more than one project is opened, the modal dialog appears. After opening the first 
project, class path scanning starts.  Because of that two progress bars are visible in one moment. IMO 
these two processes should be sequential -> after opening all projects class path-scanning starts.

This was also pointed out by Tonda (“It would be great if the CP scanning task could start only after all 
projects are opened and classpath construction is complete. I know you looked into this possibility. 
Could you file an issue on javacore if you think this is possible?”)

2) Current modal dialog, which is opened after invoking the action, is too small (see attachment 1 [details]). I 
think this dialog can be improved-see my proposal (attachment 2 [details]).

Otherwise it looks good.

Thanks.
Comment 12 Jindrich Dinga 2005-10-18 10:39:07 UTC
Created attachment 26069 [details]
screenshot of modal dialog
Comment 13 Jindrich Dinga 2005-10-18 10:39:58 UTC
Created attachment 26070 [details]
proposal of modal dialog
Comment 14 Jan Lahoda 2005-10-26 12:40:46 UTC
I have improved the dialog as at the screenshot:
Checking in OpenProjectList.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java,v
 <--  OpenProjectList.java
new revision: 1.43; previous revision: 1.42
done
Checking in Bundle.properties;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.68; previous revision: 1.67
done
Checking in OpeningProjectPanel.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/OpeningProjectPanel.java,v
 <--  OpeningProjectPanel.java
new revision: 1.2; previous revision: 1.1
done
Checking in OpeningProjectPanel.form;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/OpeningProjectPanel.form,v
 <--  OpeningProjectPanel.form
new revision: 1.2; previous revision: 1.1
done
Comment 15 Jan Lahoda 2005-10-26 14:48:58 UTC
.
Comment 16 Marian Mirilovic 2005-11-29 13:21:02 UTC
verified in NB 5.0 (200511281900)
Comment 17 Quality Engineering 2011-07-27 14:08:34 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/949724cb4301
User: Jesse Glick <jglick@netbeans.org>
Log: Refining #65349 implementation of asynch project open to better support large source trees.
- show meaningful messages in the progress handle, and make it cancelable
- do not show a blocking modal dialog
- permit subproject calculation to be interrupted when supported (#162612)