}
private final void setValue(final AbstractNodeDataWithSchema parent, final String value) {
- Preconditions.checkArgument(parent instanceof SimpleNodeDataWithSchema, "Node %s is not a simple type", parent);
+ Preconditions.checkArgument(parent instanceof SimpleNodeDataWithSchema, "Node %s is not a simple type", parent.getSchema().getQName());
final Object translatedValue = translateValueByType(value, parent.getSchema());
((SimpleNodeDataWithSchema) parent).setValue(translatedValue);
} else if (parent instanceof LeafListNodeDataWithSchema) {
newChild = new LeafListEntryNodeDataWithSchema(parent.getSchema());
} else {
- throw new IllegalStateException("Incorrec nesting caused by parser.");
+ throw new IllegalStateException("Found an unexpected array nested under "+ parent.getSchema().getQName());
}
((CompositeNodeDataWithSchema) parent).addChild(newChild);
return newChild;
} else if (potentialUris.size() > 1) {
throw new IllegalStateException("Choose suitable module name for element "+nodeNamePart+":"+toModuleNames(potentialUris));
} else if (potentialUris.isEmpty()) {
- throw new IllegalStateException("Schema node with name "+nodeNamePart+" wasn't found.");
+ throw new IllegalStateException("Schema node with name "+nodeNamePart+" wasn't found under "+dataSchemaNode.getQName()+".");
}
}
//second parameter isn't necessary because error will be raised before it is used.
verifyTransformationToNormalizedNode(inputJson, null);
} catch (final IllegalStateException e) {
- assertTrue(e.getMessage().contains("Schema node with name dummy-element wasn't found."));
+ assertTrue(e.getMessage().contains("Schema node with name dummy-element wasn't found"));
}
}