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.
NetBeans IDE 6.0 RC1 (Build 200711131200) Java: 1.5.0_12 WinXP A scenario of dragging components in the Navigator causes the loss of Navigator view for all the VW projects in multi-view. Cannot get the view back without IDE restart. It is reliably reproduced with jdk1.5.0_12. There is usually an ArrayIndexOutofBoundsException but not always. (See messages.log) Follow these steps: 1. Create a VW ee5 project 2. From the palette's Layout section, first drag a Grid Panel component and drop it on the designer surface's left corner 3. From the palette's Basic section, drag a TextArea component and drop it on the designer surface's right corner 4. From the palette's Basic section, drag a Listbox component and drop it on the designer's surface lower right corner. 5. From the Navigator view, mouse click down on the listbox1 component and drag it "up" onto the gridPanel1 and wait until the default cursor is squarely pointing on "gridPanel1" before releasing mouse. The idea is to make it a child of gridPanel1. >Navigator view either becomes completely blank OR will show "f:view" artifact which I believe is from JSP. yet we have not changed view. 6. Now in attempt to recover, click in Navigator window and then click the designer screen, attempting to re-select a component and thus to regain the view will fail. >Any project loaded in multiviewer will not be able to regain Navigator view and creating any new project will also not have a Navigator view. The only workaround is to restart the IDE. Use of the Navigator to position components is essential and critical to the usage of the layout components. Using 1.6.0_03 I have only seen the loss of the Navigator window momentarily -- it always seems to recover, but it will show f:view briefly in the Navigator window then return to showing the 3 components as expected after clicking in either Navigator or Designer surface. The above scenario is about 75% reproducible even with jdk1.5.0_12 and may have a timing issue in the drop. Re-try and you should be able to see the problem.
Created attachment 53010 [details] messages log
Created attachment 53011 [details] Correct messages.log showing error
reproduced, fixed in main trunk: Checking in NavigatorController.java; /cvs/core/navigator/src/org/netbeans/modules/navigator/NavigatorController.java,v <-- NavigatorController.java new revision: 1.34; previous revision: 1.33 done
Created attachment 53058 [details] patch diff
Stando, please review attached patch, thank you. Patch is simple, it just adds check to not react on node destroy event if navigator is active. Navigator already ignores activated node changes if navigator TC is active in winsys, so this makes things synchronized. Background, what happened: After dragging listbox item under grid, listbox node was destroyed, event came and navigator tried to update its providers, which it shoudn't at that time.
i think that a safer variant of the same patch would be: public void nodeDestroyed(NodeEvent ev) { final TopComponent activated = WindowManager.getDefault().getRegistry().getActivated(); if (EventQueue.isDispatchThread()) { forceUpdate( activated ); } else { EventQueue.invokeLater(new Runnable() { public void run() { forceUpdate( activated ); } }); } } /** Forces navigator content update. * Does nothing in case navigator TC is active */ private void forceUpdate ( TopComponent activated ) { if (!navigatorTC.equals(activated)) { updateContext(true); } } otherwise the patch looks ok to me
Tested the fix in trunk build #4450 (Build 20071115173012) and it looks AOK. Thanks to Gowri who helped in reporting bug as well as verifying this fix.
saubrecht, you are right, testing for activated state should be done at the time of when nodeDestroyed is called, not later in invokeLater. I modified your version, using the fact that updateContext(true) is already called from Runnable impl, so that patch is simpler and don't need extra new Runnable()... inner class. Checking in NavigatorController.java; /cvs/core/navigator/src/org/netbeans/modules/navigator/NavigatorController.java,v <-- NavigatorController.java new revision: 1.35; previous revision: 1.34 done
patch is now simple added check: Index: NavigatorController.java *** F:\Sources\Pokus\core\navigator\src\org\netbeans\modules\navigator\NavigatorController.java Base (1.33) --- F:\Sources\Pokus\core\navigator\src\org\netbeans\modules\navigator\NavigatorController.java Locally Modified (Based On 1.33) *************** *** 523,528 **** --- 523,532 ---- /****** NodeListener implementation *****/ public void nodeDestroyed(NodeEvent ev) { + // #121944: don't react on node destroy when we are active + if (navigatorTC.equals(WindowManager.getDefault().getRegistry().getActivated())) { + return; + } if (EventQueue.isDispatchThread()) { run(); } else {
tested with trunk daily build. It works - verified in trunk by QE. Product Version: NetBeans IDE Dev (Build 200711160000) Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b04 System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
*** Issue 121668 has been marked as a duplicate of this issue. ***
fix merged into release60 branch: Checking in NavigatorController.java; /cvs/core/navigator/src/org/netbeans/modules/navigator/NavigatorController.java,v <-- NavigatorController.java new revision: 1.33.2.1; previous revision: 1.33
Tested the revised fix in trun (Build 20071116125734) with jdk1.5.0_12 and looks good; also tested scenario from #121668.
ok, verified in: Product Version: NetBeans IDE 6.0 RC2 (Build 200711190000) Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-b02 System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb) Userdir: /home/petr/.netbeans/6.0rc2