This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit 586c07b98349f2e18e31edb6345f2d77f83af291
Author: Andy Seaborne <[email protected]>
AuthorDate: Wed Nov 20 16:56:28 2024 +0000

    Mutable list needed to track output settings
---
 jena-cmds/src/main/java/shacl/shacl_parse.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/jena-cmds/src/main/java/shacl/shacl_parse.java 
b/jena-cmds/src/main/java/shacl/shacl_parse.java
index aabdf89277..d0ed0f0682 100644
--- a/jena-cmds/src/main/java/shacl/shacl_parse.java
+++ b/jena-cmds/src/main/java/shacl/shacl_parse.java
@@ -19,6 +19,7 @@
 package shacl;
 
 import java.io.PrintStream;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.function.Function;
@@ -96,10 +97,11 @@ public class shacl_parse extends CmdGeneral {
                  String[] a = x.split(",");
                  return Arrays.stream(a);
              };
-             List<String> values = getValues(argOutput).stream()
+             List<String> outputValues = getValues(argOutput).stream()
                      .flatMap(f)
                      .map(s->s.toLowerCase())
                      .toList();
+             List<String> values = new ArrayList<>(outputValues); // Mutable.
              printText = values.remove("text") || values.remove("t");
              printCompact = values.remove("compact") || values.remove("c");
              printRDF = values.remove("rdf") || values.remove("r") || 
values.remove("ttl");

Reply via email to