mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] resets XML input factory key to original value after factory instantiation (IDEA-206607)
This commit is contained in:
@@ -41,13 +41,22 @@ public class JDOMUtil {
|
||||
}
|
||||
};
|
||||
|
||||
private static final String XML_INPUT_FACTORY_KEY = "javax.xml.stream.XMLInputFactory";
|
||||
private static final String XML_INPUT_FACTORY_IMPL = "com.sun.xml.internal.stream.XMLInputFactoryImpl";
|
||||
private static final NotNullLazyValue<XMLInputFactory> XML_INPUT_FACTORY = new NotNullLazyValue<XMLInputFactory>() {
|
||||
@NotNull
|
||||
@Override
|
||||
protected XMLInputFactory compute() {
|
||||
// requests default JRE factory implementation instead of an incompatible one from the classpath
|
||||
System.setProperty("javax.xml.stream.XMLInputFactory", "com.sun.xml.internal.stream.XMLInputFactoryImpl");
|
||||
XMLInputFactory factory = XMLInputFactory.newFactory();
|
||||
String property = System.setProperty(XML_INPUT_FACTORY_KEY, XML_INPUT_FACTORY_IMPL);
|
||||
XMLInputFactory factory;
|
||||
try {
|
||||
factory = XMLInputFactory.newFactory();
|
||||
}
|
||||
finally {
|
||||
if (property != null) System.setProperty(XML_INPUT_FACTORY_KEY, property);
|
||||
else System.clearProperty(XML_INPUT_FACTORY_KEY);
|
||||
}
|
||||
if (!SystemInfo.isIbmJvm) {
|
||||
try {
|
||||
factory.setProperty("http://java.sun.com/xml/stream/properties/report-cdata-event", true);
|
||||
|
||||
Reference in New Issue
Block a user