From db9ce3d32c794b0cfa78fc5b3c8d5efcd0bd4532 Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Wed, 19 Oct 2016 15:01:41 +0200 Subject: HONEYCOMB-261 Dont return empty containers from read Change-Id: I0b17b958f55a5bf83e2644dc9843fe5e631baa55 Signed-off-by: Maros Marsalek --- .../fd/honeycomb/translate/util/read/registry/CompositeReader.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'infra/translate-utils/src/main/java') diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/registry/CompositeReader.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/registry/CompositeReader.java index 91a195f44..e392228aa 100644 --- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/registry/CompositeReader.java +++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/registry/CompositeReader.java @@ -111,7 +111,10 @@ class CompositeReader> extends Abstra LOG.debug("{}: Reading child from: {}", this, child); if (child instanceof ListReader) { final List list = ((ListReader) child).readList(childId, ctx); - ((ListReader) child).merge(builder, list); + // Dont set empty lists + if (!list.isEmpty()) { + ((ListReader) child).merge(builder, list); + } } else { final Optional read = child.read(childId, ctx); if (read.isPresent()) { -- cgit 1.2.3-korg