Remove redundant code constructs
[netconf.git] / netconf / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / netconf / LibraryModulesSchemas.java
index 9e62919cf688852953d57c428f2e363d22262c31..261ba28d2978f9169c36cfdbf63253783be6d1b8 100644 (file)
@@ -47,8 +47,8 @@ import org.opendaylight.netconf.sal.connect.api.NetconfDeviceSchemas;
 import org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDeviceRpc;
 import org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.ModulesState;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160409.module.list.Module;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.ModulesState;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.Module;
 import org.opendaylight.yangtools.util.xml.UntrustedXML;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.Revision;
@@ -88,7 +88,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
     static {
         final ModuleInfoBackedContext moduleInfoBackedContext = ModuleInfoBackedContext.create();
         moduleInfoBackedContext.registerModuleInfo(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang
-                .library.rev160409.$YangModuleInfoImpl.getInstance());
+                .library.rev160621.$YangModuleInfoImpl.getInstance());
         LIBRARY_CONTEXT = moduleInfoBackedContext.tryToCreateSchemaContext().get();
     }
 
@@ -146,7 +146,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
 
         } catch (final IOException e) {
             LOG.warn("Unable to download yang library from {}", url, e);
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
     }
 
@@ -163,13 +163,13 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
         } catch (final ExecutionException e) {
             LOG.warn("{}: Unable to detect available schemas, get to {} failed", deviceId,
                     MODULES_STATE_MODULE_LIST, e);
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
 
         if (moduleListNodeResult.getErrors().isEmpty() == false) {
             LOG.warn("{}: Unable to detect available schemas, get to {} failed, {}",
                     deviceId, MODULES_STATE_MODULE_LIST, moduleListNodeResult.getErrors());
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
 
 
@@ -182,7 +182,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
         }
 
         LOG.warn("{}: Unable to detect available schemas, get to {} was empty", deviceId, toId(ModulesState.QNAME));
-        return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+        return new LibraryModulesSchemas(Collections.emptyMap());
     }
 
     private static LibraryModulesSchemas create(final ContainerNode modulesStateNode) {
@@ -226,7 +226,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
 
         } catch (final IOException e) {
             LOG.warn("Unable to download yang library from {}", url, e);
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
     }
 
@@ -260,7 +260,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
                     contentType.equals("application/json") ? readJson(in) : readXml(in);
 
             if (!optionalModulesStateNode.isPresent()) {
-                return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+                return new LibraryModulesSchemas(Collections.emptyMap());
             }
 
             final NormalizedNode<?, ?> modulesStateNode = optionalModulesStateNode.get();
@@ -290,7 +290,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
             return new LibraryModulesSchemas(schemasMapping.build());
         } catch (final IOException e) {
             LOG.warn("Unable to download yang library from {}", connection.getURL(), e);
-            return new LibraryModulesSchemas(Collections.<QName, URL>emptyMap());
+            return new LibraryModulesSchemas(Collections.emptyMap());
         }
     }
 
@@ -382,7 +382,7 @@ public final class LibraryModulesSchemas implements NetconfDeviceSchemas {
                 : QName.create(URI.create(moduleNameSpace), moduleName);
 
         try {
-            return Optional.<Map.Entry<QName, URL>>of(new AbstractMap.SimpleImmutableEntry<>(
+            return Optional.of(new AbstractMap.SimpleImmutableEntry<>(
                     moduleQName, new URL(schemaUriAsString.get())));
         } catch (final MalformedURLException e) {
             LOG.warn("Skipping library schema for {}. URL {} representing yang schema resource is not valid",