Extend EcoreEnvironment locally [message #917816] |
Thu, 20 September 2012 13:04 |
Eclipse User |
|
|
|
Hello,
there is an opportunity to extend the EcoreEnvironment by using for
example the "defineOperation" method. I did this for example to extend
the OCLEnvironment by the operation "getValue()" of a EFeatureMapEntry.
But when I tried to evaluate this operation I got a NullPointerException
caused by line 227 in the class EcoreEvaluationEnvironment.
I think this occurrs because of a mistake in line 206.
When an operation is added to the Environment a so called "ShadowClass"
with the added EOperation will be created. But in the shadow class no
information about the correct InstanceClass is stored.
To get this information I changed line 206 to:
EClassifier container = OCLStandardLibraryImpl.getOwner(operation);
Am I right, is this a mistake?
Best regards,
Lilija Klassen
|
|
|
|
Re: Extend EcoreEnvironment locally [message #918635 is a reply to message #918056] |
Fri, 21 September 2012 07:32 |
Eclipse User |
|
|
|
Hey,
Oh yes, sorry for that I use version 3.1.0, but its also the same line
in version 3.2.0.
class EcoreEvaluationEnvironment, method getJavaMethodFor,
line 206: EClass container = operation.getEContainingClass();
Regards
Lilija Klassen
Am 20.09.2012 19:43, schrieb Ed Willink:
> Hi
>
> You give no clue about which version you use.
>
> For me line 206 is a blank line.
>
> Regards
>
> Ed Willink
>
>
>
> On 20/09/2012 14:04, Lilija Klassen wrote:
>> Hello,
>>
>> there is an opportunity to extend the EcoreEnvironment by using for
>> example the "defineOperation" method. I did this for example to extend
>> the OCLEnvironment by the operation "getValue()" of a EFeatureMapEntry.
>>
>> But when I tried to evaluate this operation I got a
>> NullPointerException caused by line 227 in the class
>> EcoreEvaluationEnvironment.
>> I think this occurrs because of a mistake in line 206.
>>
>> When an operation is added to the Environment a so called
>> "ShadowClass" with the added EOperation will be created. But in the
>> shadow class no information about the correct InstanceClass is stored.
>>
>> To get this information I changed line 206 to:
>> EClassifier container = OCLStandardLibraryImpl.getOwner(operation);
>>
>> Am I right, is this a mistake?
>>
>> Best regards,
>>
>> Lilija Klassen
>>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02653 seconds