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.
Created attachment 133322 [details] Test case for replicating the issue In the attached testcase, you can see there are a large number of imports. On line 20, there is an extra semicolon. When you run the shortcut for fix imports (eg cmd+shift+i on OS X), a "long operation in progress" window shows up and the process adds thousands of lines of the same imports over and over to the file. CPU usage goes to 200%+, even if after pressing "cancel" in this dialog. Setting this to P2 because it is very easy to duplicate and is likely to occur in the wild. Product Version: NetBeans IDE Dev (Build 201304032301) Java: 1.7.0_17; Java HotSpot(TM) 64-Bit Server VM 23.7-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02 System: Mac OS X version 10.8.2 running on x86_64; US-ASCII; en_US (nb) User directory: /Users/theshadow/Library/Application Support/NetBeans/dev Cache directory: /Users/theshadow/Library/Caches/NetBeans/dev Testcase and profile will follow.
Created attachment 133323 [details] .npss file attached from NetBeans .npss file
This snapshot illustrates the entire problem. The procedure was: 1) open test file 2) keyboard shortcut for fix imports. This adds a large number of imports, but does complete 3) keyboard shortcut for fix imports again. This adds many imports (thousands) but I click cancel before it can complete 4) wait a short time. When "checking for external changes" occurs, the CPU usage spikes to 200-300%
Note also that force-quitting the IDE is the only way to stop the high CPU utilization.
Maybe this should be java.editor? From the log: INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.navigation.BreadCrumbsScanningTask ignored cancel for 62 ms. WARNING [org.netbeans.core.TimableEventQueue]: Still previous controller org.netbeans.modules.sampler.InternalSampler@13bf1d6d WARNING [org.netbeans.modules.progress.ui.RunOffEDTImpl]: Lengthy operation: org.netbeans.modules.java.editor.imports.JavaFixAllImports$2:21,184:2:19,874:10592.00
Duplicated on 7.3+win7
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/9c3c40cce470 http://hg.netbeans.org/main/nb-javac/rev/a964475833ee