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.
Summary: | XMI export of transient objects yields infinite loop | ||
---|---|---|---|
Product: | java | Reporter: | _ jsichi <jsichi> |
Component: | Unsupported | Assignee: | issues@java <issues> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | test case source files for issue 34081 |
Description
_ jsichi
2003-06-02 06:27:18 UTC
Created attachment 10552 [details]
test case source files for issue 34081
Evaluation: The infinite loop is caused by a bug related to transient objects. The call container.getContained().add(contained); should add link between 'container' and 'contained', however, container.getContained(); returns a collection storing 'container' (instead of 'contained'). This does not happen if transient objects are not used. The other thing is that transient objects should not be serialized into xmi at all ... Hi Dan, so are you going to do anything about this? Thanks for looking at it so quickly. Is there a reason transient objects shouldn't be acceptable to XMI export/import? I'm using it for readable serialization of command-pattern objects, for which it seems quite useful. Maybe I should be using an in-memory repository instead. I have fixed the bug related to transient objects. As a consequence, xmi writer does not loop and a correct xmi document is produced (including transient objects - regarding them, I have not made any changes in xmi writer). Thanks! I verified the fix and XMI export works fine. After re-enabling transient support in my application, I ran into another problem which is easy to reproduce. If you make the Contained end of the association ordered, and then attempt System.out.println(container.getContained().indexOf(contained)); you'll get a ClassCastException: [java] Exception in thread "main" java.lang.ClassCastException [java] at org.netbeans.mdr.storagemodel.transientimpl.TransientMultivaluedOrderedIndex.getItemsOrdered(TransientMultivaluedOrderedIndex.java:325) [java] at org.netbeans.mdr.storagemodel.AssocEndIndexUList.getItemsList(AssocEndIndexUList.java:38) [java] at org.netbeans.mdr.storagemodel.AssocEndIndexUList.indexOf(AssocEndIndexUList.java:66) [java] at org.netbeans.mdr.handlers.AEIndexUListWrapper.indexOf(AEIndexUListWrapper.java:162) [java] at Test.main(Test.java:42) Probably the superclass slipped in a SlotCollection which should have been an OrderedSlotCollection. Should I reopen this issue or open a new one? OK, the reason why the exception occured was exactly as you described. It is fixed. If you encounter another bug related to transient objects, open a new issue, please. |