| [news.eclipse.tools.emf] Re: Initialize multivalued attributes/references |
Felix,
Comments below.
This doesn't sound quite right to me. All features for which upperBound > 1 will have an initialized list.Hi,
when adding a multivalued attribute to an EClass, the generated code doesn't initialize the attribute. Thus,
calling getMyAttributeList() might return null. The solution is to perform a check or modify the generated code.
I'd prefer that the corresponding field is initlialized with an Empty List. Is there an option in the genmodel? in the model itself?Is this list just a single valued feature who's value happens to be a list (like from an XSD list type)?
Before I've always hacked the generated class, but I don't feel comfortable. Maybe I should just modify the Factory methods?If it's just a single valued feature that happens to has a list value, presumably you empty list is represented as the empty string so you could make that the default value of the attribute...
Thanks. I promise to add replies to the FAQ.
Felix