You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow StaxEventItemReader to auto-detect the input file encoding
Before this commit, it was not possible to pass a null encoding
to the StaxEventItemReader, which prevents the XML event reader
to auto-detect the file encoding.
This commits makes the encoding setter more lenient by accepting
a null value.
Resolves#4101
Copy file name to clipboardExpand all lines: spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/builder/StaxEventItemReaderBuilder.java
+6-4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2017-2020 the original author or authors.
2
+
* Copyright 2017-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-batch-infrastructure/src/test/java/org/springframework/batch/item/xml/StaxEventItemReaderTests.java
+58-22
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2008-2020 the original author or authors.
2
+
* Copyright 2008-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -36,8 +36,10 @@
36
36
importjavax.xml.namespace.QName;
37
37
importjavax.xml.stream.FactoryConfigurationError;
38
38
importjavax.xml.stream.XMLEventReader;
39
+
importjavax.xml.stream.XMLInputFactory;
39
40
importjavax.xml.stream.XMLStreamException;
40
41
importjavax.xml.stream.events.EndElement;
42
+
importjavax.xml.stream.events.StartDocument;
41
43
importjavax.xml.stream.events.StartElement;
42
44
importjavax.xml.stream.events.XMLEvent;
43
45
importjavax.xml.transform.Source;
@@ -57,10 +59,13 @@
57
59
importstaticorg.junit.Assert.assertNull;
58
60
importstaticorg.junit.Assert.assertTrue;
59
61
importstaticorg.junit.Assert.fail;
62
+
importstaticorg.mockito.Mockito.mock;
63
+
importstaticorg.mockito.Mockito.verify;
64
+
importstaticorg.mockito.Mockito.when;
60
65
61
66
/**
62
67
* Tests for {@link StaxEventItemReader}.
63
-
*
68
+
*
64
69
* @author Robert Kasanicky
65
70
* @author Michael Minella
66
71
* @author Mahmoud Ben Hassine
@@ -94,7 +99,7 @@ public class StaxEventItemReaderTests {
0 commit comments