summaryrefslogtreecommitdiffstats
path: root/infra/data-impl/src/main/java
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 15:39:43 +0200
commitd41b116f0a177683a326a9d18c4f6aa1ece651de (patch)
treee41057bb035c7ea6762e27f48224ac4822bcd00b /infra/data-impl/src/main/java
parent7567ab4670f6cdf44e227ab8d547414a755401df (diff)
Fixing sonar issues #1
Change-Id: I4c27d0ad2fd1655db2237ae914361f029093084c Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'infra/data-impl/src/main/java')
-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);
}
}