diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-05-26 14:00:46 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-05-30 12:48:11 +0000 |
commit | 7b18b6914af4bbb5b8b0deefbd10c0801724d516 (patch) | |
tree | 9aa9ab2ef950ef29a688b101974c4d3df243f617 /v3po/translate-utils/src/main | |
parent | 9ca3dc35386e1d7ba77333e09c5ebce7ce953ff0 (diff) |
Fix error reporting for missing writer
Change-Id: Ifb0c533ec12efffc039ae31516e274e059cd980f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/translate-utils/src/main')
-rw-r--r-- | v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/DelegatingWriterRegistry.java | 7 |
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 { |