summaryrefslogtreecommitdiffstats
path: root/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-01-09 08:23:45 +0100
committerMarek Gradzki <mgradzki@cisco.com>2017-01-10 07:41:32 +0000
commit98666a011d7538ac9742a8351856f76fbe7d8e69 (patch)
tree1b955cd53a0a78eefb9e1c04413fd3f7dd0b6b9a /infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java
parent75f0efb8b1aff9e9be8d222fd90d1df7ce542bbc (diff)
HONEYCOMB-331: unify initialization handling
Due to incorrect instance of check, InitSubtreeReader was never created in CompositeReaderRegistryBuilder.getSubtreeHandler(). As a consequence, initializers registered by subtreeAdd*, were not invoked. The patch: - fixes mentioned check, - makes readers implement InitReader instead of directly implementing Initializer - includes missing unit tests for GenericReaders. Change-Id: I93be59fafddb60dce00191958b5c8c62e7c2d289 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java')
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java
index ec82b3f7f..2eca8954c 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java
@@ -24,6 +24,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import io.fd.honeycomb.translate.read.InitFailedException;
import io.fd.honeycomb.translate.read.InitListReader;
+import io.fd.honeycomb.translate.read.InitReader;
import io.fd.honeycomb.translate.read.Initializer;
import io.fd.honeycomb.translate.read.ListReader;
import io.fd.honeycomb.translate.read.ReadContext;
@@ -47,7 +48,7 @@ import org.slf4j.LoggerFactory;
class CompositeReader<D extends DataObject, B extends Builder<D>>
extends AbstractGenericReader<D, B>
- implements Initializer<D>, DelegatingReader<D, B> {
+ implements InitReader<D, B>, DelegatingReader<D, B> {
private static final Logger LOG = LoggerFactory.getLogger(CompositeReader.class);