From 3499bc0e37043073992c437daed87f10ba0a3e82 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 18 Jan 2017 17:30:35 +0100 Subject: [PATCH] Remove DOMRpcIdentifier.GLOBAL_CONTEXT This is a shorthand for YangInstanceIdentifier.EMPTY, hence we can inline the definition. Change-Id: Icb8f025feb48cbc6add7c30d1db863b19c18f546 Signed-off-by: Robert Varga --- .../controller/md/sal/dom/api/DOMRpcIdentifier.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/md/sal/dom/api/DOMRpcIdentifier.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/md/sal/dom/api/DOMRpcIdentifier.java index 671671c905..fb38a8f185 100644 --- a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/md/sal/dom/api/DOMRpcIdentifier.java +++ b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/md/sal/dom/api/DOMRpcIdentifier.java @@ -9,12 +9,10 @@ package org.opendaylight.controller.md.sal.dom.api; import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; -import java.util.Collections; import java.util.Objects; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.model.api.SchemaPath; /** @@ -25,8 +23,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath; */ public abstract class DOMRpcIdentifier { - private static final YangInstanceIdentifier GLOBAL_CONTEXT = YangInstanceIdentifier.create(Collections.emptySet()); - private static final class Global extends DOMRpcIdentifier { private Global(final @Nonnull SchemaPath type) { super(type); @@ -34,7 +30,7 @@ public abstract class DOMRpcIdentifier { @Override public YangInstanceIdentifier getContextReference() { - return GLOBAL_CONTEXT; + return YangInstanceIdentifier.EMPTY; } } @@ -76,11 +72,10 @@ public abstract class DOMRpcIdentifier { * @return A global RPC identifier, guaranteed to be non-null. */ public static @Nonnull DOMRpcIdentifier create(final @Nonnull SchemaPath type, final @Nullable YangInstanceIdentifier contextReference) { - if (contextReference == null || GLOBAL_CONTEXT.equals(contextReference)) { + if (contextReference == null || contextReference.isEmpty()) { return new Global(type); - } else { - return new Local(type, contextReference); } + return new Local(type, contextReference); } /** -- 2.36.6