Changeset 13901 in josm for trunk/src/org/openstreetmap/josm/data/preferences
- Timestamp:
- 2018-06-08T22:43:20+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/preferences/PreferencesReader.java
r13715 r13901 21 21 22 22 import javax.xml.XMLConstants; 23 import javax.xml.stream.XMLInputFactory;24 23 import javax.xml.stream.XMLStreamConstants; 25 24 import javax.xml.stream.XMLStreamException; … … 37 36 import org.openstreetmap.josm.spi.preferences.StringSetting; 38 37 import org.openstreetmap.josm.tools.Logging; 39 import org.openstreetmap.josm.tools.Utils; 38 import org.openstreetmap.josm.tools.XmlUtils; 40 39 import org.xml.sax.SAXException; 41 40 … … 97 96 public static void validateXML(Reader in) throws IOException, SAXException { 98 97 try (CachedFile cf = new CachedFile("resource://data/preferences.xsd"); InputStream xsdStream = cf.getInputStream()) { 99 Schema schema = Utils.newXmlSchemaFactory().newSchema(new StreamSource(xsdStream)); 98 Schema schema = XmlUtils.newXmlSchemaFactory().newSchema(new StreamSource(xsdStream)); 100 99 Validator validator = schema.newValidator(); 101 100 validator.validate(new StreamSource(in)); … … 127 126 public void parse() throws XMLStreamException, IOException { 128 127 if (reader != null) { 129 this.parser = XMLInputFactory .newInstance().createXMLStreamReader(reader);128 this.parser = XmlUtils.newSafeXMLInputFactory().createXMLStreamReader(reader); 130 129 doParse(); 131 130 } else { 132 131 try (BufferedReader in = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8)) { 133 this.parser = XMLInputFactory .newInstance().createXMLStreamReader(in);132 this.parser = XmlUtils.newSafeXMLInputFactory().createXMLStreamReader(in); 134 133 doParse(); 135 134 }
Note:
See TracChangeset
for help on using the changeset viewer.