summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-05-26 14:24:00 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-05-30 12:56:58 +0000
commit92dd7844582fd9ea01c5254832aab1aab9bad4e9 (patch)
treee21c639d8e47346523de3c33f7c645e61d9f8745
parentc8cb812e448f1c0f08732187b662093dc375f61a (diff)
Expect null in ReflexChildWriterCustomizer
Change-Id: I41311f840bb5e5cdb8911353763fa3c9feb8735a Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
-rw-r--r--v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/ReflexiveChildWriterCustomizer.java4
1 files changed, 2 insertions, 2 deletions
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<C extends DataObject> extends NoopWr
try {
return method.isPresent()
- ? Optional.of((C) method.get().invoke(parentData))
- : Optional.<C>absent();
+ ? Optional.fromNullable((C) method.get().invoke(parentData))
+ : Optional.absent();
} catch (IllegalAccessException | InvocationTargetException e) {
throw new IllegalArgumentException("Unable to get " + currentType + " from " + parentData, e);
}