Bug 183972 - [69cat] AWT waiting in DefaultReplaceTokenProvider.convert() calling SourceUtils.isMainClass()
[69cat] AWT waiting in DefaultReplaceTokenProvider.convert() calling SourceUt...
Status: RESOLVED FIXED
Product: projects
Classification: Unclassified
Component: Maven
6.x
All All
: P3 (vote)
: 7.0
Assigned To: Antonin Nebuzelsky
issues@projects
EXCEPTIONS_REPORT perf-profileme
: PERFORMANCE
Depends on: 191648
Blocks: 162072
  Show dependency treegraph
 
Reported: 2010-04-13 09:42 UTC by vdtoorn
Modified: 2011-11-10 21:44 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
nps snapshot (21.14 KB, application/nps)
2010-04-13 09:43 UTC, vdtoorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vdtoorn 2010-04-13 09:42:58 UTC
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
Comment 1 vdtoorn 2010-04-13 09:43:02 UTC
Created attachment 97150 [details]
nps snapshot
Comment 2 Antonin Nebuzelsky 2010-11-04 16:51:15 UTC
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().
Comment 3 Antonin Nebuzelsky 2010-12-13 10:31:45 UTC
Fixed using the new method parameter introduced in issue 191648.

core-main #92c6ae689c71
Comment 4 Quality Engineering 2010-12-14 06:15:09 UTC
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()


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