Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352391

Summary: Add ability to disable addTo....() and get...() returning unmodifiable
Product: [Modeling] EMFT Reporter: Mike Cooper <mcooper>
Component: TexoAssignee: Martin Taal <mtaal>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: Future   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Mike Cooper CLA 2011-07-18 16:29:11 EDT
I hit an unexpected and potentially painful snag with texo generated class code.  It seems that for collection (List) types Texo return umodifiablecollection for each get...() collection method.  This is not typical Java behavior.  I do like this approach, but if you have a lot of code which assumes a modifiable List is returned then you can hit some problems at runtime.

It would be nice if there was a Texo option to fallback to the behavior of returning modifiable collections.
Comment 1 Martin Taal CLA 2011-07-18 16:31:43 EDT
This can be done through an annotation, as a default it should not do what you get currently. See this page for more information:

http://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29

gr. Martin
Comment 2 Mike Cooper CLA 2011-07-18 17:04:33 EDT
Thanks for the pointer.  I hadn't noticed that.  

It doesn't seem to be working for me, though.  If I set
 "Generate Bidirectional Association Support" to "false" and 
"Generate Safe Many Access" to "false", delete the generated code, and generate new model code I get the same classes which still return unmodifiableList and have addTo... and remove... methods.  I've confirmed I've saved my annotationsmodel file.
Comment 3 Martin Taal CLA 2012-01-30 05:32:37 EST
Hi Mike,
An older issue, are you still encountering this?

gr. Martin
Comment 4 Mike Cooper CLA 2012-01-30 11:46:23 EST
I don't think this problem is still occurring.

mike
Comment 5 Martin Taal CLA 2012-01-30 14:06:55 EST
Not reproducable anymore