This is an automated email from the ASF dual-hosted git repository. jfim pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push: new e2916ed Minor deserialization fixes (#3508) e2916ed is described below commit e2916ed5aed7430d781a8aa602f995e24ffdb6e0 Author: Jean-François Im <jeanfrancois...@gmail.com> AuthorDate: Tue Dec 4 12:41:07 2018 -0800 Minor deserialization fixes (#3508) - Add a missing conversion from ArrayList to Set - Avoid an NPE from being thrown during value injection. The injection behavior stays the same, this just removes the NPE. --- .../java/com/linkedin/pinot/common/config/Deserializer.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pinot-common/src/main/java/com/linkedin/pinot/common/config/Deserializer.java b/pinot-common/src/main/java/com/linkedin/pinot/common/config/Deserializer.java index 05ccba5..c667366 100644 --- a/pinot-common/src/main/java/com/linkedin/pinot/common/config/Deserializer.java +++ b/pinot-common/src/main/java/com/linkedin/pinot/common/config/Deserializer.java @@ -159,6 +159,11 @@ public class Deserializer { return list; }); + typeConverters.put(Tuple.of(ArrayList.class, Set.class), items -> { + ArrayList list = (ArrayList) items; + return new HashSet(list); + }); + // Mark all types that have a converter as simple types simpleTypes = new HashSet<>(); typeConverters @@ -232,7 +237,10 @@ public class Deserializer { LOGGER.debug("Extracting value from field {} of {}, values are {}", dslInfo.value(), dslValue, dslValues); - valueInjected |= coerceValueIntoField(rootObject, declaredField, dslValues.getOrElse(dslInfo.value(), null)); + if (dslValues != null) { + valueInjected |= + coerceValueIntoField(rootObject, declaredField, dslValues.getOrElse(dslInfo.value(), null)); + } } } else if (useChildKeyHandler != null) { // Use a child key handler to handle this value --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org