|
|
Re: Duplicate generated method from extended ecore model [message #1480807 is a reply to message #1480398] |
Thu, 20 November 2014 13:55 |
Jacob He Messages: 10 Registered: October 2013 |
Junior Member |
|
|
Thanks. It works after I disable the property.
Ed Merks wrote on Thu, 20 November 2014 01:33Jacob,
It sounds like someone has enabled the GenModel's Model -> Array
Accessors property.
On 19/11/2014 7:14 PM, Jacob He wrote:
> I am creating an ASTM model by extending modisco's OMG GASTM model. I
> define an extended function definition class from GASTM's
> FunctionDefinition. When I generate the model code, there are several
> duplicate methods with different return types as follow:
>
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> public FormalParameterDefinition[] getFormalParameters() {
> if (formalParameters == null || formalParameters.isEmpty())
> return FORMAL_PARAMETERS_EEMPTY_ARRAY;
> BasicEList<FormalParameterDefinition> list =
> (BasicEList<FormalParameterDefinition>)formalParameters;
> list.shrink();
> return (FormalParameterDefinition[])list.data();
> }
>
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> public EList<FormalParameterDefinition> getFormalParameters() {
> if (formalParameters == null) {
> formalParameters = new
> EObjectContainmentEList<FormalParameterDefinition>(FormalParameterDefinition.class,
> this, Rpg4Package.IRPG4_PROCEDURE_STATEMENT__FORMAL_PARAMETERS +
> EOFFSET_CORRECTION);
> }
> return formalParameters;
> }
>
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> public Statement[] getBody() {
> if (body == null || body.isEmpty()) return BODY_EEMPTY_ARRAY;
> BasicEList<Statement> list = (BasicEList<Statement>)body;
> list.shrink();
> return (Statement[])list.data();
> }
>
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> public EList<Statement> getBody() {
> if (body == null) {
> body = new
> EObjectContainmentEList<Statement>(Statement.class, this,
> Rpg4Package.IRPG4_PROCEDURE_STATEMENT__BODY + EOFFSET_CORRECTION);
> }
> return body;
> }
>
> I checked the super declarations in class
> org.eclipse.modisco.omg.gastm.FunctionDefinition, only the methods
> return EList<?> are defined.
>
> Why does EMF generate the methods return array? How can I make EMF
> doesn't generate them?
|
|
|
Powered by
FUDForum. Page generated in 0.01968 seconds