BUG 2412 - Restconf migration - marking deprecated classes 67/15667/1
authorVaclav Demcak <vdemcak@cisco.com>
Tue, 24 Feb 2015 13:33:44 +0000 (14:33 +0100)
committerVaclav Demcak <vdemcak@cisco.com>
Tue, 24 Feb 2015 15:37:01 +0000 (16:37 +0100)
* mark basic deprecated classes and functionality which has to
be overwirte by this commit chain.

New faster Infrastructure API works with NormizedNodeContext
and it provides read/write REST msg body (JSON & XML) direct
to NormalizedNodeContext. So we have to replace all places
where we use StructuredData, CompositeNode, NodeWrapper and
all relevant REST codecs (e.g. XmlToCompositeNodeProvider...)

Change-Id: I33ff24e5a8de2876dfdb6ea263fc9cb659fc3db8
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
12 files changed:
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/gson/JsonParser.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonToCompositeNodeProvider.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonToCompositeNodeReader.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/StructuredDataToJsonProvider.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/StructuredDataToXmlProvider.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlToCompositeNodeProvider.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlToCompositeNodeReader.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/CompositeNodeWrapper.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/EmptyNodeWrapper.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/NodeWrapper.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/SimpleNodeWrapper.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/StructuredData.java

index a784be2adca3128cfc74134a3dcd9267528f5538..699aed66d7bcd3b62398831946a98b509420fb82 100644 (file)
@@ -22,31 +22,34 @@ import java.io.EOFException;
 import java.io.IOException;
 
 /**
+ * @deprecated class will be removed in Lithium release
+ *
  * This class parses JSON elements from a gson JsonReader. It disallows multiple elements of the same name unlike the
  * default gson JsonParser."
  */
+@Deprecated
 public class JsonParser {
-    public JsonElement parse(JsonReader reader) throws JsonIOException, JsonSyntaxException {
+    public JsonElement parse(final JsonReader reader) throws JsonIOException, JsonSyntaxException {
         // code copied from gson's JsonParser and Stream classes
 
-        boolean lenient = reader.isLenient();
+        final boolean lenient = reader.isLenient();
         reader.setLenient(true);
         boolean isEmpty = true;
         try {
             reader.peek();
             isEmpty = false;
             return read(reader);
-        } catch (EOFException e) {
+        } catch (final EOFException e) {
             if (isEmpty) {
                 return JsonNull.INSTANCE;
             }
             // The stream ended prematurely so it is likely a syntax error.
             throw new JsonSyntaxException(e);
-        } catch (MalformedJsonException e) {
+        } catch (final MalformedJsonException e) {
             throw new JsonSyntaxException(e);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw new JsonIOException(e);
-        } catch (NumberFormatException e) {
+        } catch (final NumberFormatException e) {
             throw new JsonSyntaxException(e);
         } catch (StackOverflowError | OutOfMemoryError e) {
             throw new JsonParseException("Failed parsing JSON source: " + reader + " to Json", e);
@@ -55,12 +58,12 @@ public class JsonParser {
         }
     }
 
-    public JsonElement read(JsonReader in) throws IOException {
+    public JsonElement read(final JsonReader in) throws IOException {
         switch (in.peek()) {
         case STRING:
             return new JsonPrimitive(in.nextString());
         case NUMBER:
-            String number = in.nextString();
+            final String number = in.nextString();
             return new JsonPrimitive(new LazilyParsedNumber(number));
         case BOOLEAN:
             return new JsonPrimitive(in.nextBoolean());
@@ -68,7 +71,7 @@ public class JsonParser {
             in.nextNull();
             return JsonNull.INSTANCE;
         case BEGIN_ARRAY:
-            JsonArray array = new JsonArray();
+            final JsonArray array = new JsonArray();
             in.beginArray();
             while (in.hasNext()) {
                 array.add(read(in));
@@ -76,7 +79,7 @@ public class JsonParser {
             in.endArray();
             return array;
         case BEGIN_OBJECT:
-            JsonObject object = new JsonObject();
+            final JsonObject object = new JsonObject();
             in.beginObject();
             while (in.hasNext()) {
                 final String childName = in.nextName();
index caff848180e84400c5a810bfd1939da1e295a22c..6863b964d47f42bccbd3a7f084e17aad03b5dc68 100644 (file)
@@ -26,6 +26,9 @@ import org.opendaylight.yangtools.yang.data.api.Node;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
 @Provider
 @Consumes({ Draft02.MediaTypes.DATA + RestconfService.JSON, Draft02.MediaTypes.OPERATION + RestconfService.JSON,
         MediaType.APPLICATION_JSON })
@@ -47,7 +50,7 @@ public enum JsonToCompositeNodeProvider implements MessageBodyReader<Node<?>> {
             WebApplicationException {
         try {
             return JsonToCompositeNodeReader.read(entityStream);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.debug("Error parsing json input", e);
 
             throw new RestconfDocumentedException("Error parsing input: " + e.getMessage(), ErrorType.PROTOCOL,
index 552e2bbd190d154280e1a8ce7a3bc22d89de908b..2834fa15c1fee42df91917b0b3a39193abb51639 100644 (file)
@@ -28,6 +28,10 @@ import org.opendaylight.controller.sal.restconf.impl.SimpleNodeWrapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
+@Deprecated
 class JsonToCompositeNodeReader {
     private static final Logger LOG = LoggerFactory.getLogger(JsonToCompositeNodeReader.class);
     private static final Splitter COLON_SPLITTER = Splitter.on(':');
@@ -37,9 +41,9 @@ class JsonToCompositeNodeReader {
     }
 
     public static CompositeNodeWrapper read(final InputStream entityStream) throws UnsupportedFormatException {
-        JsonParser parser = new JsonParser();
+        final JsonParser parser = new JsonParser();
 
-        JsonElement rootElement = parser.parse(new JsonReader(new InputStreamReader(entityStream)));
+        final JsonElement rootElement = parser.parse(new JsonReader(new InputStreamReader(entityStream)));
         if (rootElement.isJsonNull()) {
             // no content, so return null to indicate no input
             return null;
@@ -49,14 +53,14 @@ class JsonToCompositeNodeReader {
             throw new UnsupportedFormatException("Root element of Json has to be Object");
         }
 
-        Set<Entry<String, JsonElement>> entrySetsOfRootJsonObject = rootElement.getAsJsonObject().entrySet();
+        final Set<Entry<String, JsonElement>> entrySetsOfRootJsonObject = rootElement.getAsJsonObject().entrySet();
         if (entrySetsOfRootJsonObject.size() != 1) {
             throw new UnsupportedFormatException("Json Object should contain one element");
         }
 
-        Entry<String, JsonElement> childEntry = entrySetsOfRootJsonObject.iterator().next();
-        String firstElementName = childEntry.getKey();
-        JsonElement firstElementType = childEntry.getValue();
+        final Entry<String, JsonElement> childEntry = entrySetsOfRootJsonObject.iterator().next();
+        final String firstElementName = childEntry.getKey();
+        final JsonElement firstElementType = childEntry.getValue();
         if (firstElementType.isJsonObject()) {
             // container in yang
             return createStructureWithRoot(firstElementName, firstElementType.getAsJsonObject());
@@ -64,7 +68,7 @@ class JsonToCompositeNodeReader {
         if (firstElementType.isJsonArray()) {
             // list in yang
             if (firstElementType.getAsJsonArray().size() == 1) {
-                JsonElement firstElementInArray = firstElementType.getAsJsonArray().get(0);
+                final JsonElement firstElementInArray = firstElementType.getAsJsonArray().get(0);
                 if (firstElementInArray.isJsonObject()) {
                     return createStructureWithRoot(firstElementName, firstElementInArray.getAsJsonObject());
                 }
@@ -77,9 +81,9 @@ class JsonToCompositeNodeReader {
     }
 
     private static CompositeNodeWrapper createStructureWithRoot(final String rootObjectName, final JsonObject rootObject) {
-        CompositeNodeWrapper firstNode = new CompositeNodeWrapper(getNamespaceFor(rootObjectName),
+        final CompositeNodeWrapper firstNode = new CompositeNodeWrapper(getNamespaceFor(rootObjectName),
                 getLocalNameFor(rootObjectName));
-        for (Entry<String, JsonElement> childOfFirstNode : rootObject.entrySet()) {
+        for (final Entry<String, JsonElement> childOfFirstNode : rootObject.entrySet()) {
             addChildToParent(childOfFirstNode.getKey(), childOfFirstNode.getValue(), firstNode);
         }
         return firstNode;
@@ -88,10 +92,10 @@ class JsonToCompositeNodeReader {
     private static void addChildToParent(final String childName, final JsonElement childType,
             final CompositeNodeWrapper parent) {
         if (childType.isJsonObject()) {
-            CompositeNodeWrapper child = new CompositeNodeWrapper(getNamespaceFor(childName),
+            final CompositeNodeWrapper child = new CompositeNodeWrapper(getNamespaceFor(childName),
                     getLocalNameFor(childName));
             parent.addValue(child);
-            for (Entry<String, JsonElement> childOfChild : childType.getAsJsonObject().entrySet()) {
+            for (final Entry<String, JsonElement> childOfChild : childType.getAsJsonObject().entrySet()) {
                 addChildToParent(childOfChild.getKey(), childOfChild.getValue(), child);
             }
         } else if (childType.isJsonArray()) {
@@ -99,13 +103,13 @@ class JsonToCompositeNodeReader {
                 parent.addValue(new EmptyNodeWrapper(getNamespaceFor(childName), getLocalNameFor(childName)));
 
             } else {
-                for (JsonElement childOfChildType : childType.getAsJsonArray()) {
+                for (final JsonElement childOfChildType : childType.getAsJsonArray()) {
                     addChildToParent(childName, childOfChildType, parent);
                 }
             }
         } else if (childType.isJsonPrimitive()) {
-            JsonPrimitive childPrimitive = childType.getAsJsonPrimitive();
-            String value = childPrimitive.getAsString().trim();
+            final JsonPrimitive childPrimitive = childType.getAsJsonPrimitive();
+            final String value = childPrimitive.getAsString().trim();
             parent.addValue(new SimpleNodeWrapper(getNamespaceFor(childName), getLocalNameFor(childName),
                     resolveValueOfElement(value)));
         } else {
@@ -133,7 +137,7 @@ class JsonToCompositeNodeReader {
             if (Iterators.size(it) == 1) {
                 try {
                     return URI.create(maybeURI);
-                } catch (IllegalArgumentException e) {
+                } catch (final IllegalArgumentException e) {
                     LOG.debug("Value {} couldn't be interpreted as URI.", maybeURI);
                 }
             }
@@ -153,14 +157,14 @@ class JsonToCompositeNodeReader {
     private static Object resolveValueOfElement(final String value) {
         // it could be instance-identifier Built-In Type
         if (!value.isEmpty() && value.charAt(0) == '/') {
-            IdentityValuesDTO resolvedValue = RestUtil.asInstanceIdentifier(value, new PrefixMapingFromJson());
+            final IdentityValuesDTO resolvedValue = RestUtil.asInstanceIdentifier(value, new PrefixMapingFromJson());
             if (resolvedValue != null) {
                 return resolvedValue;
             }
         }
 
         // it could be identityref Built-In Type therefore it is necessary to look at value as module_name:local_name
-        URI namespace = getNamespaceFor(value);
+        final URI namespace = getNamespaceFor(value);
         if (namespace != null) {
             return new IdentityValuesDTO(namespace.toString(), getLocalNameFor(value), null, value);
         }
index 063d2f51afffdd0c7094d7363d95795182b5cd8e..13dbf266898e3260d7b6af7d0d056a98d9b20770 100644 (file)
@@ -28,6 +28,9 @@ import org.opendaylight.controller.sal.restconf.impl.StructuredData;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
 @Provider
 @Produces({ Draft02.MediaTypes.API + RestconfService.JSON, Draft02.MediaTypes.DATA + RestconfService.JSON,
     Draft02.MediaTypes.OPERATION + RestconfService.JSON, MediaType.APPLICATION_JSON })
@@ -48,19 +51,19 @@ public enum StructuredDataToJsonProvider implements MessageBodyWriter<Structured
     public void writeTo(final StructuredData t, final Class<?> type, final Type genericType, final Annotation[] annotations,
             final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream)
                     throws IOException, WebApplicationException {
-        CompositeNode data = t.getData();
+        final CompositeNode data = t.getData();
         if (data == null) {
             throw new RestconfDocumentedException(Response.Status.NOT_FOUND);
         }
 
-        JsonWriter writer = new JsonWriter(new OutputStreamWriter(entityStream, Charsets.UTF_8));
+        final JsonWriter writer = new JsonWriter(new OutputStreamWriter(entityStream, Charsets.UTF_8));
 
         if (t.isPrettyPrintMode()) {
             writer.setIndent("    ");
         } else {
             writer.setIndent("");
         }
-        JsonMapper jsonMapper = new JsonMapper(t.getMountPoint());
+        final JsonMapper jsonMapper = new JsonMapper(t.getMountPoint());
         jsonMapper.write(writer, data, (DataNodeContainer) t.getSchema());
         writer.flush();
     }
index 703a2a463476bcfd4704c34419cc17c73a6af3fc..fcb7b1de913fd95faab60c60f0ca28e869056e88 100644 (file)
@@ -37,6 +37,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
 @Provider
 @Produces({ Draft02.MediaTypes.API + RestconfService.XML, Draft02.MediaTypes.DATA + RestconfService.XML,
         Draft02.MediaTypes.OPERATION + RestconfService.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
@@ -51,7 +54,7 @@ public enum StructuredDataToXmlProvider implements MessageBodyWriter<StructuredD
             final Transformer ret;
             try {
                 ret = FACTORY.newTransformer();
-            } catch (TransformerConfigurationException e) {
+            } catch (final TransformerConfigurationException e) {
                 LOG.error("Failed to instantiate XML transformer", e);
                 throw new IllegalStateException("XML encoding currently unavailable", e);
             }
@@ -83,7 +86,7 @@ public enum StructuredDataToXmlProvider implements MessageBodyWriter<StructuredD
             final Annotation[] annotations, final MediaType mediaType,
             final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException,
             WebApplicationException {
-        CompositeNode data = t.getData();
+        final CompositeNode data = t.getData();
         if (data == null) {
             throw new RestconfDocumentedException(Response.Status.NOT_FOUND);
         }
@@ -96,7 +99,7 @@ public enum StructuredDataToXmlProvider implements MessageBodyWriter<StructuredD
             } else {
                 trans.setOutputProperty(OutputKeys.INDENT, "no");
             }
-        } catch (RuntimeException e) {
+        } catch (final RuntimeException e) {
             throw new RestconfDocumentedException(e.getMessage(), ErrorType.TRANSPORT, ErrorTag.OPERATION_FAILED);
         }
 
@@ -104,7 +107,7 @@ public enum StructuredDataToXmlProvider implements MessageBodyWriter<StructuredD
         final Document domTree = new XmlMapper().write(data, (DataNodeContainer) t.getSchema());
         try {
             trans.transform(new DOMSource(domTree), new StreamResult(entityStream));
-        } catch (TransformerException e) {
+        } catch (final TransformerException e) {
             LOG.error("Error during translation of Document to OutputStream", e);
             throw new RestconfDocumentedException(e.getMessage(), ErrorType.TRANSPORT, ErrorTag.OPERATION_FAILED);
         }
index d56a32e36ee084c7180b37e7d444f77fedded580..2ae8462e035ad2cbaff15ec6ee304dcc8fc1a671 100644 (file)
@@ -27,6 +27,9 @@ import org.opendaylight.yangtools.yang.data.api.Node;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
 @Provider
 @Consumes({ Draft02.MediaTypes.DATA + RestconfService.XML, Draft02.MediaTypes.OPERATION + RestconfService.XML,
         MediaType.APPLICATION_XML, MediaType.TEXT_XML })
@@ -42,9 +45,9 @@ public enum XmlToCompositeNodeProvider implements MessageBodyReader<Node<?>> {
 
     @Override
     public Node<?> readFrom(final Class<Node<?>> type, final Type genericType, final Annotation[] annotations,
-            MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
+            final MediaType mediaType, final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream)
             throws IOException, WebApplicationException {
-        XmlToCompositeNodeReader xmlReader = new XmlToCompositeNodeReader();
+        final XmlToCompositeNodeReader xmlReader = new XmlToCompositeNodeReader();
         try {
             return xmlReader.read(entityStream);
         } catch (XMLStreamException | UnsupportedFormatException e) {
index d71a12ff744c2b06b804a7d4a53487ec66739451..c9a09552adf331b85a123131733507abfcb629a5 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.sal.rest.impl;
 
 import static com.google.common.base.Preconditions.checkArgument;
-
 import java.io.BufferedInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -28,6 +27,9 @@ import org.opendaylight.controller.sal.restconf.impl.NodeWrapper;
 import org.opendaylight.controller.sal.restconf.impl.SimpleNodeWrapper;
 import org.opendaylight.yangtools.yang.data.api.Node;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
 @Deprecated
 public class XmlToCompositeNodeReader {
 
@@ -50,7 +52,7 @@ public class XmlToCompositeNodeReader {
 
         eventReader = xmlInputFactory.createXMLEventReader(entityStream);
         if (eventReader.hasNext()) {
-            XMLEvent element = eventReader.peek();
+            final XMLEvent element = eventReader.peek();
             if (element.isStartDocument()) {
                 eventReader.nextEvent();
             }
@@ -126,7 +128,7 @@ public class XmlToCompositeNodeReader {
     private boolean isSimpleNodeEvent(final XMLEvent event) throws XMLStreamException {
         checkArgument(event != null, "XML Event cannot be NULL!");
         if (event.isStartElement()) {
-            XMLEvent innerEvent = skipCommentsAndWhitespace();
+            final XMLEvent innerEvent = skipCommentsAndWhitespace();
             if (innerEvent != null && (innerEvent.isCharacters() || innerEvent.isEndElement())) {
                 return true;
             }
@@ -137,7 +139,7 @@ public class XmlToCompositeNodeReader {
     private boolean isCompositeNodeEvent(final XMLEvent event) throws XMLStreamException {
         checkArgument(event != null, "XML Event cannot be NULL!");
         if (event.isStartElement()) {
-            XMLEvent innerEvent = skipCommentsAndWhitespace();
+            final XMLEvent innerEvent = skipCommentsAndWhitespace();
             if (innerEvent != null) {
                 if (innerEvent.isStartElement()) {
                     return true;
@@ -149,14 +151,14 @@ public class XmlToCompositeNodeReader {
 
     private XMLEvent skipCommentsAndWhitespace() throws XMLStreamException {
         while (eventReader.hasNext()) {
-            XMLEvent event = eventReader.peek();
+            final XMLEvent event = eventReader.peek();
             if (event.getEventType() == XMLStreamConstants.COMMENT) {
                 eventReader.nextEvent();
                 continue;
             }
 
             if (event.isCharacters()) {
-                Characters chars = event.asCharacters();
+                final Characters chars = event.asCharacters();
                 if (chars.isWhiteSpace()) {
                     eventReader.nextEvent();
                     continue;
@@ -175,7 +177,7 @@ public class XmlToCompositeNodeReader {
     private NodeWrapper<? extends Node<?>> resolveSimpleNodeFromStartElement(final StartElement startElement)
             throws XMLStreamException {
         checkArgument(startElement != null, "Start Element cannot be NULL!");
-        String data = getValueOf(startElement);
+        final String data = getValueOf(startElement);
         if (data == null) {
             return new EmptyNodeWrapper(getNamespaceFor(startElement), getLocalNameFor(startElement));
         }
@@ -224,23 +226,23 @@ public class XmlToCompositeNodeReader {
     }
 
     private URI getNamespaceFor(final StartElement startElement) {
-        String namespaceURI = startElement.getName().getNamespaceURI();
+        final String namespaceURI = startElement.getName().getNamespaceURI();
         return namespaceURI.isEmpty() ? null : URI.create(namespaceURI);
     }
 
     private Object resolveValueOfElement(final String value, final StartElement startElement) {
         // it could be instance-identifier Built-In Type
         if (value.startsWith("/")) {
-            IdentityValuesDTO iiValue = RestUtil.asInstanceIdentifier(value, new RestUtil.PrefixMapingFromXml(
+            final IdentityValuesDTO iiValue = RestUtil.asInstanceIdentifier(value, new RestUtil.PrefixMapingFromXml(
                     startElement));
             if (iiValue != null) {
                 return iiValue;
             }
         }
         // it could be identityref Built-In Type
-        String[] namespaceAndValue = value.split(":");
+        final String[] namespaceAndValue = value.split(":");
         if (namespaceAndValue.length == 2) {
-            String namespace = startElement.getNamespaceContext().getNamespaceURI(namespaceAndValue[0]);
+            final String namespace = startElement.getNamespaceContext().getNamespaceURI(namespaceAndValue[0]);
             if (namespace != null && !namespace.isEmpty()) {
                 return new IdentityValuesDTO(namespace, namespaceAndValue[1], namespaceAndValue[0], value);
             }
index 206dbdeab60a20dff4d13f9fbd3c96c68ac45b4d..c3edfccb9885392e187e1a6b692312893d6057cb 100644 (file)
@@ -23,6 +23,10 @@ import org.opendaylight.yangtools.yang.data.api.Node;
 import org.opendaylight.yangtools.yang.data.api.SimpleNode;
 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
+@Deprecated
 public final class CompositeNodeWrapper implements NodeWrapper<CompositeNode>, CompositeNode {
 
     private MutableCompositeNode compositeNode;
@@ -102,8 +106,8 @@ public final class CompositeNodeWrapper implements NodeWrapper<CompositeNode>, C
                 name = new QName(namespace, localName);
             }
 
-            List<Node<?>> nodeValues = new ArrayList<>(values.size());
-            for (NodeWrapper<?> nodeWrapper : values) {
+            final List<Node<?>> nodeValues = new ArrayList<>(values.size());
+            for (final NodeWrapper<?> nodeWrapper : values) {
                 nodeValues.add(nodeWrapper.unwrap());
             }
             compositeNode = NodeFactory.createMutableCompositeNode(name, null, nodeValues, null, null);
index a3d44d3572106232e10edaad73e91d1b4d46039a..5a310e8af276811980617dd416b9b7cbe15c86d8 100644 (file)
@@ -15,6 +15,10 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.api.Node;
 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
+@Deprecated
 public final class EmptyNodeWrapper implements NodeWrapper<Node<?>>, Node<Void> {
 
     private Node<?> unwrapped;
index 9637a36268860e13e8ac296004089aed6c8ce825..09c7835ef6cf0a7b5cf637c9f3430ad566037aba 100644 (file)
@@ -11,6 +11,10 @@ import java.net.URI;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.Node;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
+@Deprecated
 public interface NodeWrapper<T extends Node<?>> {
 
     void setQname(QName name);
index 854e9635cf3cde883d97bbcc28f29c99bbda5c9c..2f50fd2ef5add3f2f3702b386d94c174b7ac4964 100644 (file)
@@ -16,6 +16,10 @@ import org.opendaylight.yangtools.yang.data.api.MutableSimpleNode;
 import org.opendaylight.yangtools.yang.data.api.SimpleNode;
 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
+@Deprecated
 public final class SimpleNodeWrapper implements NodeWrapper<SimpleNode<?>>, SimpleNode<Object> {
 
     private SimpleNode<Object> simpleNode;
index 29354349671943d2c3e67e16188c06ae9dd3bc55..be4ac992da76072db056d70db590327edb6c39ae 100644 (file)
@@ -11,6 +11,10 @@ import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 
+/**
+ * @deprecated class will be removed in Lithium release
+ */
+@Deprecated
 public class StructuredData {
 
     private final CompositeNode data;
@@ -27,7 +31,7 @@ public class StructuredData {
         this.data = data;
         this.schema = schema;
         this.mountPoint = mountPoint;
-        this.prettyPrintMode = preattyPrintMode;
+        prettyPrintMode = preattyPrintMode;
     }
 
     public CompositeNode getData() {