From: Robert Varga Date: Wed, 2 Jul 2014 18:29:30 +0000 (+0200) Subject: BUG-868: Fix a warning in EmptyNodeWrapper X-Git-Tag: release/helium~558^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=04067d34aeb80d3b11264210773c1fc98a47665d BUG-868: Fix a warning in EmptyNodeWrapper Simple use of deprecated method to implement the same method. Add @Deprecated marker to silence the warning. Change-Id: I274e7afdecdd9ece5b0b8809ad1fee53abbafef3 Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/EmptyNodeWrapper.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/EmptyNodeWrapper.java index 934d4434c3..f93a0aea70 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/EmptyNodeWrapper.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/EmptyNodeWrapper.java @@ -7,6 +7,8 @@ */ package org.opendaylight.controller.sal.restconf.impl; +import com.google.common.base.Preconditions; + import java.net.URI; import java.util.Collections; @@ -15,8 +17,6 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.impl.NodeFactory; -import com.google.common.base.Preconditions; - public final class EmptyNodeWrapper implements NodeWrapper>, Node { private Node unwrapped; @@ -31,17 +31,17 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node return composite; } - public void setComposite(boolean composite) { + public void setComposite(final boolean composite) { this.composite = composite; } - public EmptyNodeWrapper(URI namespace, String localName) { + public EmptyNodeWrapper(final URI namespace, final String localName) { this.localName = Preconditions.checkNotNull(localName); this.namespace = namespace; } @Override - public void setQname(QName name) { + public void setQname(final QName name) { Preconditions.checkState(unwrapped == null, "Cannot change the object, due to data inconsistencies."); this.name = name; } @@ -68,7 +68,7 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node } @Override - public void setNamespace(URI namespace) { + public void setNamespace(final URI namespace) { Preconditions.checkState(unwrapped == null, "Cannot change the object, due to data inconsistencies."); this.namespace = namespace; } @@ -103,6 +103,7 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node } @Override + @Deprecated public CompositeNode getParent() { return unwrap().getParent(); } @@ -118,7 +119,7 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node } @Override - public Void setValue(Void value) { + public Void setValue(final Void value) { return null; }