summaryrefslogtreecommitdiffstats
path: root/infra/data-impl
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-08-31 15:16:38 +0200
committerMaros Marsalek <mmarsale@cisco.com>2016-08-31 14:27:59 +0000
commit2cdd56d31c4514d7d7000ce7c7b6417ce53e2be2 (patch)
treeb474759ff9bdd3b0d310377e8435f0182454b779 /infra/data-impl
parentdace04173cd4846c3cfbcf44ede9cc7081909588 (diff)
Fixing sonar issues #1
Change-Id: I4c27d0ad2fd1655db2237ae914361f029093084c Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'infra/data-impl')
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java8
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java8
2 files changed, 9 insertions, 7 deletions
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java
index e9a616eea..d5d810e0a 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java
@@ -83,10 +83,10 @@ public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager
@Override
public DataModification newModification() {
- return new ConfigSnapshot(super.newModification());
+ return new DelegatingConfigSnapshot(super.newModification());
}
- private final class ConfigSnapshot extends ModifiableDataTreeManager.ConfigSnapshot {
+ private final class DelegatingConfigSnapshot extends ModifiableDataTreeManager.ConfigSnapshot {
private final DataModification untouchedModification;
@@ -96,7 +96,7 @@ public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager
* (state without current modifications).
* It must be captured as close as possible to when current modification started.
*/
- ConfigSnapshot(final DataModification untouchedModification) {
+ DelegatingConfigSnapshot(final DataModification untouchedModification) {
this.untouchedModification = untouchedModification;
}
@@ -188,7 +188,7 @@ public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager
final DataObjectUpdate dataObjectUpdate = toDataObjectUpdate(normalizedNodeUpdate, serializer);
if (dataObjectUpdate != null) {
if (dataObjectUpdate instanceof DataObjectUpdate.DataObjectDelete) {
- dataObjectDeletes.put(unkeyedIid, ((DataObjectUpdate.DataObjectDelete) dataObjectUpdate));
+ dataObjectDeletes.put(unkeyedIid, (DataObjectUpdate.DataObjectDelete) dataObjectUpdate);
} else {
dataObjectUpdates.put(unkeyedIid, dataObjectUpdate);
}
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java
index 6bc6b1b4b..2cbe1ec8b 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java
@@ -75,16 +75,18 @@ final class WriteTransaction implements DOMDataWriteTransaction {
}
private void handleOperation(final LogicalDatastoreType store,
- final Consumer<DataModification> r) {
+ final Consumer<DataModification> modificationHandler) {
switch (store) {
case CONFIGURATION:
checkArgument(configModification != null, "Modification of %s is not supported", store);
- r.accept(configModification);
+ modificationHandler.accept(configModification);
break;
case OPERATIONAL:
checkArgument(operationalModification != null, "Modification of %s is not supported", store);
- r.accept(operationalModification);
+ modificationHandler.accept(operationalModification);
break;
+ default:
+ throw new IllegalArgumentException("Unable to handle operation for type " + store);
}
}