summaryrefslogtreecommitdiffstats
path: root/infra/data-impl
diff options
context:
space:
mode:
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);
}
}