Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCl variable of type EEList
OCl variable of type EEList [message #923925] Wed, 26 September 2012 10:02 Go to next message
Eclipse UserFriend
Hello,

I added a variable named "objectlist" to the OCL Environment, which is
an EcoreEnvironment, of type EEList.
When I try to evaluate for example the expression "objectlist.at(1)" a
NullpointerException is thrown
(caused by line 225:
result =containerClass.getMethod(operName,javaParms);
in EcoreEvaluationEnvironment).

So am I doing something wrong or is EEList not supported?

Best regards,

Lilija
Re: OCl variable of type EEList [message #923956 is a reply to message #923925] Wed, 26 September 2012 10:43 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

a) the NPE looks rather like the inadequate EDataType support fixed in
Juno SR1 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=388595).

b) EEList is an opaque EDataType so it has no operations.

c) EEList<T> is a templated type and OMG OCL does not support templated
types. (The new pivot-based Eclipse OCL has some support.)

d) if EEList was supported as a collection it would be objectList->at(1).

So I'm afraid that EEList is not supported.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=390427 raised.

Regards

Ed Willink

On 26/09/2012 11:02, Lilija Klassen wrote:
> Hello,
>
> I added a variable named "objectlist" to the OCL Environment, which is
> an EcoreEnvironment, of type EEList.
> When I try to evaluate for example the expression "objectlist.at(1)" a
> NullpointerException is thrown
> (caused by line 225:
> result =containerClass.getMethod(operName,javaParms);
> in EcoreEvaluationEnvironment).
>
> So am I doing something wrong or is EEList not supported?
>
> Best regards,
>
> Lilija
Re: OCl variable of type EEList [message #924146 is a reply to message #923956] Wed, 26 September 2012 14:55 Go to previous message
Eclipse UserFriend
Hey,

I fixed the problem by setting the type of the variable to the OCLType:

var.setType(ocl.getEnvironment().getUMLReflection().asOCLType(EcorePackage.Literals.EE_LIST));

regards

Lilija


Am 26.09.2012 12:43, schrieb Ed Willink:
> Hi
>
> a) the NPE looks rather like the inadequate EDataType support fixed in
> Juno SR1 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=388595).
>
> b) EEList is an opaque EDataType so it has no operations.
>
> c) EEList<T> is a templated type and OMG OCL does not support templated
> types. (The new pivot-based Eclipse OCL has some support.)
>
> d) if EEList was supported as a collection it would be objectList->at(1).
>
> So I'm afraid that EEList is not supported.
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=390427 raised.
>
> Regards
>
> Ed Willink
>
> On 26/09/2012 11:02, Lilija Klassen wrote:
>> Hello,
>>
>> I added a variable named "objectlist" to the OCL Environment, which is
>> an EcoreEnvironment, of type EEList.
>> When I try to evaluate for example the expression "objectlist.at(1)" a
>> NullpointerException is thrown
>> (caused by line 225:
>> result =containerClass.getMethod(operName,javaParms);
>> in EcoreEvaluationEnvironment).
>>
>> So am I doing something wrong or is EEList not supported?
>>
>> Best regards,
>>
>> Lilija
>
Previous Topic:ocl contains operations over strings
Next Topic:[Announce] Eclipse OCL 4.0.1 (Juno SR1) is now available
Goto Forum:
  


Current Time: Thu Apr 18 23:56:50 GMT 2024

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

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

Back to the top