[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Initialize multivalued attributes/references

Felix,

Comments below.

Felix Dorner wrote:
Hi Ed,
 >> 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.
This doesn't sound quite right to me. All features for which upperBound > 1 will have an initialized list.

Uhm, the only thing i can think of that the behaviour is different for EAttributes and EReferences. I'm talking about an EReference.
No, it's the same. That makes it even more mysterious.

Is this list just a single valued feature who's value happens to be a list (like from an XSD list type)?

I directly create the model with the tree editor, just like the author->*book example. So the type is book and its upperbound is -1.
There must be something that's gone unsaid so far because multi-valued features (attributes or references) will always return a list, never null. Can you think of anything odd about your model that makes it different from author -> books which we know works properly?


Felix