}
private ArrayProperties buildArrayProperties() throws MethodIsBlockingException {
ObjectProperties loadedProperties = getLoadedProperties();
final TreeMap<Integer, JsVariable> map = new TreeMap<Integer, JsVariable>();
JsValue lengthValue = null;
for (JsVariable variable : loadedProperties.properties()) {
String name = variable.getName();
if (WipExpressionBuilder.ALL_DIGITS.matcher(name).matches()) {
Integer number = Integer.valueOf(name);
map.put(number, variable);
} else if ("length".equals(name)) {
lengthValue = variable.getValue();
}
}
int length;
try {
length = Integer.parseInt(lengthValue.getValueString());
} catch (NumberFormatException e) {
length = -1;
}
return new ArrayProperties(length, map);
}