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.
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 User Comments: 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] nps snapshot
AWT thread is blocked in a construction of a popup menu which in the case of some Maven project actions goes through -> org.netbeans.modules.maven.ActionProviderImpl.isActionEnabled() -> org.netbeans.modules.maven.execute.DefaultReplaceTokenProvider.convert() -> org.netbeans.api.java.source.SourceUtils.isMainClass() -> org.netbeans.api.java.source.JavaSource.runUserActionTask() 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. core-main #92c6ae689c71
Integrated into 'main-golden', will be available in build *201012140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/92c6ae689c71 User: Antonin Nebuzelsky <anebuzelsky@netbeans.org> Log: #183972 - AWT waiting in DefaultReplaceTokenProvider.convert() calling SourceUtils.isMainClass()