From 5a39042d5ee05f6134c7d380f12b338c23adce4b Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Mon, 25 Oct 2021 13:39:57 +0200 Subject: [PATCH] Bump XStream to 1.1.18 for better Java 16+ compatibility On Java 16+, users still need to run the cleaner with JVM parameter '--add-opens java.base/java.util=ALL-UNNAMED', but that is way better than the multiple '--add-opens' statements needed for XStream 1.4.8. --- pom.xml | 2 +- src/main/java/de/scrum_master/galileo/Book.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 180a0e2..fac1c70 100644 --- a/pom.xml +++ b/pom.xml @@ -144,7 +144,7 @@ com.thoughtworks.xstream xstream - 1.4.8 + 1.4.18 xmlpull diff --git a/src/main/java/de/scrum_master/galileo/Book.java b/src/main/java/de/scrum_master/galileo/Book.java index ee73a17..d625624 100644 --- a/src/main/java/de/scrum_master/galileo/Book.java +++ b/src/main/java/de/scrum_master/galileo/Book.java @@ -7,6 +7,7 @@ import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.DomDriver; +import com.thoughtworks.xstream.security.AnyTypePermission; import de.scrum_master.util.SimpleLogger; public class Book @@ -23,6 +24,7 @@ public class Book public final static XStream XSTREAM = new XStream(new DomDriver()); static { + XSTREAM.addPermission(AnyTypePermission.ANY); XSTREAM.alias("galileo-openbooks", TreeMap.class); XSTREAM.alias("book", Book.class); XSTREAM.alias("id", String.class);