Resolved some sonar issues: If Stmts Must Use Braces 18/11918/2
authorLadislav Borak <lborak@cisco.com>
Mon, 13 Oct 2014 07:50:27 +0000 (09:50 +0200)
committerLadislav Borak <lborak@cisco.com>
Tue, 25 Nov 2014 08:34:48 +0000 (09:34 +0100)
Change-Id: I904bf50a98ba72f6887c540970a10b951c4f8beb
Signed-off-by: Ladislav Borak <lborak@cisco.com>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/ValueWithQName.java
yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/ChoiceNodeModification.java
yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/LeafSetNodeModification.java
yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/MapNodeModification.java

index ed2ff2c35a9f04e2f1254a8389c94095d12f2dd7..17906a06e55dae95f2962ffb05cc36e624c321b9 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.yangtools.yang.data.impl.codec;
 
 import java.util.Map.Entry;
-
 import org.opendaylight.yangtools.yang.common.QName;
 
 public class ValueWithQName<V> implements Entry<QName, V>{
@@ -26,6 +25,7 @@ public class ValueWithQName<V> implements Entry<QName, V>{
         return qname;
     }
 
+    @Override
     public V getValue() {
         return value;
     }
@@ -63,10 +63,12 @@ public class ValueWithQName<V> implements Entry<QName, V>{
         @SuppressWarnings("rawtypes")
         ValueWithQName other = (ValueWithQName) obj;
         if (qname == null) {
-            if (other.qname != null)
+            if (other.qname != null) {
                 return false;
-        } else if (!qname.equals(other.qname))
+            }
+        } else if (!qname.equals(other.qname)) {
             return false;
+        }
         if (value == null) {
             if (other.value != null) {
                 return false;
index bd518fd00e35c14fa17175daf7eda2a39f4527ad..e4674caaa95a42d705fca62080dfc561d6a3e6a2 100644 (file)
@@ -61,8 +61,9 @@ final class ChoiceNodeModification extends
             detectedCase = detectedCaseForChild.get();
         }
 
-        if (detectedCase == null)
+        if (detectedCase == null) {
             return childrenToProcess;
+        }
 
         // Filter out child nodes that do not belong to detected case =
         // Nodes from other cases present in actual
index 55327ea2a80811cbad6d8f4834fdb0a9e95168c5..e6235bb6b8c7321ca95644ea8f8ab63e23714a9e 100644 (file)
@@ -66,8 +66,9 @@ final class LeafSetNodeModification implements Modification<LeafListSchemaNode,
     }
 
     private Optional<LeafSetNode<?>> build(LeafListSchemaNode schemaNode, List<LeafSetEntryNode<?>> resultNodes) {
-        if(resultNodes.isEmpty())
+        if(resultNodes.isEmpty()) {
             return Optional.absent();
+        }
 
         ListNodeBuilder<Object, LeafSetEntryNode<Object>> b = Builders.leafSetBuilder(schemaNode);
         for (LeafSetEntryNode<?> resultNode : resultNodes) {
index 51996a8449e5c0f7a173820ed355992bb07a636e..41268b905e12985dbed6000d4ddb869dc3a0b8a2 100644 (file)
@@ -26,12 +26,14 @@ public class MapNodeModification implements Modification<ListSchemaNode, MapNode
                                     Optional<MapNode> modification, OperationStack operationStack) throws DataModificationException {
 
         // Merge or None operation on parent, leaving actual if modification not present
-        if (!modification.isPresent())
+        if (!modification.isPresent()) {
             return actual;
+        }
 
         Map<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> resultNodes = Maps.newLinkedHashMap();
-        if(actual.isPresent())
+        if(actual.isPresent()) {
             resultNodes.putAll(mapEntries(actual.get()));
+        }
 
         // TODO implement ordering for modification nodes
 
@@ -82,8 +84,9 @@ public class MapNodeModification implements Modification<ListSchemaNode, MapNode
     }
 
     private Optional<MapNode> build(ListSchemaNode schema, Map<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> resultNodes) {
-        if(resultNodes.isEmpty())
+        if(resultNodes.isEmpty()) {
             return Optional.absent();
+        }
 
         CollectionNodeBuilder<MapEntryNode, MapNode> b = Builders.mapBuilder(schema);