-
Bug
-
Resolution: Fixed
-
P3
-
22
-
b05
-
x86
-
linux_ubuntu
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8323308 | 22.0.1 | Joe Wang | P3 | Resolved | Fixed | b02 |
JDK-8323013 | 22 | Joe Wang | P3 | Resolved | Fixed | b31 |
When running tests with JDK 22, there is a failure because XMLInputFactory.getProperty() now returns the String "false", instead of Boolean.FALSE.
This looks like a change in behavior from JDK 21 to current JDK 22 early-access builds. Tested with JDK jdk-22-ea+18 and current jdk-22-ea+27.
The following simple unit-test works in JDK 8 - 21, but fails in early access builds of JDK 22 and JDK 23.
{noformat}
import static javax.xml.stream.XMLInputFactory.SUPPORT_DTD;
import static org.junit.jupiter.api.Assertions.assertFalse;
import javax.xml.stream.XMLInputFactory;
import org.junit.jupiter.api.Test;
public class TestXMLHelper {
@Test
public void testNewXMLInputFactory() {
XMLInputFactory factory = XMLInputFactory.newInstance();
factory.setProperty(SUPPORT_DTD, false);
assertFalse((boolean)factory.getProperty(XMLInputFactory.SUPPORT_DTD));
}
}
{noformat}
Since JDK 22 early access builds it fails with the following:
{noformat}
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Boolean (java.lang.String and java.lang.Boolean are in module java.base of loader 'bootstrap')
at org.apache.poi.util.TestXMLHelper.testNewXMLInputFactory(TestXMLHelper.java:32)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
{noformat}
- backported by
-
JDK-8323013 Return value of XMLInputFactory.getProperty() changed from boolean to String in JDK 22 early access builds
- Resolved
-
JDK-8323308 Return value of XMLInputFactory.getProperty() changed from boolean to String in JDK 22 early access builds
- Resolved
- duplicates
-
JDK-8322216 Regression in feature support in SAXParser and SAXParserFactory
- Closed
- relates to
-
JDK-8306632 Add a JDK Property for specifying DTD support
- Resolved
- links to
-
Commit openjdk/jdk22/b1219319
-
Commit openjdk/jdk/755722ce
-
Review openjdk/jdk22/32
-
Review openjdk/jdk/17252