diff --git a/modules/nextflow/src/main/groovy/nextflow/splitter/JsonSplitter.groovy b/modules/nextflow/src/main/groovy/nextflow/splitter/JsonSplitter.groovy index 66dcb40b4b..d68b2ed070 100644 --- a/modules/nextflow/src/main/groovy/nextflow/splitter/JsonSplitter.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/splitter/JsonSplitter.groovy @@ -219,9 +219,9 @@ class JsonSplitter extends AbstractTextSplitter { break } - final map = Map.of( - OBJECT_KEY, reader.nextName(), - OBJECT_VALUE, fromJson(reader)) + final map = new LinkedHashMap<>(1) + map[OBJECT_KEY] = reader.nextName() + map[OBJECT_VALUE] = fromJson(reader) // -- apply the splitting logic for the fetched record result = processChunk( map )