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.
The result of XmiReader.read() methods is supposed to be a collection that contains _only_ the outermost object instances; however, it is currently returning all of the objects in the model, regardless if they are outermost objects or not. Look at this code in XmiElement.Instance.createInstance(): try { instance = refClass.refCreateInstance (args); } catch (Exception e) { ... } if (instance.equals (instance.refOutermostComposite ())) { context.addOutermostObject (instance); } Immediately after the instance is created, it will not have been added as a component to its composite instance yet, so of course instance.equals(instance.refOutermostComposite()). I believe that this is the source of the problem. This test shouldn't be made until after the instance has been added to its composite object (if any). But this is just a guess.
Dan, please look at this. Also please note, that JMI spec says that the read operation should return collection of outermost elements in the XMI.content tag. This has nothing to do with refOutermostComposite - object can be serialized as outermost in XMI.content, however it does not necessarily need to be outermost composite (see serialized instances of UML models where tagged values have to be serialized as outermost elements even if they are contained in a model element)
Fixed.
quiet for too long, verified