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 158261 - Nb 7.0m1 freezes for a loong time upon ctrl+click
Summary: Nb 7.0m1 freezes for a loong time upon ctrl+click
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Hibernate (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Tomas Mysik
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-02-10 09:13 UTC by ihsiak
Modified: 2009-05-14 13:14 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (23.81 KB, text/plain)
2009-02-10 09:14 UTC, ihsiak
Details
My code so far (1.80 KB, text/plain)
2009-05-13 15:21 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ihsiak 2009-02-10 09:13:51 UTC
When editing code, I did ctrl+click on ancestor class name. NB freezed for about 10 minutes.

My Nb:

Product Version: NetBeans IDE Dev (Build 200812180001)
Java: 1.6.0_11; Java HotSpot(TM) Client VM 11.0-b16
System: Windows XP version 5.1 running on x86; Cp1250; pl_PL (nb)
 
The only extra plugin installed is Selenium support (but such freezes happened before I installed it).
Comment 1 ihsiak 2009-02-10 09:14:37 UTC
Created attachment 76772 [details]
Thread dump
Comment 2 Max Sauer 2009-02-11 12:35:13 UTC
According to the thread dump in "Java Source Worker Thread", some non-cancellable task in j2ee.jpa is locking java infrastructure. Reassigning.
Comment 3 Petr Jiricka 2009-02-11 17:22:31 UTC
Looks like during problem scanning, the Hibernate support looks on the disk for all the Hibernate config files - ouch!
One question - do you use Hibernate or Java Persistence support in your projects? 
Also, when you go to Window -> Tasks, then right-click on the Tasks window, and select Filter -> Edit..., do you see the
"Persistence API Problems" item checked?

Thanks.
Comment 4 ihsiak 2009-02-12 07:25:57 UTC
Indeed, both edited and ancestor classes are jpa entities. Also I use hibernate as JPA provider - but not NB Hibernate
support per se, just included hibernate jars that are in my projects lib/ directory (whole project is regular java
application)

"Persistence Api Problems" in Tasks Filter are unchecked.
Comment 5 Petr Jiricka 2009-02-17 16:17:00 UTC
Tomasz is knowledgeable about the JPA verification area - Tomasz, can you please evaluate? Thanks.
Comment 6 Petr Jiricka 2009-04-16 13:41:37 UTC
The possible fix that I discussed with Vita Stejskal is to use the new indexing API and query the location of the
Hibernate config file(s) through the index. We already store file names in the index for use by the Go to File feature,
see also issue 122639.

Here is the advice I got from Vita privately: "Look at
jumpto/src/org/netbeans/modules/jumpto/file/FileSearchAction.java, and its inner class Worker, which has a method
getFileNames(). This method reads data from the index. The same approach can be used for Hibernate.
File index can be searched by FileIndexer.FIELD_NAME or by FI.FIELD_CASE_INSENSITIVE_NAME, there is a third field
FI.FIELD_MIME_TYPE, which can be read, but you can not search by it. It should be enough to search for all *.xml files
from the results, select the files that have the correct mime-type."

Note though that the index does not store the names of all the files in the project, only those under the source roots.
So for some directories we will need to continue to go through all the directories - see also issue 162144, which
addresses the analogous problem for the Go to File feature. Implementing issue 162580 would help here.

I am not sure what is the situation with the index if the source scanning is in progress - possibly in this case the
index can not be used. In situations like this, it may be necessary to check all the end user UI that depend on the
Hibernate config file, and display a "scanning in progress" message. David Konecny did this e.g. in issue 148786.
Comment 7 Petr Jiricka 2009-05-13 15:17:34 UTC
Tomas M will look at this - thanks! I was trying to do a patch based on the approach suggested by Vita above - I am
attaching the code up to where I got.

Comment 8 Petr Jiricka 2009-05-13 15:21:06 UTC
Created attachment 82062 [details]
My code so far
Comment 9 Tomas Mysik 2009-05-14 13:02:38 UTC
Fixed. Ken, please, verify (especially wizards whether all the XML files have been found correctly). Thanks a lot.
http://hg.netbeans.org/web-main/rev/db4753e6b7fe
Comment 10 Tomas Mysik 2009-05-14 13:12:33 UTC
Minor related fix/improvement.
http://hg.netbeans.org/web-main/rev/f76b74e84be2
Comment 11 Tomas Mysik 2009-05-14 13:14:04 UTC
Does not depend on issue #162580.