From d9f55776e6b992e736fe5e0ef89a68f907cdaa09 Mon Sep 17 00:00:00 2001 From: Villu Ruusmann Date: Mon, 25 Dec 2023 07:54:22 +0200 Subject: [PATCH] Fixed commit d71ae5ed4d --- .../src/main/java/org/jpmml/sparkml/PipelineModelUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pmml-sparkml/src/main/java/org/jpmml/sparkml/PipelineModelUtil.java b/pmml-sparkml/src/main/java/org/jpmml/sparkml/PipelineModelUtil.java index 57390669..f3be1830 100644 --- a/pmml-sparkml/src/main/java/org/jpmml/sparkml/PipelineModelUtil.java +++ b/pmml-sparkml/src/main/java/org/jpmml/sparkml/PipelineModelUtil.java @@ -32,6 +32,7 @@ import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.List; @@ -55,7 +56,7 @@ private PipelineModelUtil(){ static public void addStage(PipelineModel pipelineModel, int index, Transformer transformer){ - List stages = Arrays.asList(pipelineModel.stages()); + List stages = new ArrayList<>(Arrays.asList(pipelineModel.stages())); stages.add(index, transformer); @@ -64,7 +65,7 @@ public void addStage(PipelineModel pipelineModel, int index, Transformer transfo static public Transformer removeStage(PipelineModel pipelineModel, int index){ - List stages = Arrays.asList(pipelineModel.stages()); + List stages = new ArrayList<>(Arrays.asList(pipelineModel.stages())); Transformer result = stages.remove(index);