Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 181652 - Don't finish a scan before you run the code!
Don't finish a scan before you run the code!
Product: java
Classification: Unclassified
Component: Project
: P2 (vote)
Assigned To: Tomas Zezula
Depends on:
  Show dependency treegraph
Reported: 2010-03-08 20:57 UTC by Torbjorn Norbye
Modified: 2010-03-15 12:00 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Torbjorn Norbye 2010-03-08 20:57:17 UTC
I spend a lot of time looking at this dialog:

Run Project:
Please wait, scanning in progress...
[Cancel Run Project]

Why? Why do you have to finish scanning the project before you can run it?
I don't understand what you have to look up before you can tell ant to run the code -- as far as I can tell everything it needs (the platform, the main class, the flags) are all unrelated to the index. 

Can you please Just Run the project and continue the scan in the background? Or at a minimum, if there is something you really need to look up from the index, look it up ONCE and then use that cached value next time when I run?

It's probably because some of our Java projects generate some code, or because some of our other projects are JavaFX projects - but the IDE spends a lot of time on background scanning - frequently for 30-60 seconds - and for me sitting there and waiting for the scanning to finish, with a modal dialog which blocks both editing and doesn't give me the result I want (checking my changes in the running code), it's extremely annoying. I often cancel the dialog, do some other edits, and when it looks like it's done scanning I try again.

I know there are some other issues related to "lots of scanning" and "slow scanning" - such as issue 134990 and issue 133943 -- and they've been open for a while now.

This is a much more narrow thing I'm asking: Just don't look up the index, or block on it, when I'm trying to -run- something.  I'm fine with ignoring code completion or refactoring when the IDE is busy scanning -- I can look up APIs by hand etc -- but I need to be able to run!

This particular issue is highlighted in issue 133943 by Jesse in his entry on 2008-07-08: "Another very annoying thing (which I thought I already filed but cannot find now) is that in a j2seproject if you Run a class (or Run Project), the IDE will wait until scanning has finished before it actually runs it, just to check that it actually has a main method! It would be better to just go ahead and run it immediately; at worst you will see a NoSuchMethodError in output if the class in fact lacked a main method. It is senseless to force everyone to wait just to better report an unusual error condition."

I'm hoping that by pulling it out separately there is a better chance that this particular aspect of the scanning issue can be addressed quickly!

(Also - please make sure this is fixed not just for Java projects, but for JavaFX projects as well if the project-launching code is not the same - perhaps by reassigning the issue when you're done.)
Comment 1 Vitezslav Stejskal 2010-03-09 03:43:14 UTC
Could you please run the IDE with -J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE, reproduce the problem and attach the IDE's log file here? Thanks
Comment 2 Jesse Glick 2010-03-09 07:44:36 UTC
IIRC this was already filed and marked fixed some time ago - but only if you do not use Compile on Save. If you do use CoS, then running the app will actually use the class files generated during scanning, so naturally you have to wait for this compilation to finish before you can run.
Comment 3 Torbjorn Norbye 2010-03-09 10:34:45 UTC
Apologies. I can not reproduce now. I run both a lot of Java projects and a lot of JavaFX projects and I was under the impression I was seeing this for both, but now that I've tried to reproduce it deliberately only for Java I can't -- I now suspect it might have been JavaFX projects every time. I've filed a separate issue for JavaFX (issue 181653). It also seems to be more problematic there because class scanning takes quite a bit longer.
Comment 4 Tomas Zezula 2010-03-15 12:00:13 UTC
The problem was fixed when CoS is disabled in NB 6.7 for J2SEProject, see issue #166527.
When Compile on Save is enabled, the run has to wait the until scan validates the caches.
But JFXActionProvider has similar code without the fix, you probably started a JavaFX app, right?

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo