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.
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).
Created attachment 76772 [details] Thread dump
According to the thread dump in "Java Source Worker Thread", some non-cancellable task in j2ee.jpa is locking java infrastructure. Reassigning.
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.
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.
Tomasz is knowledgeable about the JPA verification area - Tomasz, can you please evaluate? Thanks.
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.
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.
Created attachment 82062 [details] My code so far
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
Minor related fix/improvement. http://hg.netbeans.org/web-main/rev/f76b74e84be2
Does not depend on issue #162580.