summaryrefslogtreecommitdiffstats
path: root/v3po/translate-utils
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-05-26 14:00:46 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-05-30 12:48:11 +0000
commitc8cb812e448f1c0f08732187b662093dc375f61a (patch)
tree36fa365a8e90b30e2774831564f25eafc47789f2 /v3po/translate-utils
parent3c15fa224a914aa9e03ae2e97fab1e740a0f8b04 (diff)
Fix error reporting for missing writer
Change-Id: Ifb0c533ec12efffc039ae31516e274e059cd980f Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/translate-utils')
-rw-r--r--v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/DelegatingWriterRegistry.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/DelegatingWriterRegistry.java b/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/DelegatingWriterRegistry.java
index f25ba5336..7eba98a07 100644
--- a/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/DelegatingWriterRegistry.java
+++ b/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/DelegatingWriterRegistry.java
@@ -32,6 +32,7 @@ import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -128,9 +129,11 @@ public final class DelegatingWriterRegistry implements WriterRegistry {
}
private void checkAllWritersPresent(final @Nonnull Map<InstanceIdentifier<?>, DataObject> nodesBefore) {
- checkArgument(rootWriters.keySet().containsAll(Collections2.transform(nodesBefore.keySet(), ID_TO_CLASS)),
+ final Set<Class<? extends DataObject>> nodesBeforeClasses =
+ Sets.newHashSet(Collections2.transform(nodesBefore.keySet(), ID_TO_CLASS));
+ checkArgument(rootWriters.keySet().containsAll(nodesBeforeClasses),
"Unable to handle all changes. Missing dedicated writers for: %s",
- Sets.difference(nodesBefore.keySet(), rootWriters.keySet()));
+ Sets.difference(nodesBeforeClasses, rootWriters.keySet()));
}
private static final class ReverterImpl implements Reverter {