Bug 164441 - [67cat] Project scanning continues even if the folder is removed from Libraries
[67cat] Project scanning continues even if the folder is removed from Libraries
Status: RESOLVED WONTFIX
Product: editor
Classification: Unclassified
Component: Parsing & Indexing
6.x
PC Windows XP
: P2 (vote)
: 6.x
Assigned To: Vitezslav Stejskal
issues@editor
: PERFORMANCE, THREAD
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-05 06:46 UTC by tusharvjoshi
Modified: 2009-05-15 15:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
Thread dump of the IDE in freezed state (34.77 KB, text/plain)
2009-05-05 06:50 UTC, tusharvjoshi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tusharvjoshi 2009-05-05 06:46:27 UTC
[ JDK VERSION : 1.6.* ]

When I add a folder as a library in the Java Application by right
clicking the Libraries node in projects panel, the scanning projects
task starts.  Now even if I right click on that folder name and
remove it from the Libraries the project scanning task never stops as
the folder is a real big folder

Steps to produce
1. Create a new Java Application
2. Right click on the Libraries node and say Add JAR/Folder
3. Type D:\ and click Open
4. Watch the project scanning starts
5. Try typing Date[CTRL+Space] to see the scanning projects popup
6. Right click on the D:\ entry in the Libraries node and remove it
7. Watch the scanning projects still continues
8. Try opening a CTRL+F12 Go to type window and IDE freezes

with regards
Tushar Joshi


Product Version: NetBeans IDE 6.7 Beta (Build 200904242137)
Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\tusharj\.netbeans\6.7beta
Comment 1 tusharvjoshi 2009-05-05 06:50:19 UTC
Created attachment 81509 [details]
Thread dump of the IDE in freezed state
Comment 2 tusharvjoshi 2009-05-05 06:53:10 UTC
Changed the subcomponent to Parsing and Indexing
Comment 3 David Strupl 2009-05-05 09:05:51 UTC
I think that the freeze is related to the following warning that I can see every time I run the IDE

WARNING [org.netbeans.modules.parsing.impl.TaskProcessor]: ParserManager.parse called in AWT event thread by:
org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:405)

Comment 4 Vitezslav Stejskal 2009-05-05 10:01:28 UTC
There are several things:

1. org.netbeans.modules.java.navigation.JavaMembers.show(JavaMembers.java:82) calls ParserManager.parse() from AWT and
is blocked. That's related to David's (dstrupl) comment. In general UserTasks should not be run from AWT, because they
can be blocked for unspecified amount of time.

2. RepositoryUpdater (scanning) should be interruptible by concurrent UserTasks that run through ParserManager.parse().
And as soon as the UserTask is finished. RepositoryUpdater should resume scanning at the point where it was interrupted.

3. What is the point in adding D:\ as a library? Remember that by adding/removing libraries you change the classpath for
the project and that means that the whole project has to be rescanned. So, the scanning that you see is not only about
scanning the library itself, but also about scanning all the other source roots that were affected by changing the
classpath.
Comment 5 tusharvjoshi 2009-05-05 10:08:21 UTC
What is the point of adding D:\ ?
.
I was actually trying to add a JAR library and for that I started navigating the Open Dialog box.  Usually in windows 
we type the drive letter and click open to open that folder and see the contents.  As this dialog box was also 
expecting a folder it took D:\ as a valid folder and added it as a folder in Libraries as class path and the scanning 
started.
.
Ok.  I got my mistake and I removed the D:\ folder from my Libraries node and now I was expecting NetBeans to stop 
scanning the earlier class path and start new scan for the simpler class path without D:\ 
.
This is a case where user can my mistake arrive at a IDE freeze state.  There is one more point to this even if D:\ 
seems a illogical folder to add as library but a valid folder with lots of sub folders may be added and then removed 
from the class path, which will still provide the same situation.
.
Tushar
Comment 6 Vitezslav Stejskal 2009-05-15 11:51:12 UTC
Ok, I understand what happened and what you are requesting. Unfortunately due to the way how javac works the scanning
granularity is one root. In other words the scanning can be interrupted only when it finishes scanning one root and
before it starts scanning another one. There is now way how to fix this easily and in my opinion what your usecase is a
corner case. I am sorry if this sounds hard, but I'm going to close this as WONTFIX.


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