private static List<ValueInfo> getNamePairListFromResult(Value value)
{
if (value instanceof ObjectValue)
{
ObjectValue objVal = ((ObjectValue) value);
List<ValueInfo> values = new Vector<ValueInfo>();
Set<String> existingFields = new HashSet<String>();
for (NameValuePair child : objVal.members.asList())
{
existingFields.add(child.name.name);
values.add(createValue(child.name, objVal.type.classdef, child.value, objVal.getCPU()));
}
// FIXME: Fix for BUG: 54536, problematic static initialization with more then 30 files
// https://chessforge.chess-it.com/gf/project/destecs/tracker/?action=TrackerItemEdit&tracker_item_id=54536&start=0
try
{
for (Field fi : objVal.type.classdef.getClass().getDeclaredFields())
{
if (fi.getName().equals("privateStaticValues"))
{
fi.setAccessible(true);
NameValuePairMap privateStaticValues = (NameValuePairMap) fi.get(objVal.type.classdef);
for (NameValuePair child : privateStaticValues.asList())
{
if (!existingFields.contains(child.name.name))
{
values.add(createValue(child.name, objVal.type.classdef, child.value, objVal.getCPU()));
}
}
}
if (fi.getName().equals("publicStaticValues"))
{
fi.setAccessible(true);
NameValuePairMap privateStaticValues = (NameValuePairMap) fi.get(objVal.type.classdef);
for (NameValuePair child : privateStaticValues.asList())
{
if (!existingFields.contains(child.name.name))
{
values.add(createValue(child.name, objVal.type.classdef, child.value, objVal.getCPU()));
}
}
}
}