Migrate to Empty.value() 08/99508/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 27 Jan 2022 19:27:20 +0000 (20:27 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 27 Jan 2022 19:27:46 +0000 (20:27 +0100)
Empty.getInstance() is being removed, migrate to its replacement.

Change-Id: Ic12e07df3c16827afcddf32f2fb595389e4efdbe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 files changed:
netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/SingleReconnectFuture.java
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/impl/CapabilityChangeNotificationProducer.java
netconf/mdsal-netconf-notification/src/test/java/org/opendaylight/netconf/mdsal/notification/impl/CapabilityChangeNotificationProducerTest.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/StreamingContext.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/util/NetconfBaseOps.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteCandidateRunningTxTest.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/schema/mapping/BaseRpcSchemalessTransformerTest.java
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/OperationsResourceUtils.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/DataNormalizationOperation.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfImpl.java
restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestconfImplTest.java

index 1a26a4f44f2a15d5e0940d47ac4e62e392e683ce..121235dfa9fc157eaf6e40cb6bd3d66d53799f14 100644 (file)
@@ -27,7 +27,7 @@ final class SingleReconnectFuture extends DefaultPromise<Empty> implements Recon
                 if (future.isCancelled()) {
                     cancel(false);
                 } else if (future.isSuccess()) {
-                    setSuccess(Empty.getInstance());
+                    setSuccess(Empty.value());
                 } else {
                     setFailure(future.cause());
                 }
index 87cfa2a081af67500b281178b04c83132ae86383..c27b9387be396fce7c8a213907c4786589677580 100644 (file)
@@ -87,7 +87,7 @@ public final class CapabilityChangeNotificationProducer extends OperationalDatas
     private void publishNotification(final Set<Uri> added, final Set<Uri> removed) {
         final NetconfCapabilityChangeBuilder netconfCapabilityChangeBuilder = new NetconfCapabilityChangeBuilder();
         netconfCapabilityChangeBuilder.setChangedBy(new ChangedByBuilder().setServerOrUser(new ServerBuilder()
-                .setServer(Empty.getInstance()).build()).build());
+                .setServer(Empty.value()).build()).build());
         netconfCapabilityChangeBuilder.setAddedCapability(ImmutableList.copyOf(added));
         netconfCapabilityChangeBuilder.setDeletedCapability(ImmutableList.copyOf(removed));
         // TODO modified should be computed ... but why ?
index 61969db2c672c93c924e2076f4cfe254a20bf3bc..6c721dc05fc13ab559646121b0cba37bd9af1dd9 100644 (file)
@@ -126,7 +126,7 @@ public class CapabilityChangeNotificationProducerTest {
     private static NetconfCapabilityChange changedCapabilitesFrom(final List<Uri> added, final List<Uri> deleted) {
         NetconfCapabilityChangeBuilder netconfCapabilityChangeBuilder = new NetconfCapabilityChangeBuilder();
         netconfCapabilityChangeBuilder.setChangedBy(new ChangedByBuilder().setServerOrUser(
-                new ServerBuilder().setServer(Empty.getInstance()).build()).build());
+                new ServerBuilder().setServer(Empty.value()).build()).build());
 
         netconfCapabilityChangeBuilder.setModifiedCapability(Collections.emptyList());
         netconfCapabilityChangeBuilder.setAddedCapability(added);
index 2c658a751802c5ff3200bbff27ce081f305f68be..543f657cb9e9afb523f825cc6b5044a2eb177558 100644 (file)
@@ -217,7 +217,7 @@ class NetconfCapabilityMonitoringService implements CapabilityListener, AutoClos
         final NetconfCapabilityChangeBuilder netconfCapabilityChangeBuilder = new NetconfCapabilityChangeBuilder();
         netconfCapabilityChangeBuilder
                 .setChangedBy(new ChangedByBuilder().setServerOrUser(
-                    new ServerBuilder().setServer(Empty.getInstance()).build()).build());
+                    new ServerBuilder().setServer(Empty.value()).build()).build());
         netconfCapabilityChangeBuilder.setDeletedCapability(Lists.newArrayList(Collections2
                 .transform(removed, CAPABILITY_TO_URI)));
         netconfCapabilityChangeBuilder.setAddedCapability(Lists.newArrayList(Collections2
index eb02e2b72ec661144e4a8b3f2ba88c385c3c650a..abfd79a83a7996c77e052bc89ab5da4d3a23e212 100644 (file)
@@ -372,7 +372,7 @@ abstract class StreamingContext<T extends PathArgument> implements Identifiable<
 
     private static final class LeafListEntry extends AbstractSimple<NodeWithValue<?>> {
         LeafListEntry(final LeafListSchemaNode potential) {
-            super(new NodeWithValue<>(potential.getQName(), Empty.getInstance()));
+            super(new NodeWithValue<>(potential.getQName(), Empty.value()));
         }
 
         @Override
index 38135fadd3256d0bf47562882c7f46525ced7826..6b6079767cf66a257c602b2a88ab0f94d0f7b440 100644 (file)
@@ -463,7 +463,7 @@ public final class NetconfBaseOps {
                 .withNodeIdentifier(NETCONF_SOURCE_NODEID)
                 .withChild(Builders.choiceBuilder()
                     .withNodeIdentifier(CONFIG_SOURCE_NODEID)
-                    .withChild(ImmutableNodes.leafNode(datastore, Empty.getInstance()))
+                    .withChild(ImmutableNodes.leafNode(datastore, Empty.value()))
                     .build())
                 .build();
     }
@@ -476,7 +476,7 @@ public final class NetconfBaseOps {
     public static @NonNull ContainerNode getTargetNode(final QName datastore) {
         return Builders.containerBuilder().withNodeIdentifier(NETCONF_TARGET_NODEID)
                 .withChild(Builders.choiceBuilder().withNodeIdentifier(CONFIG_TARGET_NODEID).withChild(
-                    Builders.leafBuilder().withNodeIdentifier(toId(datastore)).withValue(Empty.getInstance()).build())
+                    Builders.leafBuilder().withNodeIdentifier(toId(datastore)).withValue(Empty.value()).build())
                     .build()).build();
     }
 
index 1af16dec4b374f2636c942e77844ebf18b137e48..928636b206c370193c817af3a072ab240ba38abc 100644 (file)
@@ -82,7 +82,7 @@ public class WriteCandidateRunningTxTest extends AbstractTestModelTest {
 
     private static ContainerNode getLockContent(final QName op, final QName datastore) {
         final LeafNode<Object> datastoreLeaf = Builders.leafBuilder().withNodeIdentifier(toId(datastore))
-                .withValue(Empty.getInstance()).build();
+                .withValue(Empty.value()).build();
         final ChoiceNode choice = Builders.choiceBuilder()
                 .withNodeIdentifier(toId(ConfigTarget.QNAME))
                 .withChild(datastoreLeaf)
index 1506fb14462ed5e414fc430da2a4b3fd6e8ae61a..e91abae2fc6f4d0560264399f3c64bd42ecf0151 100644 (file)
@@ -90,7 +90,7 @@ public class BaseRpcSchemalessTransformerTest extends AbstractBaseSchemasTest {
                 new YangInstanceIdentifier.NodeIdentifier(ConfigTarget.QNAME))
                 .withChild(Builders.leafBuilder().withNodeIdentifier(
                         new YangInstanceIdentifier.NodeIdentifier(Candidate.QNAME))
-                    .withValue(Empty.getInstance()).build())
+                    .withValue(Empty.value()).build())
                 .build();
         final ContainerNode target = Builders.containerBuilder()
                 .withNodeIdentifier(
index 03e289d19e0534a7c274f0968250807dd6182c07..ceeb963966bd9f3c6e2f734d14775ce2dcbf81a7 100644 (file)
@@ -57,7 +57,7 @@ public final class OperationsResourceUtils {
         final DataContainerNodeBuilder<NodeIdentifier, ContainerNode> operationsBuilder = Builders.containerBuilder()
                 .withNodeIdentifier(new NodeIdentifier(OperationsContainerSchemaNode.QNAME));
         for (final OperationsLeafSchemaNode leaf : rpcLeafSchemas) {
-            operationsBuilder.withChild(ImmutableNodes.leafNode(leaf.getQName(), Empty.getInstance()));
+            operationsBuilder.withChild(ImmutableNodes.leafNode(leaf.getQName(), Empty.value()));
         }
 
         return Map.entry(new InstanceIdentifierContext<>(null, operatationsSchema, mountPoint,
index 0499e21d60d0991cbce2cd1e9b32feb9b6d43652..57ba15374ad018665cfa8ba6435c2f0f8e5cab0d 100644 (file)
@@ -93,7 +93,7 @@ abstract class DataNormalizationOperation<T extends PathArgument> implements Ide
 
     private static final class LeafListEntryNormalization extends SimpleTypeNormalization<NodeWithValue> {
         LeafListEntryNormalization(final LeafListSchemaNode potential) {
-            super(new NodeWithValue<>(potential.getQName(), Empty.getInstance()));
+            super(new NodeWithValue<>(potential.getQName(), Empty.value()));
         }
     }
 
index a07b832d60c9f7c90299cb0d92693d6fe7041283..7ee506bde95585a9d9e7c9c10f7991c8491068dc 100644 (file)
@@ -1487,7 +1487,7 @@ public final class RestconfImpl implements RestconfService {
         final DataSchemaNode eventsSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
         checkState(eventsSchemaNode instanceof LeafSchemaNode);
         streamNodeValues.withChild(
-            SchemaAwareBuilders.leafBuilder((LeafSchemaNode) eventsSchemaNode).withValue(Empty.getInstance()).build());
+            SchemaAwareBuilders.leafBuilder((LeafSchemaNode) eventsSchemaNode).withValue(Empty.value()).build());
 
         return streamNodeValues.build();
     }
index 02fa1fe8e2ae2f977be9b08902199854b59d428c..ac208c6e064abef94ffd2b589e45a023d05bb61c 100644 (file)
@@ -248,7 +248,7 @@ public class RestconfImplTest {
         instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(listStreamSchemaNode, "events");
         final DataSchemaNode eventsSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
         streamNodeValues.withChild(
-            SchemaAwareBuilders.leafBuilder((LeafSchemaNode) eventsSchemaNode).withValue(Empty.getInstance()).build());
+            SchemaAwareBuilders.leafBuilder((LeafSchemaNode) eventsSchemaNode).withValue(Empty.value()).build());
         assertNotNull(streamNodeValues.build());
     }