X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Futils%2FPruningDataTreeModification.java;h=0e97cd958804ce632d1b45af74f7f6b4192f36c7;hb=4e696d9795fe7eef40369c05c340d137394126f3;hp=697b0c516a4000ae89e1ebbc9567d62a9a82b127;hpb=6276a65120a674b545ea787a5e1d9311bcdbf2af;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModification.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModification.java index 697b0c516a..0e97cd9588 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModification.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModification.java @@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory; /** * The PruningDataTreeModification first removes all entries from the data which do not belong in the schemaContext - * before delegating it to the actual DataTreeModification + * before delegating it to the actual DataTreeModification. */ public class PruningDataTreeModification extends ForwardingObject implements DataTreeModification { @@ -53,7 +53,7 @@ public class PruningDataTreeModification extends ForwardingObject implements Dat public void delete(YangInstanceIdentifier yangInstanceIdentifier) { try { delegate.delete(yangInstanceIdentifier); - } catch(SchemaValidationFailedException e){ + } catch (SchemaValidationFailedException e) { LOG.warn("Node at path : {} does not exist ignoring delete", yangInstanceIdentifier); } } @@ -61,12 +61,12 @@ public class PruningDataTreeModification extends ForwardingObject implements Dat @Override public void merge(YangInstanceIdentifier yangInstanceIdentifier, NormalizedNode normalizedNode) { try { - if(YangInstanceIdentifier.EMPTY.equals(yangInstanceIdentifier)){ + if (YangInstanceIdentifier.EMPTY.equals(yangInstanceIdentifier)) { pruneAndMergeNode(yangInstanceIdentifier, normalizedNode); } else { delegate.merge(yangInstanceIdentifier, normalizedNode); } - } catch (SchemaValidationFailedException e){ + } catch (SchemaValidationFailedException e) { LOG.warn("Node at path {} was pruned during merge due to validation error: {}", yangInstanceIdentifier, e.getMessage()); @@ -78,7 +78,7 @@ public class PruningDataTreeModification extends ForwardingObject implements Dat private void pruneAndMergeNode(YangInstanceIdentifier yangInstanceIdentifier, NormalizedNode normalizedNode) { NormalizedNode pruned = pruneNormalizedNode(yangInstanceIdentifier, normalizedNode); - if(pruned != null) { + if (pruned != null) { delegate.merge(yangInstanceIdentifier, pruned); } } @@ -86,12 +86,12 @@ public class PruningDataTreeModification extends ForwardingObject implements Dat @Override public void write(YangInstanceIdentifier yangInstanceIdentifier, NormalizedNode normalizedNode) { try { - if(YangInstanceIdentifier.EMPTY.equals(yangInstanceIdentifier)){ + if (YangInstanceIdentifier.EMPTY.equals(yangInstanceIdentifier)) { pruneAndWriteNode(yangInstanceIdentifier, normalizedNode); } else { delegate.write(yangInstanceIdentifier, normalizedNode); } - } catch (SchemaValidationFailedException e){ + } catch (SchemaValidationFailedException e) { LOG.warn("Node at path : {} was pruned during write due to validation error: {}", yangInstanceIdentifier, e.getMessage()); @@ -102,7 +102,7 @@ public class PruningDataTreeModification extends ForwardingObject implements Dat private void pruneAndWriteNode(YangInstanceIdentifier yangInstanceIdentifier, NormalizedNode normalizedNode) { NormalizedNode pruned = pruneNormalizedNode(yangInstanceIdentifier, normalizedNode); - if(pruned != null) { + if (pruned != null) { delegate.write(yangInstanceIdentifier, pruned); } } @@ -161,7 +161,7 @@ public class PruningDataTreeModification extends ForwardingObject implements Dat public void write(PathArgument child, NormalizedNode data) { YangInstanceIdentifier path = current().node(child); NormalizedNode prunedNode = pruningModification.pruneNormalizedNode(path, data); - if(prunedNode != null) { + if (prunedNode != null) { toModification.write(path, prunedNode); } } @@ -170,7 +170,7 @@ public class PruningDataTreeModification extends ForwardingObject implements Dat public void merge(PathArgument child, NormalizedNode data) { YangInstanceIdentifier path = current().node(child); NormalizedNode prunedNode = pruningModification.pruneNormalizedNode(path, data); - if(prunedNode != null) { + if (prunedNode != null) { toModification.merge(path, prunedNode); } } @@ -179,7 +179,7 @@ public class PruningDataTreeModification extends ForwardingObject implements Dat public void delete(PathArgument child) { try { toModification.delete(current().node(child)); - } catch(SchemaValidationFailedException e) { + } catch (SchemaValidationFailedException e) { // Ignoring since we would've already logged this in the call to the original modification. } }