Remove redundant code constructs 23/73923/2
authorJakub Morvay <jmorvay@frinx.io>
Wed, 11 Jul 2018 10:36:00 +0000 (12:36 +0200)
committerJakub Morvay <jmorvay@frinx.io>
Wed, 11 Jul 2018 13:34:56 +0000 (15:34 +0200)
- Remove redundant type arguments
- Remove redundant type casts

Change-Id: I943060df1f465ff019b62abd5e72bc9ff7bc8ef9
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
60 files changed:
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/CallHomeAuthorization.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/Lock.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/Unlock.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/get/AbstractGet.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/get/Get.java
netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/get/GetConfig.java
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducer.java
netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/controller/config/yang/netconf/mdsal/notification/CapabilityChangeNotificationProducerTest.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/DocumentedException.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/MissingNameSpaceException.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/UnexpectedElementException.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/UnexpectedNamespaceException.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/XmlElement.java
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/xml/XmlUtil.java
netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/SimpleNetconfClientSessionListener.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorFactoryTest.java
netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/TlsClientChannelInitializerTest.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/mapping/operations/DefaultCloseSession.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/ConcurrentClientsTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/MessageParserTest.java
netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/NetconfServerSessionListenerTest.java
netconf/netconf-monitoring/src/main/java/org/opendaylight/netconf/monitoring/osgi/NetconfMonitoringOperationService.java
netconf/netconf-monitoring/src/test/java/org/opendaylight/netconf/monitoring/GetTest.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfMessageToXMLEncoder.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/CreateSubscription.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/ops/NotificationsTransformUtil.java
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/osgi/Activator.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/LibraryModulesSchemas.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfStateSchemas.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfDeviceCommunicator.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/AbstractWriteTx.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfBaseOps.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NodeContainerProxy.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDeviceTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/schema/NetconfRemoteSchemaYangSourceProviderTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/NetconfMessageTransformerTest.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/MdsalOperationProvider.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/SimulatedOperationProvider.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/operations/OperationsProvider.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCommit.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedEditConfig.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedUnLock.java
netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibRestApp.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/BrokerFacade.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/ControllerContext.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/EventType.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/InvokeRpcMethodTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/JSONRestconfServiceImplTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPostOperationTest.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestPutConfigTest.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/PutDataTransactionUtil.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/ReadDataTransactionUtil.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/EventType.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JSONRestconfServiceRfc8040ImplTest.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/utils/mapping/RestconfMappingNodeUtilTest.java
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/BaseYangSwaggerGenerator.java

index 886021ed3c600d8da303fcd40201b91b42c64ef0..81d6c6fa75bedd843df58a5098bd166942295fa0 100644 (file)
@@ -165,7 +165,7 @@ public abstract class CallHomeAuthorization {
         @Override
         protected void applyTo(final ClientSession session) {
             Preconditions.checkArgument(session instanceof ClientSessionImpl);
-            ((ClientSessionImpl) session).setUsername(username);
+            session.setUsername(username);
 
             // First try authentication using server host keys, else try password.
             for (KeyPair keyPair : clientKeyPair) {
index c39c61891eb26b7265678861f73423403019b571..e1a6ff10c0fa947e7e319aaf9bb7ed03474e12d6 100644 (file)
@@ -40,7 +40,7 @@ public class Lock extends AbstractSingletonNetconfOperation {
         final Datastore targetDatastore = extractTargetParameter(operationElement);
         if (targetDatastore == Datastore.candidate) {
             LOG.debug("Locking candidate datastore on session: {}", getNetconfSessionIdForReporting());
-            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
         }
 
         throw new DocumentedException("Unable to lock " + targetDatastore + " datastore",
index 3b5eb3c7d55fad7122ac6edd73ae5ed59c6f4809..ed3e0b1ebc77888ec97f4174da33b84863f8b6b3 100644 (file)
@@ -39,7 +39,7 @@ public class Unlock extends AbstractSingletonNetconfOperation {
         final Datastore targetDatastore = Lock.extractTargetParameter(operationElement);
         if (targetDatastore == Datastore.candidate) {
             LOG.debug("Unlocking candidate datastore on session: {}", getNetconfSessionIdForReporting());
-            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
         }
 
         throw new DocumentedException("Unable to unlock " + targetDatastore + " datastore",
index 7624d1423657a4c1f9c6e65d7f161f59b8db690a..6ce25640eacac864ad1762c3de5e9420fc3a7419 100644 (file)
@@ -180,7 +180,7 @@ public abstract class AbstractGet extends AbstractSingletonNetconfOperation {
 
             return sourceElement.isPresent()
                     ? Optional.of(Datastore.valueOf(sourceElement.get().getOnlyChildElement().getName()))
-                    : Optional.<Datastore>absent();
+                    : Optional.absent();
         }
 
         private static void validateInputRpc(final XmlElement xml, final String operationName) throws
index 603e6d4d031f3dd50857373cf40a39efc8759816..2bdfcb0694dc24930563b33dfad155e1d54b69c1 100644 (file)
@@ -48,7 +48,7 @@ public class Get extends AbstractGet {
 
         final Optional<YangInstanceIdentifier> dataRootOptional = getDataRootFromFilter(operationElement);
         if (!dataRootOptional.isPresent()) {
-            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
         }
 
         final YangInstanceIdentifier dataRoot = dataRootOptional.get();
@@ -60,7 +60,7 @@ public class Get extends AbstractGet {
             transactionProvider.abortRunningTransaction(rwTx);
 
             if (!normalizedNodeOptional.isPresent()) {
-                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.<String>absent());
+                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
             }
 
             return serializeNodeWithParentStructure(document, dataRoot, normalizedNodeOptional.get());
index 30b5079925e9eb768775a2ebd1045805e120a68d..ec3da5934a5dbe36be0341a3469146e225ab34f5 100644 (file)
@@ -57,7 +57,7 @@ public class GetConfig extends AbstractGet {
 
         final Optional<YangInstanceIdentifier> dataRootOptional = getDataRootFromFilter(operationElement);
         if (!dataRootOptional.isPresent()) {
-            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.<String>absent());
+            return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
         }
 
         final YangInstanceIdentifier dataRoot = dataRootOptional.get();
@@ -74,7 +74,7 @@ public class GetConfig extends AbstractGet {
             }
 
             if (!normalizedNodeOptional.isPresent()) {
-                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.<String>absent());
+                return XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
             }
 
             return serializeNodeWithParentStructure(document, dataRoot, normalizedNodeOptional.get());
index 8fab4c84fe102f73eb39112c806e330939e7cb9e..b3c6c97ea78c7fe30460c86a8705a2a040399dbc 100644 (file)
@@ -93,7 +93,7 @@ public final class CapabilityChangeNotificationProducer extends OperationalDatas
         netconfCapabilityChangeBuilder.setAddedCapability(ImmutableList.copyOf(added));
         netconfCapabilityChangeBuilder.setDeletedCapability(ImmutableList.copyOf(removed));
         // TODO modified should be computed ... but why ?
-        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.<Uri>emptyList());
+        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.emptyList());
         baseNotificationPublisherRegistration.onCapabilityChanged(netconfCapabilityChangeBuilder.build());
     }
 
index 5652af80ce7945a6114d5f25fe389903724a5ef0..b387c89e2e9b4976329af16712d8843c6b7a7b6c 100644 (file)
@@ -82,7 +82,7 @@ public class CapabilityChangeNotificationProducerTest {
         Map<InstanceIdentifier<?>, DataObject> createdData = Maps.newHashMap();
         createdData.put(capabilitiesIdentifier, newCapabilities);
         verifyDataTreeChange(DataObjectModification.ModificationType.WRITE, null, newCapabilities,
-                changedCapabilitesFrom(newCapabilitiesList, Collections.<Uri>emptyList()));
+                changedCapabilitesFrom(newCapabilitiesList, Collections.emptyList()));
     }
 
     @Test
@@ -128,7 +128,7 @@ public class CapabilityChangeNotificationProducerTest {
         netconfCapabilityChangeBuilder.setChangedBy(new ChangedByBuilder().setServerOrUser(
                 new ServerBuilder().setServer(true).build()).build());
 
-        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.<Uri>emptyList());
+        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.emptyList());
         netconfCapabilityChangeBuilder.setAddedCapability(added);
         netconfCapabilityChangeBuilder.setDeletedCapability(deleted);
 
index ec6b0606e932225aba41be86763b411a7bcf5a2f..15d4dfe443882b280f9a6f83db4d4db93b3ea9d5 100644 (file)
@@ -169,7 +169,7 @@ public class DocumentedException extends Exception {
 
     public DocumentedException(final String message, final ErrorType errorType, final ErrorTag errorTag,
             final ErrorSeverity errorSeverity) {
-        this(message, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public DocumentedException(final String message, final ErrorType errorType, final ErrorTag errorTag,
@@ -183,7 +183,7 @@ public class DocumentedException extends Exception {
 
     public DocumentedException(final String message, final Exception cause, final ErrorType errorType,
             final ErrorTag errorTag, final ErrorSeverity errorSeverity) {
-        this(message, cause, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, cause, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public DocumentedException(final String message, final Exception cause, final ErrorType errorType,
index d5ab5d0648b89af1ac8f96a1cb3b633b15f21daa..2f30154b93a3ffe1523a0e69a6f8e1785eecb307 100644 (file)
@@ -16,7 +16,7 @@ public class MissingNameSpaceException extends DocumentedException {
 
     public MissingNameSpaceException(final String message, final DocumentedException.ErrorType errorType,
             final DocumentedException.ErrorTag errorTag, final DocumentedException.ErrorSeverity errorSeverity) {
-        this(message, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public MissingNameSpaceException(final String message, final DocumentedException.ErrorType errorType,
index ec31b9e6150516de6ed9f2d0fbbab3038af779bd..f6eda4930a7db9977428e7c982c70f5e65cd66b1 100644 (file)
@@ -16,7 +16,7 @@ public class UnexpectedElementException extends DocumentedException {
 
     public UnexpectedElementException(final String message, final DocumentedException.ErrorType errorType,
             final DocumentedException.ErrorTag errorTag, final DocumentedException.ErrorSeverity errorSeverity) {
-        this(message, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public UnexpectedElementException(final String message, final DocumentedException.ErrorType errorType,
index 4152e261b3bd9e3d0a875bbb946069d0cca282ea..95e09a768a384b130f8135273c1cd00220eb40c7 100644 (file)
@@ -16,7 +16,7 @@ public class UnexpectedNamespaceException extends DocumentedException {
 
     public UnexpectedNamespaceException(final String message, final DocumentedException.ErrorType errorType,
             final DocumentedException.ErrorTag errorTag, final DocumentedException.ErrorSeverity errorSeverity) {
-        this(message, errorType, errorTag, errorSeverity, Collections.<String, String>emptyMap());
+        this(message, errorType, errorTag, errorSeverity, Collections.emptyMap());
     }
 
     public UnexpectedNamespaceException(final String message, final DocumentedException.ErrorType errorType,
index ad90fb3cb2d9ff20a21bbd614de82949b1863da5..9b0f5e3af7293d03fe752197e112be0a3155bfab 100644 (file)
@@ -470,7 +470,7 @@ public final class XmlElement {
     }
 
     public void checkUnrecognisedElements(final XmlElement... additionalRecognisedElements) throws DocumentedException {
-        checkUnrecognisedElements(Collections.<XmlElement>emptyList(), additionalRecognisedElements);
+        checkUnrecognisedElements(Collections.emptyList(), additionalRecognisedElements);
     }
 
     @Override
index a080889aee4352a7297fa0f17ee2a57d3e585dfb..d6d9f82f8a0f911ab1e0a6e4ce22f88474ee3391 100644 (file)
@@ -145,7 +145,7 @@ public final class XmlUtil {
             final String prefix, final String namespace, final String contentWithoutPrefix) {
 
         return createTextElementWithNamespacedContent(document, qname, prefix, namespace, contentWithoutPrefix,
-                Optional.<String>absent());
+                Optional.absent());
     }
 
     public static Element createTextElementWithNamespacedContent(final Document document, final String qname,
index 26f33152dac04473d3c065f1dcab9694ffae8ca2..ce1e5ef0a0541af78a131324987fc36f76a91cc4 100644 (file)
@@ -103,7 +103,7 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
     }
 
     public final synchronized Future<NetconfMessage> sendRequest(NetconfMessage message) {
-        final RequestEntry req = new RequestEntry(GlobalEventExecutor.INSTANCE.<NetconfMessage>newPromise(), message);
+        final RequestEntry req = new RequestEntry(GlobalEventExecutor.INSTANCE.newPromise(), message);
 
         requests.add(req);
         if (clientSession != null) {
index 718c67b7989106cd2fe2220a5c836812d243ac08..ca9eb2cefe38558209839386acc7e8058adf073c 100644 (file)
@@ -18,7 +18,6 @@ import io.netty.util.HashedWheelTimer;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
 import org.junit.Test;
-import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
 
@@ -33,7 +32,7 @@ public class NetconfClientSessionNegotiatorFactoryTest {
         Channel channel = mock(Channel.class);
         Promise<NetconfClientSession> promise = mock(Promise.class);
         NetconfClientSessionNegotiatorFactory negotiatorFactory = new NetconfClientSessionNegotiatorFactory(timer,
-                Optional.<NetconfHelloMessageAdditionalHeader>absent(), 200L);
+                Optional.absent(), 200L);
 
         SessionNegotiator<?> sessionNegotiator = negotiatorFactory.getSessionNegotiator(listenerFactory, channel,
                 promise);
index 0edc9550aa27c6e0bba0059460ad2e4f75b820a5..03ef147e7b8a92d4f23fd4ee7cda63baeee3d211 100644 (file)
@@ -18,7 +18,6 @@ import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
 import io.netty.util.concurrent.Promise;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
index 1a018363e513e8889a6facda9ed7dc6ce7bf2b63..194411f2d6b2d47c313c89d954ce823fd59e5327 100644 (file)
@@ -60,7 +60,7 @@ public class DefaultCloseSession extends AbstractSingletonNetconfOperation imple
                     DocumentedException.ErrorSeverity.ERROR, Collections.singletonMap(
                     DocumentedException.ErrorSeverity.ERROR.toString(), e.getMessage()));
         }
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     @Override
index c8dc4c3003fe092b603b858af8347bf037ba8ae6..5739488ff539213321caf5a7d9fa453879f29851 100644 (file)
@@ -241,7 +241,7 @@ class NetconfCapabilityMonitoringService implements CapabilityListener, AutoClos
         netconfCapabilityChangeBuilder.setAddedCapability(Lists.newArrayList(Collections2
                 .transform(added, CAPABILITY_TO_URI)));
         // TODO modified should be computed ... but why ?
-        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.<Uri>emptyList());
+        netconfCapabilityChangeBuilder.setModifiedCapability(Collections.emptyList());
         return netconfCapabilityChangeBuilder.build();
     }
 
index cfa1915e3e8303b6b69f34d6cb48663a852f6e08..4b8f8591dfd7c6a6b3e674fa41b995cd5f8dc6c6 100644 (file)
@@ -73,7 +73,6 @@ import org.opendaylight.netconf.nettyutil.handler.exi.NetconfStartExiMessage;
 import org.opendaylight.netconf.util.messages.NetconfMessageUtil;
 import org.opendaylight.netconf.util.test.XmlFileLoader;
 import org.opendaylight.protocol.framework.NeverReconnectStrategy;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.CapabilitiesBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -128,7 +127,7 @@ public class ConcurrentClientsTest {
 
         }).when(monitoring).registerCapabilitiesListener(any(NetconfMonitoringService.CapabilitiesListener.class));
         doReturn(sessionListener).when(monitoring).getSessionListener();
-        doReturn(new CapabilitiesBuilder().setCapability(Collections.<Uri>emptyList()).build()).when(monitoring)
+        doReturn(new CapabilitiesBuilder().setCapability(Collections.emptyList()).build()).when(monitoring)
                 .getCapabilities();
         return monitoring;
     }
index 0b07c774f250ef1db726c2a15b20ad016956f28b..a8e05a900a63554e409b95d0a2b5ae8ef082da3f 100644 (file)
@@ -86,7 +86,7 @@ public class MessageParserTest {
         }
         assertTrue(messages.isEmpty());
 
-        NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound();
+        NetconfMessage receivedMessage = testChunkChannel.readInbound();
         assertNotNull(receivedMessage);
         assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
     }
@@ -98,7 +98,7 @@ public class MessageParserTest {
                 new NetconfMessageToXMLEncoder(), new NetconfEOMAggregator(), new NetconfXMLToMessageDecoder());
 
         testChunkChannel.writeOutbound(this.msg);
-        ByteBuf recievedOutbound = (ByteBuf) testChunkChannel.readOutbound();
+        ByteBuf recievedOutbound = testChunkChannel.readOutbound();
 
         byte[] endOfMsgBytes = NetconfMessageConstants.END_OF_MESSAGE.getBytes(StandardCharsets.UTF_8);
         byte[] eom = new byte[endOfMsgBytes.length];
@@ -106,7 +106,7 @@ public class MessageParserTest {
         assertArrayEquals(endOfMsgBytes, eom);
 
         testChunkChannel.writeInbound(recievedOutbound);
-        NetconfMessage receivedMessage = (NetconfMessage) testChunkChannel.readInbound();
+        NetconfMessage receivedMessage = testChunkChannel.readInbound();
         assertNotNull(receivedMessage);
         assertXMLEqual(this.msg.getDocument(), receivedMessage.getDocument());
     }
index 493326281f08c9a91cf8c2f53192436c0dee5325..e7d5bb3e2daa4f3f6f5142bfae31401872c0f738 100644 (file)
@@ -99,7 +99,7 @@ public class NetconfServerSessionListenerTest {
         listener.onMessage(session, msg);
         verify(monitoringListener).onSessionEvent(argThat(sessionEventIs(SessionEvent.Type.IN_RPC_SUCCESS)));
         channel.runPendingTasks();
-        final NetconfMessage sentMsg = (NetconfMessage) channel.readOutbound();
+        final NetconfMessage sentMsg = channel.readOutbound();
         final Diff diff = XMLUnit.compareXML(reply, sentMsg.getDocument());
         Assert.assertTrue(diff.toString(), diff.similar());
     }
@@ -141,7 +141,7 @@ public class NetconfServerSessionListenerTest {
         verify(monitoringListener).onSessionEvent(argThat(sessionEventIs(SessionEvent.Type.IN_RPC_FAIL)));
         verify(monitoringListener).onSessionEvent(argThat(sessionEventIs(SessionEvent.Type.OUT_RPC_ERROR)));
         channel.runPendingTasks();
-        final NetconfMessage sentMsg = (NetconfMessage) channel.readOutbound();
+        final NetconfMessage sentMsg = channel.readOutbound();
         System.out.println(XmlUtil.toString(sentMsg.getDocument()));
         System.out.println(XmlUtil.toString(reply));
         final Diff diff = XMLUnit.compareXML(reply, sentMsg.getDocument());
index 6141babe16e568daa14add06bd0e5c8dcc78e8ed..7bdeac6af5c1c80ecb12a6e64cfde163f3b7a6eb 100644 (file)
@@ -26,7 +26,7 @@ public class NetconfMonitoringOperationService implements NetconfOperationServic
 
     @Override
     public Set<NetconfOperation> getNetconfOperations() {
-        return Sets.<NetconfOperation>newHashSet(new Get(monitor), new GetSchema(monitor));
+        return Sets.newHashSet(new Get(monitor), new GetSchema(monitor));
     }
 
     @Override
index 012d7291982a699e1835b325ea162a7758acb3ed..f295353ec6ca6be788868ddecf93ddcbbf769171 100644 (file)
@@ -28,8 +28,6 @@ import org.opendaylight.netconf.mapping.api.HandlingPriority;
 import org.opendaylight.netconf.mapping.api.NetconfOperationChainedExecution;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.SchemasBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.SessionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
 import org.w3c.dom.Document;
 
 public class GetTest {
@@ -54,9 +52,9 @@ public class GetTest {
         correctSubsequentResult = XmlUtil.readXmlToDocument("<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:"
                 + "1.0\"><data></data></rpc-reply>");
 
-        doReturn(new SessionsBuilder().setSession(Collections.<Session>emptyList()).build()).when(monitor)
+        doReturn(new SessionsBuilder().setSession(Collections.emptyList()).build()).when(monitor)
                 .getSessions();
-        doReturn(new SchemasBuilder().setSchema(Collections.<Schema>emptyList()).build()).when(monitor).getSchemas();
+        doReturn(new SchemasBuilder().setSchema(Collections.emptyList()).build()).when(monitor).getSchemas();
         doReturn(false).when(subsequentOperation).isExecutionTermination();
 
         get = new Get(monitor);
index 4135896b34d28361a4a9fd6f19d6e09864fccdcc..b6a26804fd3ca9879dd170e879cc509fd51e667a 100644 (file)
@@ -106,7 +106,7 @@ public abstract class AbstractNetconfSessionNegotiator<P extends NetconfSessionP
 
     private static Optional<SslHandler> getSslHandler(final Channel channel) {
         final SslHandler sslHandler = channel.pipeline().get(SslHandler.class);
-        return sslHandler == null ? Optional.<SslHandler>absent() : Optional.of(sslHandler);
+        return sslHandler == null ? Optional.absent() : Optional.of(sslHandler);
     }
 
     public P getSessionPreferences() {
index f033e0efe3406eb1f03edbdf323502e1018dbcfd..c7ab89d8c71d81008cf352c217e7e7eea12217a6 100644 (file)
@@ -31,7 +31,7 @@ public class NetconfMessageToXMLEncoder extends MessageToByteEncoder<NetconfMess
     private final Optional<String> clientId;
 
     public NetconfMessageToXMLEncoder() {
-        this(Optional.<String>absent());
+        this(Optional.absent());
     }
 
     public NetconfMessageToXMLEncoder(final Optional<String> clientId) {
index bc57f3c7a1c578306a3c1fba604a0b72962c8695..4023ece6dbd67311262e16961aeb4b70c3ad89a2 100644 (file)
@@ -219,7 +219,7 @@ public class AsyncSshHandlerTest {
             public void onSuccess(final SshFutureListener<IoReadFuture> result) {
                 doReturn(new IllegalStateException()).when(mockedReadFuture).getException();
                 doReturn(mockedReadFuture).when(mockedReadFuture)
-                        .removeListener(Matchers.<SshFutureListener<IoReadFuture>>any());
+                        .removeListener(Matchers.any());
                 doReturn(true).when(asyncOut).isClosing();
                 doReturn(true).when(asyncOut).isClosed();
                 result.operationComplete(mockedReadFuture);
@@ -250,7 +250,7 @@ public class AsyncSshHandlerTest {
             public void onSuccess(final SshFutureListener<IoReadFuture> result) {
                 doReturn(new IllegalStateException()).when(mockedReadFuture).getException();
                 doReturn(mockedReadFuture).when(mockedReadFuture)
-                        .removeListener(Matchers.<SshFutureListener<IoReadFuture>>any());
+                        .removeListener(Matchers.any());
                 result.operationComplete(mockedReadFuture);
             }
         }, MoreExecutors.directExecutor());
@@ -493,7 +493,7 @@ public class AsyncSshHandlerTest {
     private static IoOutputStream getMockedIoOutputStream() {
         final IoOutputStream mock = mock(IoOutputStream.class);
         final IoWriteFuture ioWriteFuture = mock(IoWriteFuture.class);
-        doReturn(ioWriteFuture).when(ioWriteFuture).addListener(Matchers.<SshFutureListener<IoWriteFuture>>any());
+        doReturn(ioWriteFuture).when(ioWriteFuture).addListener(Matchers.any());
         doReturn(true).when(ioWriteFuture).isWritten();
 
         Futures.addCallback(stubAddListener(ioWriteFuture), new SuccessFutureListener<IoWriteFuture>() {
@@ -513,10 +513,10 @@ public class AsyncSshHandlerTest {
         final IoInputStream mock = mock(IoInputStream.class);
         final IoReadFuture ioReadFuture = mock(IoReadFuture.class);
         doReturn(null).when(ioReadFuture).getException();
-        doReturn(ioReadFuture).when(ioReadFuture).removeListener(Matchers.<SshFutureListener<IoReadFuture>>any());
+        doReturn(ioReadFuture).when(ioReadFuture).removeListener(Matchers.any());
         doReturn(5).when(ioReadFuture).getRead();
         doReturn(new ByteArrayBuffer(new byte[]{0, 1, 2, 3, 4})).when(ioReadFuture).getBuffer();
-        doReturn(ioReadFuture).when(ioReadFuture).addListener(Matchers.<SshFutureListener<IoReadFuture>>any());
+        doReturn(ioReadFuture).when(ioReadFuture).addListener(Matchers.any());
 
         // Always success for read
         Futures.addCallback(stubAddListener(ioReadFuture), new SuccessFutureListener<IoReadFuture>() {
index 9860de76bbc73ebed93d2ab1ddd5e11b0f5cba8a..b0d9cf75baae8599de5cd0722d642b96e4d91fae 100644 (file)
@@ -89,7 +89,7 @@ public class CreateSubscription extends AbstractSingletonNetconfOperation
                 .registerNotificationListener(streamNameType, new NotificationSubscription(netconfSession, filter));
         subscriptions.add(notificationListenerRegistration);
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     private static StreamNameType parseStreamIfPresent(final XmlElement operationElement) throws DocumentedException {
index d2fdaaddb77ccef5627e0cae32265b7da397c3aa..ade7a3564810cdb45a19dfab2891a203c5b09258 100644 (file)
@@ -77,7 +77,7 @@ public final class NotificationsTransformUtil {
      * Transform base notification for capabilities into NetconfNotification.
      */
     public static NetconfNotification transform(final Notification notification, SchemaPath path) {
-        return transform(notification, Optional.<Date>absent(), path);
+        return transform(notification, Optional.absent(), path);
     }
 
     public static NetconfNotification transform(final Notification notification,
index 21b7d0d83d6bd9fc1f999a594fddbe1522a9763a..6724d10f14a15269cdfc5f56c755a200e6b4cd84 100644 (file)
@@ -52,7 +52,7 @@ public class Activator implements BundleActivator {
         final NetconfOperationServiceFactory netconfOperationServiceFactory = new NetconfOperationServiceFactory() {
 
             private final Set<Capability> capabilities =
-                    Collections.<Capability>singleton(new BasicCapability(NetconfNotification.NOTIFICATION_NAMESPACE));
+                    Collections.singleton(new BasicCapability(NetconfNotification.NOTIFICATION_NAMESPACE));
 
             @Override
             public Set<Capability> getCapabilities() {
@@ -61,8 +61,8 @@ public class Activator implements BundleActivator {
 
             @Override
             public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
-                listener.onCapabilitiesChanged(capabilities, Collections.<Capability>emptySet());
-                return () -> listener.onCapabilitiesChanged(Collections.<Capability>emptySet(), capabilities);
+                listener.onCapabilitiesChanged(capabilities, Collections.emptySet());
+                return () -> listener.onCapabilitiesChanged(Collections.emptySet(), capabilities);
             }
 
             @Override
@@ -74,7 +74,7 @@ public class Activator implements BundleActivator {
 
                     @Override
                     public Set<NetconfOperation> getNetconfOperations() {
-                        return Sets.<NetconfOperation>newHashSet(
+                        return Sets.newHashSet(
                                 new Get(netconfSessionIdForReporting, netconfNotificationManager),
                                 createSubscription);
                     }
index 590996ea19dd9f939b3dadfb695b1e81c41e2af5..261ba28d2978f9169c36cfdbf63253783be6d1b8 100644 (file)
@@ -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",
index 822a43a22aace8b4706faf479fb3152193620b3c..5083b2edc04cf7d850cee6cffede1ddf8823b45b 100644 (file)
@@ -55,7 +55,7 @@ public final class NetconfStateSchemas implements NetconfDeviceSchemas {
 
     private static final Logger LOG = LoggerFactory.getLogger(NetconfStateSchemas.class);
 
-    public static final NetconfStateSchemas EMPTY = new NetconfStateSchemas(Collections.<RemoteYangSchema>emptySet());
+    public static final NetconfStateSchemas EMPTY = new NetconfStateSchemas(Collections.emptySet());
 
     private static final YangInstanceIdentifier STATE_SCHEMAS_IDENTIFIER =
             YangInstanceIdentifier.builder().node(NetconfState.QNAME).node(Schemas.QNAME).build();
index 0e240dde64d74b728da856540d8f57c0f71a96bb..7968fcda978255007baaf65ce23cecea3826f541 100644 (file)
@@ -86,7 +86,7 @@ public class NetconfDeviceCommunicator
             final RemoteDeviceId id,
             final RemoteDevice<NetconfSessionPreferences, NetconfMessage, NetconfDeviceCommunicator> remoteDevice,
             final int rpcMessageLimit) {
-        this(id, remoteDevice, Optional.<UserPreferences>absent(), rpcMessageLimit);
+        this(id, remoteDevice, Optional.absent(), rpcMessageLimit);
     }
 
     private NetconfDeviceCommunicator(
index 6e3b0554c64e1cd68c6bfcdd2d8fd299bda73f43..eb48fdbd96ba56f49e372172855823758bf7ffee 100644 (file)
@@ -107,9 +107,9 @@ public abstract class AbstractWriteTx implements DOMDataWriteTransaction {
         }
 
         final DataContainerChild<?, ?> editStructure =
-                netOps.createEditConfigStrcture(Optional.<NormalizedNode<?, ?>>fromNullable(data),
+                netOps.createEditConfigStrcture(Optional.fromNullable(data),
                         Optional.of(ModifyAction.REPLACE), path);
-        editConfig(path, Optional.fromNullable(data), editStructure, Optional.<ModifyAction>absent(), "put");
+        editConfig(path, Optional.fromNullable(data), editStructure, Optional.absent(), "put");
     }
 
     @Override
@@ -125,9 +125,9 @@ public abstract class AbstractWriteTx implements DOMDataWriteTransaction {
         }
 
         final DataContainerChild<?, ?> editStructure =
-                netOps.createEditConfigStrcture(Optional.<NormalizedNode<?, ?>>fromNullable(data),
-                        Optional.<ModifyAction>absent(), path);
-        editConfig(path, Optional.fromNullable(data), editStructure, Optional.<ModifyAction>absent(), "merge");
+                netOps.createEditConfigStrcture(Optional.fromNullable(data),
+                        Optional.absent(), path);
+        editConfig(path, Optional.fromNullable(data), editStructure, Optional.absent(), "merge");
     }
 
     /**
@@ -144,9 +144,9 @@ public abstract class AbstractWriteTx implements DOMDataWriteTransaction {
     public synchronized void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
         checkEditable(store);
         final DataContainerChild<?, ?> editStructure =
-                netOps.createEditConfigStrcture(Optional.<NormalizedNode<?, ?>>absent(),
+                netOps.createEditConfigStrcture(Optional.absent(),
                         Optional.of(ModifyAction.DELETE), path);
-        editConfig(path, Optional.<NormalizedNode<?, ?>>absent(),
+        editConfig(path, Optional.absent(),
                 editStructure, Optional.of(ModifyAction.NONE), "delete");
     }
 
index 2c055b9cf18a4349b0b82862d25a4ffe97792b89..6218f59cb81fffd822e7cbdba1b7ca37f63196df 100644 (file)
@@ -257,7 +257,7 @@ public final class NetconfBaseOps {
     public ListenableFuture<DOMRpcResult> editConfigCandidate(final FutureCallback<? super DOMRpcResult> callback,
                                                               final DataContainerChild<?, ?> editStructure,
                                                               final boolean rollback) {
-        return editConfig(callback, NETCONF_CANDIDATE_QNAME, editStructure, Optional.<ModifyAction>absent(), rollback);
+        return editConfig(callback, NETCONF_CANDIDATE_QNAME, editStructure, Optional.absent(), rollback);
     }
 
     public ListenableFuture<DOMRpcResult> editConfigRunning(final FutureCallback<? super DOMRpcResult> callback,
@@ -269,7 +269,7 @@ public final class NetconfBaseOps {
     public ListenableFuture<DOMRpcResult> editConfigRunning(final FutureCallback<? super DOMRpcResult> callback,
                                                             final DataContainerChild<?, ?> editStructure,
                                                             final boolean rollback) {
-        return editConfig(callback, NETCONF_RUNNING_QNAME, editStructure, Optional.<ModifyAction>absent(), rollback);
+        return editConfig(callback, NETCONF_RUNNING_QNAME, editStructure, Optional.absent(), rollback);
     }
 
     public ListenableFuture<DOMRpcResult> editConfig(
index 2a0830658dc8d324eb04fd868ef51f744516f425..da65e5595934cc2655da5532c760a314e5371f45 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.netconf.sal.connect.netconf.util;
 
-import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
@@ -58,7 +57,7 @@ public final class NodeContainerProxy implements ContainerSchemaNode {
     }
 
     private static Map<QName, DataSchemaNode> asMap(final Collection<DataSchemaNode> childNodes) {
-        return Maps.uniqueIndex(childNodes, (Function<DataSchemaNode, QName>) DataSchemaNode::getQName);
+        return Maps.uniqueIndex(childNodes, DataSchemaNode::getQName);
     }
 
     @Override
index 3cc5c74a9fb44746efddbee52e6461bb0b801283..3618bf67d341a3f6d5519aaf840d689c1d0cf26e 100644 (file)
@@ -61,7 +61,6 @@ import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.ModuleImport;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException;
@@ -178,7 +177,7 @@ public class NetconfDeviceTest {
         // Make fallback attempt to fail due to empty resolved sources
         final SchemaResolutionException schemaResolutionException
                 = new SchemaResolutionException("fail first",
-                Collections.<SourceIdentifier>emptyList(), HashMultimap.<SourceIdentifier, ModuleImport>create());
+                Collections.emptyList(), HashMultimap.create());
         doReturn(Futures.immediateFailedFuture(schemaResolutionException))
                 .when(schemaFactory).createSchemaContext(anyCollectionOf(SourceIdentifier.class));
 
index edf7b96f307a1e925188807dd1a238dcf6cd8d4b..6b85cd1fc88f5f9ff3b6486572326373e3a9d32c 100644 (file)
@@ -32,7 +32,6 @@ import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.yangtools.util.xml.UntrustedXML;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.Revision;
-import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -56,7 +55,7 @@ public class NetconfRemoteSchemaYangSourceProviderTest {
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks(this);
 
-        final DOMRpcResult value = new DefaultDOMRpcResult(getNode(), Collections.<RpcError>emptySet());
+        final DOMRpcResult value = new DefaultDOMRpcResult(getNode(), Collections.emptySet());
         CheckedFuture<DOMRpcResult, DOMRpcException> response = Futures.immediateCheckedFuture(value);
         doReturn(response).when(service).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
 
index 5ddbfa5c2a20d64827d551f8609b3e88f709c57f..a884a887f209f8f244dd8daad51bd39f691a6f90 100644 (file)
@@ -58,17 +58,14 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.mon
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Schemas;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.schemas.Schema;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.ModifyAction;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
 
 public class NetconfMessageTransformerTest {
@@ -165,7 +162,7 @@ public class NetconfMessageTransformerTest {
         assertNotNull(compositeNodeRpcResult.getResult());
         final DOMSource schemaContent =
             ((AnyXmlNode) ((ContainerNode) compositeNodeRpcResult.getResult()).getValue().iterator().next()).getValue();
-        assertThat(((Element) schemaContent.getNode()).getTextContent(),
+        assertThat(schemaContent.getNode().getTextContent(),
                 CoreMatchers.containsString("Random YANG SCHEMA"));
     }
 
@@ -261,7 +258,7 @@ public class NetconfMessageTransformerTest {
                 .nodeWithKey(Schema.QNAME, keys).build();
         final DataContainerChild<?, ?> editConfigStructure =
                 createEditConfigStructure(BaseSchema.BASE_NETCONF_CTX_WITH_NOTIFICATIONS.getSchemaContext(), id,
-                        Optional.<ModifyAction>absent(), Optional.<NormalizedNode<?, ?>>fromNullable(schemaNode));
+                        Optional.absent(), Optional.fromNullable(schemaNode));
 
         final DataContainerChild<?, ?> target = NetconfBaseOps.getTargetNode(NETCONF_CANDIDATE_QNAME);
 
index afece1b190195919783e49555ddfd40efe173e86..660f67fe80938af1899d500a777e66fb3afbdaf1 100644 (file)
@@ -88,7 +88,7 @@ class MdsalOperationProvider implements NetconfOperationServiceFactory {
     @Override
     public AutoCloseable registerCapabilityListener(
             final CapabilityListener listener) {
-        listener.onCapabilitiesChanged(caps, Collections.<Capability>emptySet());
+        listener.onCapabilitiesChanged(caps, Collections.emptySet());
         return () -> {
         };
     }
@@ -153,7 +153,7 @@ class MdsalOperationProvider implements NetconfOperationServiceFactory {
             final DiscardChanges discardChanges = new DiscardChanges(
                 String.valueOf(currentSessionId), transactionProvider);
 
-            return Sets.<NetconfOperation>newHashSet(get, getConfig,
+            return Sets.newHashSet(get, getConfig,
                     editConfig, commit, lock, unLock, discardChanges);
         }
 
index b49f39998b8222b269e4a1a6bad7a49aeaa7eb20..f2828d1eeda304e03a6c5ad0b85a9cd8cccf600d 100644 (file)
@@ -50,7 +50,7 @@ class SimulatedOperationProvider implements NetconfOperationServiceFactory {
     @Override
     public AutoCloseable registerCapabilityListener(
             final CapabilityListener listener) {
-        listener.onCapabilitiesChanged(caps, Collections.<Capability>emptySet());
+        listener.onCapabilitiesChanged(caps, Collections.emptySet());
         return () -> {
         };
     }
index b93f59a41fbfe6b6a0ca85c0d907a14e64b6b98c..15ae253007b902bf53829a1f31db65e4460267b6 100644 (file)
@@ -44,7 +44,7 @@ public class OperationsProvider implements NetconfOperationServiceFactory {
     @Override
     public AutoCloseable registerCapabilityListener(
         final CapabilityListener listener) {
-        listener.onCapabilitiesChanged(caps, Collections.<Capability>emptySet());
+        listener.onCapabilitiesChanged(caps, Collections.emptySet());
         return () -> {
         };
     }
index 4276e5fb2f52c01a0ffa462b799b1fdc2e19a171..ad647f667fc5038df0a3298212dad1658f710ac6 100644 (file)
@@ -26,7 +26,7 @@ public class SimulatedCommit extends AbstractLastNetconfOperation {
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
             throws DocumentedException {
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     @Override
index c6f7fac0db34e99026e3a9e2c9ec82c3d72b72cb..eab9f2c8206a56daf7090394f56f0f1cc938a5fb 100644 (file)
@@ -105,7 +105,7 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im
                 }, delayAggregator, TimeUnit.SECONDS);
             }
         }
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     private static NetconfMessage parseNetconfNotification(String content) {
index 2e902c054ccf0065908145f2475c32acf6d627a2..509d9416de1846f679cd46324ba4a97244f09c02 100644 (file)
@@ -41,7 +41,7 @@ public class SimulatedEditConfig extends AbstractLastNetconfOperation {
             storage.setConfigList(configElementData.getChildElements());
         }
 
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     @Override
index ce06534a9cd378398db21024d0744914252aaa7e..6002bea60ac6ef4b30000939a03c2b092a2c0739 100644 (file)
@@ -26,7 +26,7 @@ public class SimulatedUnLock extends AbstractLastNetconfOperation {
     @Override
     protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement)
             throws DocumentedException {
-        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
+        return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.absent());
     }
 
     @Override
index ff3541bbe2a6c2eda9d8447377ae3007b4326bc3..946f8d1a59cd4563109918ad2f3a9c7ab366b022 100644 (file)
@@ -22,6 +22,6 @@ public class YangLibRestApp extends Application {
 
     @Override
     public Set<Object> getSingletons() {
-        return Collections.<Object>singleton(this.yangLibService);
+        return Collections.singleton(this.yangLibService);
     }
 }
index 1b53c7544ee9cb3a0a875d898594a7858646fa48..49427f1a749ef374b6c73387ee29ea0b0eaa6d9d 100644 (file)
@@ -594,21 +594,21 @@ public class BrokerFacade implements Closeable {
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = ((LeafNode<?>) child).getValue();
+                final Object nodeVal = child.getValue();
                 final NormalizedNodeAttrBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
                         Builders.leafBuilder((LeafSchemaNode) childSchema);
                 if (keys.contains(child.getNodeType())) {
-                    leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                    leafBuilder.withValue(child.getValue());
                     builder.withChild(leafBuilder.build());
                 } else {
                     if (trim) {
                         if (defaultVal == null || !defaultVal.equals(nodeVal)) {
-                            leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                            leafBuilder.withValue(child.getValue());
                             builder.withChild(leafBuilder.build());
                         }
                     } else {
                         if (defaultVal != null && defaultVal.equals(nodeVal)) {
-                            leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                            leafBuilder.withValue(child.getValue());
                             builder.withChild(leafBuilder.build());
                         }
                     }
@@ -649,17 +649,17 @@ public class BrokerFacade implements Closeable {
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = ((LeafNode<?>) child).getValue();
+                final Object nodeVal = child.getValue();
                 final NormalizedNodeAttrBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
                         Builders.leafBuilder((LeafSchemaNode) childSchema);
                 if (trim) {
                     if (defaultVal == null || !defaultVal.equals(nodeVal)) {
-                        leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                        leafBuilder.withValue(child.getValue());
                         builder.withChild(leafBuilder.build());
                     }
                 } else {
                     if (defaultVal != null && defaultVal.equals(nodeVal)) {
-                        leafBuilder.withValue(((LeafNode<?>) child).getValue());
+                        leafBuilder.withValue(child.getValue());
                         builder.withChild(leafBuilder.build());
                     }
                 }
index bbc34cbcb52a8b2186ff442de3479384d9d7a55a..80dabef6a7950790b186a9cd88bd57dcbc8dc76f 100644 (file)
@@ -507,7 +507,7 @@ public final class ControllerContext implements SchemaContextListener, Closeable
             return childByQName((Module) container, name);
         } else {
             throw new IllegalArgumentException("Unhandled parameter types: "
-                    + Arrays.<Object>asList(container, name).toString());
+                    + Arrays.asList(container, name).toString());
         }
     }
 
@@ -538,7 +538,7 @@ public final class ControllerContext implements SchemaContextListener, Closeable
     private InstanceIdentifierContext<?> collectPathArguments(final InstanceIdentifierBuilder builder,
             final List<String> strings, final DataNodeContainer parentNode, final DOMMountPoint mountPoint,
             final boolean returnJustMountPoint) {
-        Preconditions.<List<String>>checkNotNull(strings);
+        Preconditions.checkNotNull(strings);
 
         if (parentNode == null) {
             return null;
index 2a4d8bccbbd6387ed7e0a9d15fff39ead19acefb..ba7c2a3531d8929fd926f5a1763223a500ad11ce 100644 (file)
@@ -11,5 +11,5 @@ package org.opendaylight.netconf.sal.streams.listeners;
  * Type of the event.
  */
 enum EventType {
-    REGISTER, DEREGISTER, NOTIFY;
+    REGISTER, DEREGISTER, NOTIFY
 }
index 664a00cbb0675f556f4ac82316ccaec8366d370a..8bbfae93426b712c1864cc2f092e01f2e658ece8 100644 (file)
@@ -171,7 +171,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception to be thrown.");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.APPLICATION, ErrorTag.OPERATION_NOT_SUPPORTED,
-                    Optional.<String>absent(), Optional.<String>absent());
+                    Optional.absent(), Optional.absent());
         }
     }
 
@@ -218,7 +218,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception to be thrown.");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.TRANSPORT, ErrorTag.OPERATION_FAILED, Optional.of("foo"),
-                    Optional.<String>absent());
+                    Optional.absent());
             verifyRestconfDocumentedException(e, 1, ErrorType.RPC, ErrorTag.IN_USE, Optional.of("bar"),
                     Optional.of("app-tag"));
         }
@@ -249,7 +249,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
-                    Optional.<String>absent(), Optional.<String>absent());
+                    Optional.absent(), Optional.absent());
         }
     }
 
@@ -260,7 +260,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.RPC, ErrorTag.UNKNOWN_ELEMENT,
-                    Optional.<String>absent(), Optional.<String>absent());
+                    Optional.absent(), Optional.absent());
         }
     }
 
@@ -314,7 +314,7 @@ public class InvokeRpcMethodTest {
             fail("Expected an exception.");
         } catch (final RestconfDocumentedException e) {
             verifyRestconfDocumentedException(e, 0, ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
-                    Optional.<String>absent(), Optional.<String>absent());
+                    Optional.absent(), Optional.absent());
         }
     }
 
index 5ac807007203169e260a001c237bda98204e1357..5f452874414db85939709363fe333a3d3ee19268 100644 (file)
@@ -449,7 +449,7 @@ public class JSONRestconfServiceImplTest {
 
         final String uriPath = "toaster:cancel-toast";
 
-        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.<String>absent());
+        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.absent());
 
         assertEquals("Output present", false, output.isPresent());
 
@@ -469,7 +469,7 @@ public class JSONRestconfServiceImplTest {
 
         final String uriPath = "toaster:testOutput";
 
-        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.<String>absent());
+        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.absent());
 
         assertEquals("Output present", true, output.isPresent());
         assertNotNull("Returned null response", output.get());
@@ -486,7 +486,7 @@ public class JSONRestconfServiceImplTest {
 
         final String uriPath = "toaster:cancel-toast";
 
-        this.service.invokeRpc(uriPath, Optional.<String>absent());
+        this.service.invokeRpc(uriPath, Optional.absent());
     }
 
     void testGet(final LogicalDatastoreType datastoreType) throws OperationFailedException {
index d9c9f55299fa7c8b7cd4e8da5bbaba9b4ab2f9f3..0701636fff48ca5c4ebb516bf76879e27f3e4dd1 100644 (file)
@@ -32,7 +32,6 @@ import org.junit.Ignore;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mockito;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
 import org.opendaylight.netconf.sal.rest.api.Draft02;
@@ -153,7 +152,7 @@ public class RestPostOperationTest extends JerseyTest {
     public void createConfigurationDataNullTest() throws UnsupportedEncodingException {
         when(brokerFacade.commitConfigurationDataPost(any(SchemaContext.class), any(YangInstanceIdentifier.class),
                 any(NormalizedNode.class), Mockito.anyString(), Mockito.anyString()))
-                .thenReturn(Futures.<Void, TransactionCommitFailedException>immediateCheckedFuture(null));
+                .thenReturn(Futures.immediateCheckedFuture(null));
 
         //FIXME : find who is set schemaContext
 //        final String URI_1 = "/config";
index 94a8284d82e980b8e6af0fd8970ec3a281888df6..81117609f88b10723754bede3caf25b9520a8fc8 100644 (file)
@@ -135,7 +135,7 @@ public class RestPutConfigTest {
         final PutResult result = Mockito.mock(PutResult.class);
         final CheckedFuture<Void, TransactionCommitFailedException> checkedFuture =
                 Futures.immediateCheckedFuture(null);
-        Mockito.when(this.brokerFacade.commitConfigurationDataPut(this.schemaContext, yii, data, null, null))
+        Mockito.when(this.brokerFacade.commitConfigurationDataPut(schemaContext, yii, data, null, null))
                 .thenReturn(result);
         Mockito.when(result.getFutureOfPutData()).thenReturn(checkedFuture);
         Mockito.when(result.getStatus()).thenReturn(Status.OK);
index a237f037cf0afddab2ff7d2aa2bc43a5a3d0b065..200605da4b626b77fd72c811bd14ad019aeb4064 100644 (file)
@@ -36,7 +36,6 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
-import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.OrderedLeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.OrderedMapNode;
@@ -383,7 +382,7 @@ public final class PutDataTransactionUtil {
         final NormalizedNode<?, ?> emptySubtree = ImmutableNodes.fromInstanceId(schemaContext, path);
         writeTx.merge(datastore, YangInstanceIdentifier.create(emptySubtree.getIdentifier()), emptySubtree);
         TransactionUtil.ensureParentsByMerge(path, schemaContext, writeTx);
-        for (final MapEntryNode child : ((MapNode) payload).getValue()) {
+        for (final MapEntryNode child : payload.getValue()) {
             final YangInstanceIdentifier childPath = path.node(child.getIdentifier());
             writeTx.put(datastore, childPath, child);
         }
index aca94271bdf65807d8fad4654ed045cdcb1dbda2..b54afbac506494568fcb600488dd1d22a55a2190 100644 (file)
@@ -355,7 +355,7 @@ public final class ReadDataTransactionUtil {
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = ((LeafNode<?>) child).getValue();
+                final Object nodeVal = child.getValue();
                 final NormalizedNodeAttrBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
                         Builders.leafBuilder((LeafSchemaNode) childSchema);
                 if (keys.contains(child.getNodeType())) {
@@ -410,7 +410,7 @@ public final class ReadDataTransactionUtil {
                 builder.withChild(childBuilder.build());
             } else if (child instanceof LeafNode) {
                 final Object defaultVal = ((LeafSchemaNode) childSchema).getType().getDefaultValue().orElse(null);
-                final Object nodeVal = ((LeafNode<?>) child).getValue();
+                final Object nodeVal = child.getValue();
                 final NormalizedNodeAttrBuilder<NodeIdentifier, Object, LeafNode<Object>> leafBuilder =
                         Builders.leafBuilder((LeafSchemaNode) childSchema);
                 if (trim) {
index fd971523c9df911c3c79a54431abfcc323dba15d..70b866186b276f0d48ea19338679e219a25dd8eb 100644 (file)
@@ -11,5 +11,5 @@ package org.opendaylight.restconf.nb.rfc8040.streams.listeners;
  * Type of the event.
  */
 enum EventType {
-    REGISTER, DEREGISTER, NOTIFY;
+    REGISTER, DEREGISTER, NOTIFY
 }
index bad0decc33afc2f0047fa8308901a705e7fb5dd0..49f69d50d28f747f11ac211a64f75cfcd1d86484 100644 (file)
@@ -496,7 +496,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
 
         final String uriPath = "toaster:cancel-toast";
 
-        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.<String>absent());
+        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.absent());
 
         assertEquals("Output present", false, output.isPresent());
 
@@ -516,7 +516,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
 
         final String uriPath = "toaster:testOutput";
 
-        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.<String>absent());
+        final Optional<String> output = this.service.invokeRpc(uriPath, Optional.absent());
 
         assertEquals("Output present", true, output.isPresent());
         assertNotNull("Returned null response", output.get());
@@ -533,7 +533,7 @@ public class JSONRestconfServiceRfc8040ImplTest {
 
         final String uriPath = "toaster:cancel-toast";
 
-        this.service.invokeRpc(uriPath, Optional.<String>absent());
+        this.service.invokeRpc(uriPath, Optional.absent());
     }
 
     void testGet(final LogicalDatastoreType datastoreType) throws OperationFailedException {
index c16ebd5396633319fa32b309116d9d78f6e00ed5..116139dc3d1ee694cbe6d460861f6cce28bde681 100644 (file)
@@ -126,7 +126,7 @@ public class RestconfMappingNodeUtilTest {
         assertNotNull(normNode);
         final List<Object> listOfValues = new ArrayList<>();
 
-        for (final DataContainerChild<? extends PathArgument, ?> child : ((ContainerNode) normNode).getValue()) {
+        for (final DataContainerChild<? extends PathArgument, ?> child : normNode.getValue()) {
             if (child.getNodeType().equals(MonitoringModule.CONT_CAPABILITES_QNAME)) {
                 for (final DataContainerChild<? extends PathArgument, ?> dataContainerChild : ((ContainerNode) child)
                         .getValue()) {
@@ -216,10 +216,10 @@ public class RestconfMappingNodeUtilTest {
 
         for (final DataContainerChild<? extends PathArgument, ?> child : containerNode.getValue()) {
             if (child instanceof LeafNode) {
-                assertEquals(IetfYangLibrary.MODULE_SET_ID_LEAF_QNAME, ((LeafNode<?>) child).getNodeType());
+                assertEquals(IetfYangLibrary.MODULE_SET_ID_LEAF_QNAME, child.getNodeType());
             }
             if (child instanceof MapNode) {
-                assertEquals(IetfYangLibrary.MODULE_QNAME_LIST, ((MapNode) child).getNodeType());
+                assertEquals(IetfYangLibrary.MODULE_QNAME_LIST, child.getNodeType());
                 for (final MapEntryNode mapEntryNode : ((MapNode) child).getValue()) {
                     String name = "";
                     String revision = "";
@@ -227,10 +227,10 @@ public class RestconfMappingNodeUtilTest {
                             .getValue()) {
                         switch (dataContainerChild.getNodeType().getLocalName()) {
                             case IetfYangLibrary.SPECIFIC_MODULE_NAME_LEAF:
-                                name = String.valueOf(((LeafNode<?>) dataContainerChild).getValue());
+                                name = String.valueOf(dataContainerChild.getValue());
                                 break;
                             case IetfYangLibrary.SPECIFIC_MODULE_REVISION_LEAF:
-                                revision = String.valueOf(((LeafNode<?>) dataContainerChild).getValue());
+                                revision = String.valueOf(dataContainerChild.getValue());
                                 break;
                             default :
                                 LOG.info("Unknown local name '{}' of node.",
index 1fd9ada4325d0b0cf0d7d09b339246a292533c41..b9f5290eff16f9be2ace3841f469cb13d52bf3d3 100644 (file)
@@ -285,7 +285,7 @@ public abstract class BaseYangSwaggerGenerator {
         LOG.debug("Adding path: [{}]", resourcePath);
         api.setPath(resourcePath.concat(getContent(dataStore)));
 
-        Iterable<DataSchemaNode> childSchemaNodes = Collections.<DataSchemaNode>emptySet();
+        Iterable<DataSchemaNode> childSchemaNodes = Collections.emptySet();
         if (node instanceof ListSchemaNode || node instanceof ContainerSchemaNode) {
             final DataNodeContainer dataNodeContainer = (DataNodeContainer) node;
             childSchemaNodes = dataNodeContainer.getChildNodes();