s_logger.error("Couldn't deserialize failure " + subMessage.toString());
}
failures.add(failure);
}
Map<ValueRequirement, ValueSpecification> mappings = new HashMap<>();
FudgeField mapping = message.getByName("mapping");
FudgeMsg mappingMsg = (FudgeMsg) mapping.getValue();
List<FudgeField> keys = mappingMsg.getAllByOrdinal(1); // keys
List<FudgeField> values = mappingMsg.getAllByOrdinal(2); // values
if (keys.size() != values.size()) {
s_logger.error("keys and values list in map don't have the same number of elements: message = {}", message);
throw new OpenGammaRuntimeException("keys and values list in map don't have the same number of elements");
}
for (int i = 0; i < keys.size(); i++) { // better to use iterators?
FudgeField reqField = keys.get(i);
ValueRequirement valueReq = deserializer.fieldValueToObject(ValueRequirement.class, reqField);
FudgeField specField = values.get(i);
ValueSpecification valueSpec = deserializer.fieldValueToObject(ValueSpecification.class, specField);
if (valueReq == null || valueSpec == null) {
s_logger.error("valueReq or valueSpec was null during deserialize: message = {}", message);
throw new OpenGammaRuntimeException("valueReq or valueSpec was null during deserialize");
}