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.
When opening a schema that has been closed (not opened automatically after creating a new one) the schema view is empty. System: Product Version: NetBeans IDE Dev (Build 200807170007) Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52 System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb) Steps: Open a schema, that's all.
Created attachment 64891 [details] Image of issue
Tony, do you see any error in the console or the log?
There is a warning. WARNING [org.openide.loaders]: Should override getLookup() in class org.netbeans.modules.xml.schema.SchemaDataObject, e.g.: [MultiDataObject.this.]getCookieSet().getLookup()
...and the warning only shows on the first attempt and is in the console not the IDE. Subsequent schema openings do not show the warning.
Seems like few things have changed in openide.nodes APIs and we're seeing these new issues.
Workaround: Right click schema and select open in the context menu.
Related to http://wiki.netbeans.org/FitnessViaLaziness. As per yarda, assigning to openide.nodes.
I'll investigate tomorrow.
now it reproducible for newly created schema. added elements not showed
I see stable fail as well. Looks like I saw this in previous build but it was unstable and I was unable to reproduce. Also this issue actually shows just the same behavior which cause CV test to fail -- required XML schema column absent.
I need help from owner of the code. Nodes and Explorers from core seem to be working correctly. Switch to treeview in the editor to see that. The problem is only with ColumnListView for some reason it sticks with DummySchemaNode and is not updated to AdvancedSchemaNode. I am not sure what part of your code shall do it, so please help me investigate this. I do not know why there is a change in the behaviour, the only difference is that now we call your code with Children.MUTEX.readAccess, which delays changes to node hierarchies. However, if you correctly update the node for ColumnListView, things seem to work. I tried following patch and the result is acceptable from my point of view: diff -r 9038326f2d74 xml.schema.ui.basic/src/org/netbeans/modules/xml/schema/ui/basic/SchemaColumn.java --- a/xml.schema.ui.basic/src/org/netbeans/modules/xml/schema/ui/basic/SchemaColumn.java Wed Jul 23 15:14:16 2008 +0200 +++ b/xml.schema.ui.basic/src/org/netbeans/modules/xml/schema/ui/basic/SchemaColumn.java Thu Jul 24 11:43:20 2008 +0200 @@ -136,7 +136,7 @@ list.setCellRenderer(new ColumnListCellRenderer()); if (rootNode != null) { if (rootNode.getCookie(DummySchemaNode.class) == null && - rootNode.getCookie(SchemaNode.class) != null) { + rootNode.getCookie(SchemaNode.class) == null) { rootNode = new DummySchemaNode(rootNode); } getExplorerManager().setRootContext(rootNode); I removed dependency on node issue 140801, as right now I think the bug is in the ColumnListView explorer and is just manifested by our changes.
Sorry, the original owners do not work in this anymore. Let me look into this and I'll get back.
The patch will not work. The initial view should look like this: http://xml.netbeans.org/images/screenshots/columnView.png. In any case, I'm looking into it and if you can think of anything that might cause this, let me know.
So the the lazy initialization (of children) is causing the problem. Here is the new diff. diff -r 4b09793c5455 xml.schema.ui.basic/src/org/netbeans/modules/xml/schema/ui/ basic/SchemaColumn.java --- a/xml.schema.ui.basic/src/org/netbeans/modules/xml/schema/ui/basic/SchemaCol umn.java Thu Jul 24 08:16:36 2008 -0700 +++ b/xml.schema.ui.basic/src/org/netbeans/modules/xml/schema/ui/basic/SchemaCol umn.java Thu Jul 24 11:59:52 2008 -0500 @@ -137,6 +137,8 @@ if (rootNode != null) { if (rootNode.getCookie(DummySchemaNode.class) == null && rootNode.getCookie(SchemaNode.class) != null) { + //call getChildren.getNodes() once + rootNode.getChildren().getNodes(); rootNode = new DummySchemaNode(rootNode); } getExplorerManager().setRootContext(rootNode); What I do not understand is, why the same call (original.getChildren().getNodes()) inside createKeys() returns 0. In any case, attaching a jar for QE to verify.
I mean createKey() of DummySchemaNode.java.
Fixed: Fixed: http://hg.netbeans.org/main?cmd=changeset;node=634fd002109c.
It is very suspect for any code outside of the actual explorer views to be calling Children.getNodes(). Generally this is a layering violation - nodes should only _display_ data available in a more authoritative form in some other way.
Like I said, it should have worked inside createKey() of DummySchemaNode because it is the same node that is being passed to DummySchemaNode from SchemaColumn. I'll appreciate if experts in this area take a look at it. This code used to work until recent changes in nodes/explorer.
Fix Verified Product Version: NetBeans IDE Dev (Build 200808010201) Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119 System: Mac OS X version 10.5.4 running on i386; MacRoman; en_US (nb)