Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » The generated code of OCLEcore.genmodel
The generated code of OCLEcore.genmodel [message #9392] Sun, 25 February 2007 20:09 Go to next message
A. Jibran Shidqie is currently offline A. Jibran ShidqieFriend
Messages: 26
Registered: July 2009
Junior Member
Hi,

The generated code out of the OCLEcore.genmodel which still has "@generated"
as its comments is the original generated code, isn't it? I mean there is no
modification upon that particular code. for example, the snipped code below
is part of the org.eclipse.ocl.ecore.CollectionTypeImpl:

===========================
/**

* The cached value of the '{@link #getElementType() <em>Element Type</em>}'
reference.

* <!-- begin-user-doc -->

* <!-- end-user-doc -->

* @see #getElementType()

* @generated

* @ordered

*/

protected EClassifier elementType = null;

===============================


I tried to regenerate the code from the given OCLEcore.genmodel from the
plugin. but the result was different, the parameter 'C' of elementType was
not generated as 'EClassifier'.

======================
/**

* The cached value of the '{@link #getElementType() <em>Element Type</em>}'
reference.

* <!-- begin-user-doc -->

* <!-- end-user-doc -->

* @see #getElementType()

* @generated

* @ordered

*/

protected C elementType = null;

=======================


My question is whether the part of generated code above has been modifed
manually. If not, how can I regenerate it from the given genModel to produce
the same result. Does it need to alter the option of the genModel?

Thanks

Best regards,
Jibran
Re: The generated code of OCLEcore.genmodel [message #9417 is a reply to message #9392] Mon, 26 February 2007 14:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Jibran,

You are seeing the consequence of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=167935 (Multiple inheritance
with generic type bindings generates bad code).

When I generated this code, I had to find-and-replace occurrences of 'C'
with 'EClassifier', 'O' with 'EOperation', etc. because these type
parameters are not valid in the context of the subtype that binds the type
parameters of its supertype.

I did not mark the code that I changes as @generated NOT because I did not
anticipate having to regenerate until bug 167935 is fixed. Or, at least, I
don't mind making these changes when I do because it's not difficult.

Cheers,

Christian


A. Jibran Shidqie wrote:

> Hi,
>
> The generated code out of the OCLEcore.genmodel which still has
> "@generated" as its comments is the original generated code, isn't it? I
> mean there is no modification upon that particular code. for example, the
> snipped code below is part of the
> org.eclipse.ocl.ecore.CollectionTypeImpl:
>
> ===========================
> /**
>
> * The cached value of the '{@link #getElementType() <em>Element
> Type</em>}' reference.
>
> * <!-- begin-user-doc -->
>
> * <!-- end-user-doc -->
>
> * @see #getElementType()
>
> * @generated
>
> * @ordered
>
> */
>
> protected EClassifier elementType = null;
>
> ===============================
>
>
> I tried to regenerate the code from the given OCLEcore.genmodel from the
> plugin. but the result was different, the parameter 'C' of elementType was
> not generated as 'EClassifier'.
>
> ======================
> /**
>
> * The cached value of the '{@link #getElementType() <em>Element
> Type</em>}' reference.
>
> * <!-- begin-user-doc -->
>
> * <!-- end-user-doc -->
>
> * @see #getElementType()
>
> * @generated
>
> * @ordered
>
> */
>
> protected C elementType = null;
>
> =======================
>
>
> My question is whether the part of generated code above has been modifed
> manually. If not, how can I regenerate it from the given genModel to
> produce the same result. Does it need to alter the option of the genModel?
>
> Thanks
>
> Best regards,
> Jibran
Re: The generated code of OCLEcore.genmodel [message #9441 is a reply to message #9417] Wed, 28 February 2007 09:14 Go to previous message
A. Jibran Shidqie is currently offline A. Jibran ShidqieFriend
Messages: 26
Registered: July 2009
Junior Member
Hi Christian,

I see now. I thought there's something wrong with my EMF build.

Actually I also have asked about this problem to EMF group, and Ed suggested
me to report it to bugzilla. The problem is kind of similar that the one
you've encountered. I tried to generate it only with single inheritance, but
still the type parameter is not generated correctly.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=175801


Best regards,
Jibran

"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:erurp5$sfl$1@utils.eclipse.org...
>
> Hi, Jibran,
>
> You are seeing the consequence of
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=167935 (Multiple inheritance
> with generic type bindings generates bad code).
>
> When I generated this code, I had to find-and-replace occurrences of 'C'
> with 'EClassifier', 'O' with 'EOperation', etc. because these type
> parameters are not valid in the context of the subtype that binds the type
> parameters of its supertype.
>
> I did not mark the code that I changes as @generated NOT because I did not
> anticipate having to regenerate until bug 167935 is fixed. Or, at least,
> I
> don't mind making these changes when I do because it's not difficult.
>
> Cheers,
>
> Christian
>
>
> A. Jibran Shidqie wrote:
>
>> Hi,
>>
>> The generated code out of the OCLEcore.genmodel which still has
>> "@generated" as its comments is the original generated code, isn't it? I
>> mean there is no modification upon that particular code. for example, the
>> snipped code below is part of the
>> org.eclipse.ocl.ecore.CollectionTypeImpl:
>>
>> ===========================
>> /**
>>
>> * The cached value of the '{@link #getElementType() <em>Element
>> Type</em>}' reference.
>>
>> * <!-- begin-user-doc -->
>>
>> * <!-- end-user-doc -->
>>
>> * @see #getElementType()
>>
>> * @generated
>>
>> * @ordered
>>
>> */
>>
>> protected EClassifier elementType = null;
>>
>> ===============================
>>
>>
>> I tried to regenerate the code from the given OCLEcore.genmodel from the
>> plugin. but the result was different, the parameter 'C' of elementType
>> was
>> not generated as 'EClassifier'.
>>
>> ======================
>> /**
>>
>> * The cached value of the '{@link #getElementType() <em>Element
>> Type</em>}' reference.
>>
>> * <!-- begin-user-doc -->
>>
>> * <!-- end-user-doc -->
>>
>> * @see #getElementType()
>>
>> * @generated
>>
>> * @ordered
>>
>> */
>>
>> protected C elementType = null;
>>
>> =======================
>>
>>
>> My question is whether the part of generated code above has been modifed
>> manually. If not, how can I regenerate it from the given genModel to
>> produce the same result. Does it need to alter the option of the
>> genModel?
>>
>> Thanks
>>
>> Best regards,
>> Jibran
>
Previous Topic:impedance mismatch between OCL and UML2
Next Topic:allInstances
Goto Forum:
  


Current Time: Sat Apr 20 00:03:09 GMT 2024

Powered by FUDForum. Page generated in 0.03205 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top