Use Optional.isEmpty()
[netconf.git] / netconf / mdsal-netconf-connector / src / main / java / org / opendaylight / netconf / mdsal / connector / ops / get / Get.java
index 6aaa8d80020d560b613e9950e2327c4e543f2bb7..4751c3323b04e630481ee6bb65585f486909e823 100644 (file)
@@ -45,7 +45,7 @@ public class Get extends AbstractGet {
             throws DocumentedException {
 
         final Optional<YangInstanceIdentifier> dataRootOptional = getDataRootFromFilter(operationElement);
-        if (!dataRootOptional.isPresent()) {
+        if (dataRootOptional.isEmpty()) {
             return document.createElement(XmlNetconfConstants.DATA_KEY);
         }
 
@@ -57,7 +57,7 @@ public class Get extends AbstractGet {
                     LogicalDatastoreType.OPERATIONAL, dataRoot).get();
             transactionProvider.abortRunningTransaction(rwTx);
 
-            if (!normalizedNodeOptional.isPresent()) {
+            if (normalizedNodeOptional.isEmpty()) {
                 return document.createElement(XmlNetconfConstants.DATA_KEY);
             }