From e78326418cc149f7c90827b3d0be49eaeca54dae Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Thu, 26 May 2016 14:24:00 +0200 Subject: Expect null in ReflexChildWriterCustomizer Change-Id: I41311f840bb5e5cdb8911353763fa3c9feb8735a Signed-off-by: Maros Marsalek --- .../v3po/translate/util/write/ReflexiveChildWriterCustomizer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'v3po/translate-utils/src/main/java') diff --git a/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/ReflexiveChildWriterCustomizer.java b/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/ReflexiveChildWriterCustomizer.java index ba67e560c..79cdf62c3 100644 --- a/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/ReflexiveChildWriterCustomizer.java +++ b/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/ReflexiveChildWriterCustomizer.java @@ -46,8 +46,8 @@ public class ReflexiveChildWriterCustomizer extends NoopWr try { return method.isPresent() - ? Optional.of((C) method.get().invoke(parentData)) - : Optional.absent(); + ? Optional.fromNullable((C) method.get().invoke(parentData)) + : Optional.absent(); } catch (IllegalAccessException | InvocationTargetException e) { throw new IllegalArgumentException("Unable to get " + currentType + " from " + parentData, e); } -- cgit 1.2.3-korg