The following code:
Node node = cloud.getNode("xmltest");
NodeIterator i = node.getRelatedNodes().nodeIterator();
while (i.hasNext()) {
System.out.println(i.nextNode().getNodeManager().getName());
}
produces a list of string 'object'.
This is a known issue. In org.mmbase.bridge.util.xml.Generator this
behavior is called a 'bug' by Eduard a few years ago.
It caused by the 'convert' code in BasicNodeList, which creates
BasicNode objects using its 'own' nodemanager, and does not try to
upgrade it to the actual node-manager.
The following change fixes the issue:
~/mmbase/head/src/org/mmbase/bridge/implementation$ cvs diff BasicNodeList.java
Index: BasicNodeList.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/bridge/implementation/BasicNodeList.java,v
retrieving revision 1.32
diff -r1.32 BasicNodeList.java
75c75
< } else if (coreBuilder instanceof VirtualBuilder &&
nodeManager == null) {
---
> } else if (coreBuilder instanceof VirtualBuilder) {
87c87,89
< node = new BasicNode(coreNode, nodeManager);
---
>
> NodeManager specificNodeManager =
> nodeManager.getCloud().getNodeManager(coreNode.getBuilder().getTableName());
> node = new BasicNode(coreNode, specificNodeManager);
I would commit it, but I'm not sure everybody agrees that this indeed is a bug.
Does anybody has an argument why the current behaviour would be better?
--
mihxil' http://mihxil.komputilo.org/
nl_NL eo_XX en_US
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers