incorrect instance identifier in payload
* added custom exception when xpath argument ends with slash (before it
threw string out of bounds exception)
* added null check in DataSchemaContextNode so unknown qname for child
node does not crash on null pointer exception
Change-Id: Ie8db9c3cc1726dd73306437cb4eebb24f88eb5d9
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
static DataSchemaContextNode<?> fromSchemaAndQNameChecked(final DataNodeContainer schema, final QName child) {
DataSchemaNode result = findChildSchemaNode(schema, child);
// We try to look up if this node was added by augmentation
- if ((schema instanceof DataSchemaNode) && result.isAugmenting()) {
+ if (result != null && (schema instanceof DataSchemaNode) && result.isAugmenting()) {
return fromAugmentation(schema, (AugmentationTarget) schema, result);
}
return fromDataSchemaNode(result);
}
private PathArgument computeNextArgument() {
- checkValid(SLASH == currentChar(),"Identifier must start with '/'.");
+ checkValid(SLASH == currentChar(), "Identifier must start with '/'.");
skipCurrentChar();
-
+ checkValid(!allCharactersConsumed(), "Identifier cannot end with '/'.");
QName name = nextQName();
if(allCharactersConsumed() || SLASH == currentChar()) {
return computeIdentifier(name);