Build: NetBeans IDE Dev (Build 201002152000)
VM: Java HotSpot(TM) Client VM, 16.0-b13, Java(TM) SE Runtime Environment, 1.6.0_18-b07
OS: Windows 7
GUEST: Navigating through packages in a grails project. Netbeans suddenly froze for over a minute.
GUEST: Running windows
kawazu428: right-click on a class name in some .java file?
Maximum slowness yet reported was 97729 ms, average is 21328
Created attachment 97150 [details]
AWT thread is blocked in a construction of a popup menu which in the case of some Maven project actions goes through
which is called in the second part of isMainClass() method - if the class is not found in the index in the first (fast) part of this method and a parsing needs to be done to possibly find the class in non-source classpath elements. This sometimes freezes on a lock in parsing APIs if some other thread is already in there querying for something (it can be a hints computation, code-completion computation or something else).
After a discussion with Tomas I have filed an enhancement to have a version of isMainClass() which will only do the first computation step (the search in indexed sources).
DefaultReplaceTokenProvider.convert() will then be changed to call into the new version of isMainClass().
Fixed using the new method parameter introduced in issue 191648.
Integrated into 'main-golden', will be available in build *201012140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Antonin Nebuzelsky <email@example.com>
Log: #183972 - AWT waiting in DefaultReplaceTokenProvider.convert() calling SourceUtils.isMainClass()