From: Tony Tkacik Date: Mon, 4 Aug 2014 17:46:39 +0000 (+0200) Subject: Fixed typo in restconf, which caused classcast in datastore. X-Git-Tag: release/helium~349 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=75ab6ca68d3af902bb48fdbd01df03214ff20454 Fixed typo in restconf, which caused classcast in datastore. Change-Id: I51eb1fc2e4056dc84feb3b720c3ee844ee4ffdea Signed-off-by: Tony Tkacik --- diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java index b55caa792e..5cb3cc2bae 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java @@ -95,7 +95,7 @@ public class RestconfImpl implements RestconfService { private String uriParameterName; - UriParameters(String uriParameterName) { + UriParameters(final String uriParameterName) { this.uriParameterName = uriParameterName; } @@ -282,7 +282,7 @@ public class RestconfImpl implements RestconfService { } private StructuredData operationsFromModulesToStructuredData(final Set modules, - final DOMMountPoint mountPoint, boolean prettyPrint) { + final DOMMountPoint mountPoint, final boolean prettyPrint) { final List> operationsAsData = new ArrayList>(); Module restconfModule = this.getRestconfModule(); final DataSchemaNode operationsSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode( @@ -576,7 +576,7 @@ public class RestconfImpl implements RestconfService { return null; } - private StructuredData callRpc(final RpcExecutor rpcExecutor, final CompositeNode payload, boolean prettyPrint) { + private StructuredData callRpc(final RpcExecutor rpcExecutor, final CompositeNode payload, final boolean prettyPrint) { if (rpcExecutor == null) { throw new RestconfDocumentedException("RPC does not exist.", ErrorType.RPC, ErrorTag.UNKNOWN_ELEMENT); } @@ -711,7 +711,7 @@ public class RestconfImpl implements RestconfService { return new StructuredData(prunedCompositeNode, iiWithData.getSchemaNode(), mountPoint, prettyPrintMode); } - private boolean parsePrettyPrintParameter(UriInfo info) { + private boolean parsePrettyPrintParameter(final UriInfo info) { String param = info.getQueryParameters(false).getFirst(UriParameters.PRETTY_PRINT.toString()); return Boolean.parseBoolean(param); } @@ -1009,7 +1009,7 @@ public class RestconfImpl implements RestconfService { return resolveAsEnum(classDescriptor, value); } - private T resolveAsEnum(Class classDescriptor, String value) { + private T resolveAsEnum(final Class classDescriptor, final String value) { T[] enumConstants = classDescriptor.getEnumConstants(); if (enumConstants != null) { for (T enm : classDescriptor.getEnumConstants()) { @@ -1021,7 +1021,7 @@ public class RestconfImpl implements RestconfService { return null; } - private Map resolveValuesFromUri(String uri) { + private Map resolveValuesFromUri(final String uri) { Map result = new HashMap<>(); String[] tokens = uri.split("/"); for (int i = 1; i < tokens.length; i++) { @@ -1410,7 +1410,7 @@ public class RestconfImpl implements RestconfService { } } - private CompositeNode datastoreNormalizedNodeToCompositeNode(NormalizedNode dataNode, DataSchemaNode schema) { + private CompositeNode datastoreNormalizedNodeToCompositeNode(final NormalizedNode dataNode, final DataSchemaNode schema) { Iterable> nodes = null; if (dataNode == null) { throw new RestconfDocumentedException(new RestconfError(ErrorType.APPLICATION, ErrorTag.DATA_MISSING, @@ -1442,14 +1442,14 @@ public class RestconfImpl implements RestconfService { "It wasn't possible to correctly interpret data.")); } - private NormalizedNode compositeNodeToDatastoreNormalizedNode(CompositeNode compNode, DataSchemaNode schema) { + private NormalizedNode compositeNodeToDatastoreNormalizedNode(final CompositeNode compNode, final DataSchemaNode schema) { List> lst = new ArrayList>(); lst.add(compNode); if (schema instanceof ContainerSchemaNode) { return CnSnToNormalizedNodeParserFactory.getInstance().getContainerNodeParser() .parse(lst, (ContainerSchemaNode) schema); } else if (schema instanceof ListSchemaNode) { - return CnSnToNormalizedNodeParserFactory.getInstance().getMapNodeParser() + return CnSnToNormalizedNodeParserFactory.getInstance().getMapEntryNodeParser() .parse(lst, (ListSchemaNode) schema); } @@ -1459,19 +1459,19 @@ public class RestconfImpl implements RestconfService { "It wasn't possible to translate specified data to datastore readable form.")); } - private InstanceIdWithSchemaNode normalizeInstanceIdentifierWithSchemaNode(InstanceIdWithSchemaNode iiWithSchemaNode) { + private InstanceIdWithSchemaNode normalizeInstanceIdentifierWithSchemaNode(final InstanceIdWithSchemaNode iiWithSchemaNode) { return normalizeInstanceIdentifierWithSchemaNode(iiWithSchemaNode, false); } private InstanceIdWithSchemaNode normalizeInstanceIdentifierWithSchemaNode( - InstanceIdWithSchemaNode iiWithSchemaNode, boolean unwrapLastListNode) { + final InstanceIdWithSchemaNode iiWithSchemaNode, final boolean unwrapLastListNode) { return new InstanceIdWithSchemaNode(instanceIdentifierToReadableFormForNormalizeNode( iiWithSchemaNode.getInstanceIdentifier(), unwrapLastListNode), iiWithSchemaNode.getSchemaNode(), iiWithSchemaNode.getMountPoint()); } - private YangInstanceIdentifier instanceIdentifierToReadableFormForNormalizeNode(YangInstanceIdentifier instIdentifier, - boolean unwrapLastListNode) { + private YangInstanceIdentifier instanceIdentifierToReadableFormForNormalizeNode(final YangInstanceIdentifier instIdentifier, + final boolean unwrapLastListNode) { Preconditions.checkNotNull(instIdentifier, "Instance identifier can't be null"); final List result = new ArrayList(); final Iterator iter = instIdentifier.getPathArguments().iterator();