Menu

#2 Using set indirect converts to String

open
nobody
None
5
2014-07-24
2001-06-26
Anonymous
No

If you do the following

<set name="xyz" value="abc" indirect="true"/>

where abc is not of the type java.lang.String, the
assignment converts the value of abc to String before
assigning it to xyz. The reason is the following
method in JXTestCase:

public Object getObjectValueNoSchema(String value,
boolean indirect)
throws Throwable
{
if(indirect)
return properties.getString(value);
return value;
}

It should be

public Object getObjectValueNoSchema(String value,
boolean indirect)
throws Throwable
{
if(indirect)
return properties.get(value);
return value;
}

This would preserve the type of the original value.

Discussion

MongoDB Logo MongoDB