Skip to content

Commit f05d156

Browse files
authored
fail over to factory newInstance for Android support (#583)
1 parent 8377c01 commit f05d156

File tree

1 file changed

+4
-4
lines changed
  • src/main/java/com/fasterxml/jackson/dataformat/xml/util

1 file changed

+4
-4
lines changed

src/main/java/com/fasterxml/jackson/dataformat/xml/util/StaxUtil.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ public static XMLInputFactory defaultInputFactory(ClassLoader cl) {
126126
// 05-Jul-2021, tatu: as per [dataformat-xml#483], specify ClassLoader
127127
try {
128128
return XMLInputFactory.newFactory(XMLInputFactory.class.getName(), cl);
129-
} catch (FactoryConfigurationError e) {
129+
} catch (FactoryConfigurationError|NoSuchMethodError e) {
130130
// 24-Oct-2022, tatu: as per [dataformat-xml#550] need extra care
131-
return XMLInputFactory.newFactory();
131+
return XMLInputFactory.newInstance();
132132
}
133133
}
134134

@@ -139,9 +139,9 @@ public static XMLOutputFactory defaultOutputFactory(ClassLoader cl) {
139139
// 05-Jul-2021, tatu: as per [dataformat-xml#483], specify ClassLoader
140140
try {
141141
return XMLOutputFactory.newFactory(XMLOutputFactory.class.getName(), cl);
142-
} catch (FactoryConfigurationError e) {
142+
} catch (FactoryConfigurationError|NoSuchMethodError e) {
143143
// 24-Oct-2022, tatu: as per [dataformat-xml#550] need extra care
144-
return XMLOutputFactory.newFactory();
144+
return XMLOutputFactory.newInstance();
145145
}
146146
}
147147

0 commit comments

Comments
 (0)