[ 
https://issues.apache.org/jira/browse/UIMA-6193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17064075#comment-17064075
 ] 

Peter Klügl commented on UIMA-6193:
-----------------------------------

Thanks for reporting. 

I assume that you mean that ADD should behave like the initialization and not 
that the initialization should behave like ADD. I extended ADD now that it is 
able to add expressions itself. This could lead to unexpected behavior and I 
wonder if this rigth thing to do.

What do you think?

I also wonder how REMOVE should behave. I did not change its behavior now since 
it could be reasonable to remove entries based on their acutal value instead of 
their variable reference.

> Ruta: Initial assignment of list variables behaves strangely
> ------------------------------------------------------------
>
>                 Key: UIMA-6193
>                 URL: https://issues.apache.org/jira/browse/UIMA-6193
>             Project: UIMA
>          Issue Type: Bug
>          Components: Ruta
>    Affects Versions: 2.8.0ruta
>            Reporter: Michael Stenger
>            Assignee: Peter Klügl
>            Priority: Minor
>             Fix For: 2.8.1ruta, 3.0.1ruta
>
>
> When list variables are declared with a list containing variables as initial 
> value, the managing VariableListExpression seems to save the variable 
> expression given with that argument list instead of the represented values. 
> E.g.
> {code:java}
> INTLIST somelist = {var};{code}
> for a variable
> {code:java}
> INT var = 1;
> {code}
> stores the expression behind var instead of the value 1. So changing the 
> value of var after the declaration of somelist still effects the value of 
> somelist[0]. That's not the case if ADD was used instead.
> Consider this example:
> {code:java}
> DECLARE testType (StringArray arr);
> STRING s = "a";
> STRINGLIST sl = {s};
> Document{ -> ADD(sl, s), s = "b", CREATE(testType, "arr" = sl)};{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to