diff --git a/core/src/main/java/io/xpipe/core/data/node/SimpleTupleNode.java b/core/src/main/java/io/xpipe/core/data/node/SimpleTupleNode.java index 738ce9f6d..758739c73 100644 --- a/core/src/main/java/io/xpipe/core/data/node/SimpleTupleNode.java +++ b/core/src/main/java/io/xpipe/core/data/node/SimpleTupleNode.java @@ -8,7 +8,6 @@ import java.util.Collections; import java.util.List; import java.util.Optional; - public class SimpleTupleNode extends TupleNode { private final List names; @@ -68,11 +67,10 @@ public class SimpleTupleNode extends TupleNode { @Override public DataStructureNode clear() { nodes.clear(); - names.clear(); + if (names != null) names.clear(); return this; } - @Override public int size() { return nodes.size(); @@ -90,13 +88,14 @@ public class SimpleTupleNode extends TupleNode { public List getKeyValuePairs() { var l = new ArrayList(size()); for (int i = 0; i < size(); i++) { - l.add(new KeyValue(names != null ? getKeyNames().get(i) : null, getNodes().get(i))); + l.add(new KeyValue( + names != null ? getKeyNames().get(i) : null, getNodes().get(i))); } return l; } public List getKeyNames() { - return Collections.unmodifiableList(names); + return names != null ? Collections.unmodifiableList(names) : Collections.nCopies(size(), null); } public List getNodes() { diff --git a/core/src/main/java/io/xpipe/core/util/JacksonMapper.java b/core/src/main/java/io/xpipe/core/util/JacksonMapper.java index 2be58d1df..b7e4839f9 100644 --- a/core/src/main/java/io/xpipe/core/util/JacksonMapper.java +++ b/core/src/main/java/io/xpipe/core/util/JacksonMapper.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.SerializationFeature; import java.util.ArrayList; import java.util.List; import java.util.ServiceLoader; +import java.util.function.Consumer; public class JacksonMapper { @@ -37,6 +38,10 @@ public class JacksonMapper { DEFAULT = BASE.copy(); } + public static synchronized void configure(Consumer mapper) { + mapper.accept(INSTANCE); + } + public static synchronized void initClassBased() { initModularized(null); } diff --git a/deps b/deps index 2fe3d4995..5ec6b963c 160000 --- a/deps +++ b/deps @@ -1 +1 @@ -Subproject commit 2fe3d49953de977f50540e677f61b2463b1e8b82 +Subproject commit 5ec6b963c1fd0b435dddc28b76caed019d7b9c25