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.
Scenario: - Push 'Tools|Options' menu item - Click on 'C/C++' button - Select 'Formatting Style' tab ==> Table with properties is empty (Properties appears when i change language or style).
Created attachment 58126 [details] Screenshot
fixed
Verified in NetBeans IDE Dev (Build 200803140008)
I can reproduce this bug in 200803200007 build
Unpredictable behavior of PropertySheet.setNodes(Node[] nodes); Method sometimes set null content. Method is invoked in EventDispatchThread. This is fine trace of right method behavior: ------------------------- FINE [org.openide.explorer.propertysheet.PropertySheet]: SetNodes [org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@13858b1[Name=Sheet, displayName=Sheet]] FINE [org.openide.explorer.propertysheet.PropertySheet]: Detaching listeners from org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@afac1d[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: SetCurrentNode:org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@afac1d[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Now listening for changes on org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@afac1d[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Delayed updater setting nodes to [org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@13858b1[Name=Sheet, displayName=Sheet]] FINE [org.openide.explorer.propertysheet.PropertySheet]: SetCurrentNode:org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@13858b1[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Detaching listeners from org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@afac1d[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Now listening for changes on org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@13858b1[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Detaching listeners from org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@13858b1[Name=Sheet, displayName=Sheet] ------------------------- This is fine trace of wrong method behavior: ------------------------- FINE [org.openide.explorer.propertysheet.PropertySheet]: SetNodes [org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@4a8e91eb[Name=Sheet, displayName=Sheet]] FINE [org.openide.explorer.propertysheet.PropertySheet]: Detaching listeners from org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@674e5fac[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: SetCurrentNode:org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@674e5fac[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Now listening for changes on org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@674e5fac[Name=Sheet, displayName=Sheet] SEVERE [global] java.lang.NullPointerException at java.util.Arrays$ArrayList.<init>(Arrays.java:3357) at java.util.Arrays.asList(Arrays.java:3343) at org.openide.explorer.propertysheet.PropertySheet$2$1.run(PropertySheet.java:591) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104) [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) -------------------------
it seems a result of fixing of #126818 Mar 19, 2008 because property sheet worked right before
fixed 376a484b0204
You fixed NPE that do not have any impact on user because it reproduced if fine log switched on. Issue is: Changes in Mar 20, 2008 make a behavior of the method PropertySheet.setNodes(Node[] nodes) unpredictable. In some computers second method call bring EMPTY property sheet content. For example: On Solaris method works right. On Linix and Windows method works wrong.
I think that problem is in a changeset: http://hg.netbeans.org/main/rev/bbc5d9e69e9d in line: - final Node[] nodes = helperNodes; The changeset was done for IZ#126818
NPE in fine log was fixed. This is a fine log of two showing of property sheet in options dialog. First invocation of options dialog sets right property sheet content. The second invocation of options dialog sets NULL property sheet content. First invocation: FINE [org.openide.explorer.propertysheet.PropertySheet]: SetNodes [org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet]] FINE [org.openide.explorer.propertysheet.PropertySheet]: Scheduling delayed update of selected nodes. FINE [org.openide.explorer.propertysheet.PropertySheet]: Delayed updater setting nodes to [org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet]] FINE [org.openide.explorer.propertysheet.PropertySheet]: SetCurrentNode:org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Now listening for changes on org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Delayed updater setting nodes to [org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet]] FINE [org.openide.explorer.propertysheet.PropertySheet]: SetCurrentNode:org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Detaching listeners from org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet] Second invocation: FINE [org.openide.explorer.propertysheet.PropertySheet]: SetCurrentNode:org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Now listening for changes on org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: SetNodes [org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@17a03d[Name=Sheet, displayName=Sheet]] FINE [org.openide.explorer.propertysheet.PropertySheet]: Detaching listeners from org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: SetCurrentNode:org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Now listening for changes on org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet] FINE [org.openide.explorer.propertysheet.PropertySheet]: Delayed updater setting nodes to null FINE [org.openide.explorer.propertysheet.PropertySheet]: Detaching listeners from org.netbeans.modules.cnd.editor.options.EditorPropertySheet$DummyNode@fc4825[Name=Sheet, displayName=Sheet]
are there any step to reproduce? it works fine for me (win xp, jdk1.5)
Scenario: - Push 'Tools|Options' menu item - Click on 'C/C++' button - Select 'Formatting Style' tab Property sheet is right. - Close dialog by 'OK'. - Push 'Tools|Options' menu item Property sheet on 'Formatting Style' tab empty. Repeated on Windows XP an LUNIX
I thinhk that bug reproducibility depends on CPU speed.
I see the empty property sheet everytime I bring up the panel. I'm on a MacBook Pro and running Mac OS X.
It seem old core problem. See also IZ#105525
after some digging i've found out that this is actually a problem in options dialog: when the options window is created it also creates its category panels and thats when setNodes() is called on the property sheet. however when invoked for the second time, category panels are created again (including setNodes()) but then the options window activates the panel that was selected the last time. but the panel already is active so it is unnecessarily removed and added to component hierarchy. it means that removeNotify() is called on the propertysheet which correctly clears any context created by previous setNodes(). reassigning to options dialog, below is a simple patch that fixes the problem diff -r aa2c78f9446e options.api/src/org/netbeans/modules/options/OptionsPanel.java --- a/options.api/src/org/netbeans/modules/options/OptionsPanel.java Wed Mar 26 09:43:20 2008 +0100 +++ b/options.api/src/org/netbeans/modules/options/OptionsPanel.java Wed Mar 26 11:04:50 2008 +0100 @@ -166,8 +166,10 @@ JComponent component = category.getComponent(); category.update(controllerListener, false); final Dimension size = component.getSize(); - pOptions.add(component, category.getCategoryName()); - cLayout.show(pOptions, category.getCategoryName()); + if( component.getParent() == null || !pOptions.equals(component.getParent()) ) { + pOptions.add(component, category.getCategoryName()); + cLayout.show(pOptions, category.getCategoryName()); + } checkSize (size); /*if (CategoryModel.getInstance().getCurrent() != null) { ((CategoryButton) buttons.get (CategoryModel.getInstance().getCurrentCategoryID())).requestFocus();
stando, go ahead and fix it. I don't expect radek to work on it anymore
fixed - however i was hoping somebody would do a sanity check. who's taking care of spi.options now anyway? 58019eb6fd4c
I do not see changeset 58019eb6fd4c in main. options.api/src/org/netbeans/modules/options/OptionsPanel.java also is not changed. Do you forget to push changes? I tested the proposed fix on my Windows XP. It works.
Thomas (on a MacBook Pro and running Mac OS X): I brought over his change and it does seem to work....
I see fix in main now: http://hg.netbeans.org/main/rev/58019eb6fd4c It seems to work.
works on my machine also (verified in 20080327062852 build)
"Debug Executable" dialog in sunstudio would sometimes get <No Properties> bits that can reproduce problem : /net/balui/kits/compilers/pibs/sstrunk_masters/dbx/dbxtool/inst/$VARIANT1.inst//opt/SUNWspro//bin/sunstudio - bring up dialog from Run | Debug Executable - enter some valid executable in "Executable" textfield - PropertySheet would change to <No Properties> - or switching among Project drop down would reproduce problem too. ----------------------------------------------------------------------------------------------------------------------- Here is the stack trace when things don't work, note, "nodes" is null [t@30 l@5]: print nodes org.openide.nodes.Node[] nodes = null [t@30 l@5]: where =>[1] org.openide.explorer.propertysheet.PropertySheet.doSetNodes(this = <OBJECT>, nodes = <ARRAY>) "PropertySheet.java":437 [2] org.openide.explorer.propertysheet.PropertySheet.access$100(x0 = <OBJECT>, x1 = <ARRAY>) "PropertySheet.java":117 [3] org.openide.explorer.propertysheet.PropertySheet.2.1.run(this = <OBJECT>) "PropertySheet.java":597 [4] java.awt.event.InvocationEvent.dispatch(--- Not compiled -g ---) "InvocationEvent.java":209 [5] java.awt.EventQueue.dispatchEvent(--- Not compiled -g ---) "EventQueue.java":461 [6] org.netbeans.core.TimableEventQueue.dispatchEvent(--- Not compiled -g ---) "TimableEventQueue.java":9 [7] java.awt.EventDispatchThread.pumpOneEventForHierarchy(--- Not compiled -g ---) "EventDispatchThread.java":242 [8] java.awt.EventDispatchThread.pumpEventsForHierarchy(--- Not compiled -g ---) "EventDispatchThread.java":163 [9] java.awt.EventDispatchThread.pumpEventsForHierarchy(--- Not compiled -g ---) "EventDispatchThread.java":153 [10] java.awt.Dialog.1.run(--- Not compiled -g ---) "Dialog.java":517 [11] java.awt.Dialog.2.run(--- Not compiled -g ---) "Dialog.java":545 [12] Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2(0x9145f20, 0xd01ff328, 0xd01ff330, 0xd01ff304, 0x0, 0xd01ff330, 0xeca833c0, 0x0, 0xeca82e30, 0xd01ff330, 0xd01ff350, 0xf94029a4, 0xeca83368, 0xf9407053, 0xd9a36088, 0xd01ff334, 0xecfa2c6f, 0xd01ff378, 0xee1cc858, 0x0), at 0xfe7388e2 [13] java.awt.Dialog.show(--- Not compiled -g ---) "Dialog.java":543 [14] java.awt.Component.show(--- Not compiled -g ---) "Component.java":1300 [15] java.awt.Component.setVisible(--- Not compiled -g ---) "Component.java":1253 [16] com.sun.tools.debugger.dbxgui.debugger.actions.DebugExecutableNodeAction.perform(this = <OBJECT>, executablePath = <null>) "DebugExecutableNodeAction.java":109 [17] com.sun.tools.debugger.dbxgui.debugger.actions.DebugExecutableNodeAction.performAction(this = <OBJECT>, activatedNodes = <ARRAY>) "DebugExecutableNodeAction.java":80
Some more insight into the actual problem. Chihin and I stepped through our reproducible testcase and here is what we found: PropertySheet.setNodes(node) will assign it's parameter, nodes, to class member helperNodes and schedule a task with a delay. When the test runs it calls doSetNodes(helperNodes). The reason various dialogs end up with an empty property sheet is that by the time doSetNodes(helperNodes) is c alled helperNodes is null. Why is that? A quick search shows that helperNodes gets set to null in removeNotify(). Among other times removeNotify() gets called when the sheet (or one of it's containers) get removed from their containers. Here's one scenario: Panel panel2 = new Panel(); Panel panel1 = new Panel(); Sheet sheet = new Sheet() sheet.setNodes() panel1.add(sheet) panel2.add(panel1) # after a while ... like when the model underlying the sheet changes sheet = new Sheet() (1) sheet.setNodes() panel1.add(sheet) (2) panel2.add(panel1) At time (1) a task gets sceduled to eventually call doSetNodes(helperNodes) At time (2) a panel1 which already exists in panel2 is being re-added to panel2. It gets removed and then re-added. As it gets removed helperNodes goes to null. Because it's the same object being re-added the delayed doSetNodes() gets the null helperNodes. Putting an invokeLater around (1) helps because it postpones the setting of helperNodes til after them getting cleared at (2). In general inserting delays in client code should not fix this problem. A delay after (1) just makes the problem worse. A delay after (2) is too late. Making sure that one doesn't re-add a panel is probably the most reliable work around. That was the "fix" for this bug and that is what Chihin is verifying in dbxgui. But IMO this is still a workaround. At the moment I would state this bug as follows: PropertySheet does not behave correctly when it or one of it's containers is redundantly added to a container. JavaDoc for Container.addImpl() says: Note that if the component already exists in this container or a child of this container, it is removed from that container before being added to this container. So, a) redundant adds are anticipated and allowed. b) The removal behaviour of add is not capricious. Ergo OptionDialog and Chihins Dialog are not doing anything wrong. It is ProperytSheet which should work correctly.
fixed, setNodes() now survives multiple addNotify()/removeNotify() calls, weak ref is used to prevent memory leaks 01115076c999
I installed 200804250004 build and I see empty table in 'Formatting Style' tab again Scenario: - Run NetBeans with C/C++ pack with fresh user dir - Push 'Tools|Options' menu item - Click on 'C/C++' button - Select 'Formatting Style' tab ==> Table is empty
well, it's working fine for me in custom build from today's sources nb080425, win xp, jdk1.5.0_13 i also checked the source files and the fix is there...
I verified on Windows (java 1.5.0_09), Linux and Solaris (1.6.0_04). And on all platforms I see empty table
I upgraded this bug to P1, because I can not launch a lot of automatic tests on nightly builds (although on NetBeans 6.1 release all test worked correctly). First scenario: - Launch NetBeans with C/C++ pack - Push 'Tools|Options' menu item - Click on 'C/C++' button - Select 'Formatting Style' tab ==> Table is empty Other scenario: - Push 'Tools|Options' menu item - Click on 'C/C++' button - Select 'Formatting Style' tab - Switch formatting style on 'ANSI' or 'Apache' for example (repeat this step if table is not emty) ==> I see empty table in ~50% cases
can QA try reproducing this issue pls? everything looks fine on my machine... (doesn't seem like a P1 to me after reading priority guidelines though:)
I have tried to reproduce on Ubuntu, Mac OS X and Win XP but I cannot reproduce. Hopefully Petr Ch. will be more successful in reproducing this.
reproduced in: Product Version: NetBeans IDE Dev (Build 200805050002) Java: 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19 System: Linux version 2.6.24-17-generic running on i386; UTF-8; en_US (nb) Userdir: /home/petr/.netbeans/dev-0505 It's Xubuntu 8.04 on Core2Duo, dual monitor. We were also able to reproduced it on Kubuntu 8.04 on different machine.
also reproduced on Solaris: Product Version: NetBeans IDE Dev (Build 200805051203) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: SunOS version 5.10 running on x86; UTF-8; cs_CZ (nb) Userdir: /home/petr/.netbeans/dev
Standa, please could you look at this again ? There is a request from Sun Studion to have it fixed in patch 2. Petr reproduced the bug... Thanks in advance.
fixed (hopefully) - ed78f533aed4 QA, pls also test there's no regression to #125057
Integrated into 'main-golden', available in NB_Trunk_Production #237 build Changeset: http://hg.netbeans.org/main/rev/6df061db4f5c User: Alexander Simon <alexvsimon@netbeans.org> Log: remove work around after fixing IZ#129743
Sun Studio team, does the fix work for you?
Yes, C/C++ Formating styles work fine.
I'm not able to verify in sunstudio/dbxgui yet, for I need to wait for Thomas to upgrade netbeans bit to this version for sunstudio. I'll do the verification once he upgrade NB.
It may take a while because SS Express probably won't be based on Patch 2 after all. Cut-off date is now June 12 and Patch 2 won't be ready by then. I will suggest you download a trunk build of NB and stick it into your own SS build and test it this way. You can find daily trunk builds here: /net/phoenix.czech/space/builds/netbeans/trunk/daily
i've got a trunk build ... rebuilding ... gimme a sec.
We're not in a position to verify it with dbxgui bits. The symptoms don't arise in the regular IDE, only in dbxtool which uses a subset of NB modules. As best as I can tell the latest trunk modules have a rearranged dependency so our dbxtool module-pick-and-chooser ends up not picking enough modules. But the main sunstudio IDE (debugger area) is not impacted. We'll be able to verify again when we get the new binary bits and have some time to spend on the module dependency issue.
C/C++ Formating styles work fine.
All problems with table which I saw in NetBeans are fixed.
The fix has been ported into the release61_fixes branch: http://hg.netbeans.org/release61_fixes/8eaa5c793f54