[ATL] ERROR in moving a single-valued optional reference to a multi-valued reference [message #35769] |
Thu, 03 May 2007 11:38 |
Eclipse User |
|
|
|
Originally posted by: markus.herrmannsdoerfer.bmw-carit.de
Hi,
I want to move the data of a single-valued optional containment
reference (i.e. multiplicity 0..1) to a multi-valued containment
reference (i.e. multiplicity 0..*). The single-valued reference is named
'single' and the multi-valued is named 'multi' in the following. My
first try was to specify the binding in the following way:
multi <- xyz.single
However, the reference 'single' may be null for certain objects and so I
get the error
java.lang.IllegalArgumentException: The 'no null' constraint is violated
from the EMF EList implementation during transformation. Ok that means I
have to use a sequence on the right side and so my next try was the
following:
multi <- xyz.single.asSequence()
In this case, I get the error
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
thrown by the Java ArrayList during transformation. It seems to me that
asSequence() correctly produces an empty sequence in case the element is
null. But why does ATL try to access the first element of that list? The
following try
multi <- if xyz.single.oclIsUndefined() then Sequence{} else
Sequence{xzy.single} endif
left me with the same error message. After the error ATL does not
recover correctly and thus some transformed elements are not contained
as expected.
Is this a bug of ATL or am I not using the language correctly. Thanks
for your help in advance.
Regards,
Markus
|
|
|
Re: [ATL] ERROR in moving a single-valued optional reference to a multi-valued reference [message #35836 is a reply to message #35769] |
Thu, 03 May 2007 13:07 |
Eclipse User |
|
|
|
Originally posted by: markus.herrmannsdoerfer.bmw-carit.de
I have to relativate my previous post. In a simple setting, the solution
with asSequence() works. Perhaps the error comes from another part of my
transformation. How can I better interpret the error messages written to
the console?
Thanks in advance.
Markus Herrmannsdörfer
Markus Herrmannsdoerfer wrote:
> Hi,
>
> I want to move the data of a single-valued optional containment
> reference (i.e. multiplicity 0..1) to a multi-valued containment
> reference (i.e. multiplicity 0..*). The single-valued reference is named
> 'single' and the multi-valued is named 'multi' in the following. My
> first try was to specify the binding in the following way:
>
>
> multi <- xyz.single
>
>
> However, the reference 'single' may be null for certain objects and so I
> get the error
>
> java.lang.IllegalArgumentException: The 'no null' constraint is violated
>
> from the EMF EList implementation during transformation. Ok that means I
> have to use a sequence on the right side and so my next try was the
> following:
>
>
> multi <- xyz.single.asSequence()
>
>
> In this case, I get the error
>
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>
> thrown by the Java ArrayList during transformation. It seems to me that
> asSequence() correctly produces an empty sequence in case the element is
> null. But why does ATL try to access the first element of that list? The
> following try
>
>
> multi <- if xyz.single.oclIsUndefined() then Sequence{} else
> Sequence{xzy.single} endif
>
>
> left me with the same error message. After the error ATL does not
> recover correctly and thus some transformed elements are not contained
> as expected.
>
> Is this a bug of ATL or am I not using the language correctly. Thanks
> for your help in advance.
>
>
> Regards,
> Markus
|
|
|
Powered by
FUDForum. Page generated in 0.03257 seconds