Michael Stenger created UIMA-6193:
-------------------------------------
Summary: 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
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)