Skip to content

Commit 25375cc

Browse files
committed
Upgrade XStream to version 1.4.19
This commit also improves the XStreamUnmarshallingTests
1 parent 9cbde4e commit 25375cc

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<jakarta.persistence-api.version>3.0.0</jakarta.persistence-api.version>
7676
<neo4j-ogm-core.version>3.2.28</neo4j-ogm-core.version>
7777
<mongodb-driver-sync.version>4.5.0</mongodb-driver-sync.version>
78-
<xstream.version>1.4.18</xstream.version>
78+
<xstream.version>1.4.19</xstream.version>
7979
<junit-jupiter.version>5.8.2</junit-jupiter.version>
8080

8181
<!-- test dependencies -->

spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2021 the original author or authors.
2+
* Copyright 2010-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,9 +19,7 @@
1919
import java.util.HashMap;
2020
import java.util.Map;
2121

22-
import com.thoughtworks.xstream.security.ArrayTypePermission;
2322
import com.thoughtworks.xstream.security.ExplicitTypePermission;
24-
import com.thoughtworks.xstream.security.WildcardTypePermission;
2523

2624
import org.springframework.batch.item.xml.domain.Trade;
2725
import org.springframework.oxm.Unmarshaller;
@@ -30,19 +28,16 @@
3028
public class XStreamUnmarshallingTests extends AbstractStaxEventReaderItemReaderTests {
3129

3230
@Override
33-
protected Unmarshaller getUnmarshaller() throws Exception {
31+
protected Unmarshaller getUnmarshaller() {
3432
XStreamMarshaller unmarshaller = new XStreamMarshaller();
3533
Map<String,Class<?>> aliasesMap = new HashMap<>();
3634
aliasesMap.put("trade", Trade.class);
3735
aliasesMap.put("isin", String.class);
3836
aliasesMap.put("customer", String.class);
3937
aliasesMap.put("price", BigDecimal.class);
40-
/*unmarshaller.addAlias("trade", Trade.class);
41-
unmarshaller.addAlias("isin", String.class);
42-
unmarshaller.addAlias("customer", String.class);
43-
unmarshaller.addAlias("price", BigDecimal.class);*/
4438
unmarshaller.setAliases(aliasesMap);
45-
unmarshaller.setTypePermissions(new ExplicitTypePermission(new String[]{"org.springframework.batch.item.xml.domain.Trade"}));
39+
ExplicitTypePermission typePermission = new ExplicitTypePermission(new Class[]{Trade.class});
40+
unmarshaller.setTypePermissions(typePermission);
4641
return unmarshaller;
4742
}
4843

0 commit comments

Comments
 (0)