| Summary: | IllegalArgumentException when loading a model containing a Changeable=false reference with the OPTION_DEFER_IDREF_RESOLUTION set to true. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Svetlin <svetlin.mladenov> | ||||
| Component: | XML/XMI | Assignee: | Ed Merks <Ed.Merks> | ||||
| Status: | RESOLVED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Svetlin
Created attachment 199783 [details]
A test project to help reproduce the problem.
Import the attached java project and run testmodel.test.TestMain as Java Project to reproduce the problem and see a stack trace.
I'm really not sure what you're expecting. Firstly, making one end of a bidirectional reference is a little odd, but fine, you want to force editing to happen from the other end. That means you should never directly set the one end... But then you decide not to make that end transient? Why? You've decided not to allow it to be set but the serializer will save the value and the deserializer will try to set it. It seems to me you have a few choices. One, make the non-changeable end transient; of course that only makes sense if the ends of the references will always be in the same document, so resolveProxies would also have to be false. Otherwise, the serializer need to be able to set the value from both ends so you can't make it unchangeable. Better to suppress the setter from the public API (see EcoreUtil.setSuppressedVisibility) so that the client can't easily set the value but reflectively, it's still possible (for the serializer) to set the value reflectively. |