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 117537 - Do not block Run/Run File waiting for CP scan to finish
Summary: Do not block Run/Run File waiting for CP scan to finish
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-02 23:06 UTC by Jesse Glick
Modified: 2009-11-02 11:02 UTC (History)
1 user (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 2007-10-02 23:06:04 UTC
If you invoke Run or Run File on a j2seproject during CP scanning, a dialog will pop up and you will be forced to wait
until scanning is complete before the Ant target is run - even though Ant is not using the result. The only reason is
that in the unlikely event you were trying to run a class with no main method, the IDE could warn you in a dialog
instead of showing NCDFE in the Ant console. This is certainly not a good enough reason to interrupt the user's work.
Comment 1 Tomas Zezula 2007-10-03 08:08:40 UTC
It is according to UI spec, the run has to check if the started class has a main method and if not it has to offer list
of possible main classes. It behaves in this way from the time of NB 4.0. If the UI spec changes I am open to remove the
check from J2SEActionProvider.
Comment 2 Jesse Glick 2007-10-03 17:31:06 UTC
I know it is in the UI spec; the UI spec forces a behavior which is silly and interferes with day-to-day usage of the
IDE. It has been a problem since NB 4.0. Try making a j2seproject with thousands of sources, some of them with main
methods. Now open one of these classes in the editor, make some trivial change, and press S-F6. The saving of the file
triggers a CP rescan which takes several seconds before the file is run, when this scanning could have been done
perfectly well in the background.

I did not suggest removing the check that the class has a main method - just to skip the check in case CP scanning is
currently running, and only do it when it would cost nothing.
Comment 3 Tomas Zezula 2007-10-03 18:11:25 UTC
OK, sorry I've misunderstood the issue, I've thought that you meant not to do the check at all. In this case it's fine
(no UI change is needed). I will do it to NB 6.0
Comment 4 Tomas Zezula 2007-10-11 14:27:45 UTC
I've tried this but the IDE is so busy with the scan (IO load during indexing rt.jar) that the project is started after
the scan finished.
Comment 5 Jesse Glick 2007-10-11 17:17:16 UTC
In the test case I use, rt.jar has already been indexed, it is the project which is being rescanned. Make a huge
j2seproject with a main class (e.g. prep script in issue #104508), wait for scan to finish, run - fine. Now make some
trivial edit to the main class, and press F6 without saving first. Rather than immediately running, the IDE sits there
for a couple seconds and pops up a "scanning, please wait" dialog.
Comment 6 Jan Becicka 2008-11-12 14:22:21 UTC
Later
Comment 7 Jesse Glick 2008-11-12 16:21:22 UTC
Someone recently suggested a different fix for this problem, which also works nicely when build.xml has been customized
to select a main class in an unexpected way: don't do any check before running at all, but install an AntLogger which
notices if NoClassDefFoundError is thrown on the supposed main class when the program runs. If this happens, bring up
the dialog and offer to pick a different main class. This makes the dialog helpful rather than intrusive, and ensures it
is not displayed just because the Java infrastructure is having difficulty keeping up with reality.
Comment 8 Quality Engineering 2009-11-02 10:56:54 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX
Comment 9 Tomas Zezula 2009-11-02 11:00:01 UTC
Reopening because of invalid status.
Comment 10 Tomas Zezula 2009-11-02 11:02:10 UTC
It was fixed in NB 6.8 (for COS disabled).
Change set 3655e3539716