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 257779

Summary: Find Usages hangs AWT thread
Product: java Reporter: _ gtzabari <gtzabari>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: messages.log

Description _ gtzabari 2016-01-31 05:14:06 UTC
Created attachment 158308 [details]
messages.log

Product Version: NetBeans IDE Dev (Build 201601210002)
Updates: Updates available
Java: 1.8.0_71; Java HotSpot(TM) 64-Bit Server VM 25.71-b15
Runtime: Java(TM) SE Runtime Environment 1.8.0_71-b15
System: Windows 10 version 10.0 running on amd64; UTF-8; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

It seems that Find Usages is invoking an expensive task on the AWT thread. If a user invokes Find Usages twice (the second time while the first search is still ongoing) the entire IDE hangs until the search completes. If you search for a very common method, such as Object.hashCode() the IDE hangs for quite a while.

Repro steps:
1. Open Java project
2. Invoke Find Usages (ALT-F7) on a class that implements hashCode()
3. Start the search from Object.hashCode()
4. Before the operation can complete, hit ALT-F7 again.
5. The IDE will hang for 20 seconds, until the Find Usages operation completes and the second Find Usages dialog can come up.
6. messages.log contains this warning which might be relevant:

WARNING [org.netbeans.modules.parsing.impl.TaskProcessor]: ParserManager.parse called in AWT event thread by: org.netbeans.modules.refactoring.java.ui.ContextAnalyzer$TextComponentTask.run(ContextAnalyzer.java:385)

I am attaching the full messages.log for your review.