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.

Bug 28937 - XmiReader.read returns all objects, not just outermost objects
Summary: XmiReader.read returns all objects, not just outermost objects
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-22 11:57 UTC by _ briansmith
Modified: 2005-07-27 09:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ briansmith 2002-11-22 11:57:36 UTC
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.
Comment 1 Martin Matula 2002-11-22 12:11:00 UTC
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)
Comment 2 Daniel Prusa 2002-11-27 21:52:41 UTC
Fixed.
Comment 3 Jiri Prox 2005-07-27 09:03:34 UTC
quiet for too long, verified