X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Frestconf-nb-rfc8040%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fnb%2Frfc8040%2Futils%2Fparser%2FYangInstanceIdentifierDeserializer.java;h=2b9bbc778b0fa07691451a31af28956ebeed904f;hb=8e2383e5fd0f14873fb0558ae2545bfe10367f31;hp=acbb65a60b38e19684863266122ebc9cade36ee0;hpb=2b68d50bc232318eb39fc033cab46878073f399f;p=netconf.git diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/YangInstanceIdentifierDeserializer.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/YangInstanceIdentifierDeserializer.java index acbb65a60b..2b9bbc778b 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/YangInstanceIdentifierDeserializer.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/utils/parser/YangInstanceIdentifierDeserializer.java @@ -8,7 +8,6 @@ package org.opendaylight.restconf.nb.rfc8040.utils.parser; import static java.util.Objects.requireNonNull; -import static org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants.SLASH; import com.google.common.base.CharMatcher; import com.google.common.collect.ImmutableList; @@ -95,7 +94,7 @@ public final class YangInstanceIdentifierDeserializer { final QName qname = prepareQName(); // this is the last identifier (input is consumed) or end of identifier (slash) - if (allCharsConsumed() || currentChar() == SLASH) { + if (allCharsConsumed() || currentChar() == '/') { prepareIdentifier(qname, path); path.add(current == null ? NodeIdentifier.create(qname) : current.getIdentifier()); } else if (currentChar() == '=') { @@ -123,7 +122,7 @@ public final class YangInstanceIdentifierDeserializer { skipCurrentChar(); // read key value separated by comma - while (keys.hasNext() && !allCharsConsumed() && currentChar() != SLASH) { + while (keys.hasNext() && !allCharsConsumed() && currentChar() != '/') { // empty key value if (currentChar() == ',') { @@ -319,11 +318,11 @@ public final class YangInstanceIdentifierDeserializer { private void validArg() { // every identifier except of the first MUST start with slash if (offset != 0) { - checkValid(SLASH == currentChar(), ErrorTag.MALFORMED_MESSAGE, "Identifier must start with '/'."); + checkValid('/' == currentChar(), ErrorTag.MALFORMED_MESSAGE, "Identifier must start with '/'."); // skip consecutive slashes, users often assume restconf URLs behave just as HTTP does by squashing // multiple slashes into a single one - while (!allCharsConsumed() && SLASH == currentChar()) { + while (!allCharsConsumed() && '/' == currentChar()) { skipCurrentChar(); }