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.
Twice this morning I've tried to fix imports and it fails. I get the fix import dialog, then if I accept, Netbeans pauses for a short while, then my gnome desktop starts beeping irregularly. If I look at the fix imports progress I can see multiple fix imports processes running. I wait a short while, and I try to close netbeans. Now it appears that there are many fix imports processes going.
Created attachment 83203 [details] screen shot showing my desktop
jbfaden, could you please generate thread-dump http://wiki.netbeans.org/GenerateThreadDump#section-GenerateThreadDump-UnixLinuxMacOSX ... and attach output into this issue ? Thanks in advance.
Created attachment 83206 [details] stack trace after invoking "Fix Imports" action from menu bar
Something very strange must have been going on. The progress bar says '729 tasks running'?! What are the other tasks? Do you know how to get the IDE to this state? The threaddump shows that the fix imports task is running. But it would not show if and what other tasks there may have been pending. Was 'Scanning projects...' task running as well? Does this happen always when you debug your app? Also could you please attach <ide-userdir>/var/log/messages.log here? Thanks Marian, this may take time to track down and fix. Especially if we don't find a reproducible testcase.
Umm, I just found out that holding 'Ctrl+Shift+I' will simply flood the IDE with many fix-imports tasks, which could be the reason for having too many of them shown in the progress bar. They'll eventually finish, but it may take some time. We could probably create an easy fix for this, which would simply ignore new fix-imports requests for the same file while the fix-imports task is already running on that file.
> We could probably create an easy fix for this, which would simply ignore new fix-imports requests for the same file while the fix-imports task is already running on that file. Vita, is it doable in NB 6.7 timeframe ? If so please do it. We can solve the rest after NB 6.7 . Anyway this is the only report we've got so far about this particular problem, so do not expect this is really easy to reproduce case. Thanks in advance.
I fetched last sources and try to reproduce this. Fix Imports works perfectly. BUT! After analysis of symptoms I think there is several windows opened behind main window and it causes beeping of gnome. You are talking about accepting dialog for fix imports. It means the each running Fix imports opened dialog. is there possibility that you pressed more Fix Imports shortcuts more then one time? I noticed running debuger. Can you succesfully replicate this issue? Provide steps to reproduce and messages.log from your userdir. I'm marking this as incomplete and lowering priority.
Sorry, no lower priority :D
> The progress bar says '729 tasks running'?! Indeed there appear to be hundreds of "Fix Imports" tasks running. I'll see if I can reproduce the bug from my office on campus later today.
Quick-n-dirty attempt to create a means of demonstrating the problem: I close all my projects. I create a new project. I add "Color c" to the main method of the new project. I invoke "fix imports" from the menubar. The bug occurs, beeping many times (50-200) until it stops about a minute later. This is on Ubuntu 9.04, using Gnome 2.26.1. 64 bit Java 6. Jeremy
Please attach messages.log a uigestures log. Thank you.
Ok, after discussion with Rasta(moonko) and explanation the problem .. looks like we are able to reproduce the problem and we'll try to fix it into NB 6.7 FCS (definitely not for RC2).
Yeah, I think I know what the problem is. It seems to be an absolutely nasty regression introduced by 6f7991353307. IMO all editor main menu actions suffer from this and there are probably also severe memory leaks. I'll fix it asap. In the mean time please avoid using editor related main menu actions. Instead try remembering their shortcuts and invoke them directly from the editor pane using their shortcuts. It should avoid the problem. The editor popup menu actions should also be safe to use. Marian, since the fix won't make it to RC2 we may want to mention the problem to the users.
http://hg.netbeans.org/release67/rev/6f7991353307 > Marian, since the fix won't make it to RC2 we may want to mention the problem to the users. Any chance to get it fixed in RC3 (next week) ? Are you able to fix also memory leaks you mentioned ? BTW: We are living with this issue since May/5 ... so don't think we need to mention it in RN just for RC2 (if fixed in RC3).
Yes, I think the fix should not be hard, but is likely to involve changes in many places (all MainMenuAction subclasses) unless I figure out something more clever. The memory leaks should get fixed too. Thinking more about it the leaks may not be so bad. I suspected that somehow editor documents could be held in memory through the MainMenuAction instances, but that's not the case and I think we would have noticed.
Simple steps how to reproduce it: 1. clean userdir, start ide 2. open or create a java project with at least 2 java sources 3. open those two sources in the editor 4. keep switching between them eg 30-40 times or more if you have the patience 5. type (!) without using code completion "public void aaa() { Color c; }" to one of the sources, the IDE should underline the 'Color' work, because the Color class is not imported 6. in the main menu (!) select Source -> Fix imports You should see the progress bar showing multiple Fix imports tasks and if you are fast enough and hover your mouse over the progress bar it'll say in the tooltip how many there is. The number should loosely correspond to the number of switches in step #4.
Other symptom is missing shortcut in the main menu item (eg. Fix Imports has Ctrl+Shift+I in the default shortcuts profile and the Source -> Fix imports menu item should show it if there is a java editor opened and selected).
... for missing shortcuts I reported issue 166583
This should fix it - http://hg.netbeans.org/jet-main/rev/806fd8073a9e.
Integrated into 'main-golden', will be available in build *200906081401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/806fd8073a9e User: Vita Stejskal <vstejskal@netbeans.org> Log: #166548: single MainMenuAction instance was hooked up with its menu presenter many times, causing the action instance to be called multiple times when user invoked the action from the main menu
verified in trunk
I approve the fix.
Transplanted to release67 clone as http://hg.netbeans.org/release67/rev/31e79bb1e626.
verified in 6.7