Changeset 13901 in josm for trunk/src/org


Ignore:
Timestamp:
2018-06-08T22:43:20+02:00 (6 years ago)
Author:
Don-vip
Message:

add new XmlUtils class with more "safe factories" methods

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelper.java

    r13828 r13901  
    99
    1010import javax.xml.namespace.QName;
    11 import javax.xml.stream.XMLInputFactory;
    1211import javax.xml.stream.XMLStreamException;
    1312import javax.xml.stream.XMLStreamReader;
    1413
    1514import org.openstreetmap.josm.tools.Utils;
     15import org.openstreetmap.josm.tools.XmlUtils;
    1616
    1717/**
     
    8282     */
    8383    public static XMLStreamReader getReader(InputStream in) throws XMLStreamException {
    84         XMLInputFactory factory = XMLInputFactory.newInstance();
    85         // do not try to load external entities, nor validate the XML
    86         factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
    87         factory.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
    88         factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
    89         return factory.createXMLStreamReader(in);
     84        return XmlUtils.newSafeXMLInputFactory().createXMLStreamReader(in);
    9085    }
    9186
  • trunk/src/org/openstreetmap/josm/data/preferences/PreferencesReader.java

    r13715 r13901  
    2121
    2222import javax.xml.XMLConstants;
    23 import javax.xml.stream.XMLInputFactory;
    2423import javax.xml.stream.XMLStreamConstants;
    2524import javax.xml.stream.XMLStreamException;
     
    3736import org.openstreetmap.josm.spi.preferences.StringSetting;
    3837import org.openstreetmap.josm.tools.Logging;
    39 import org.openstreetmap.josm.tools.Utils;
     38import org.openstreetmap.josm.tools.XmlUtils;
    4039import org.xml.sax.SAXException;
    4140
     
    9796    public static void validateXML(Reader in) throws IOException, SAXException {
    9897        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));
    10099            Validator validator = schema.newValidator();
    101100            validator.validate(new StreamSource(in));
     
    127126    public void parse() throws XMLStreamException, IOException {
    128127        if (reader != null) {
    129             this.parser = XMLInputFactory.newInstance().createXMLStreamReader(reader);
     128            this.parser = XmlUtils.newSafeXMLInputFactory().createXMLStreamReader(reader);
    130129            doParse();
    131130        } else {
    132131            try (BufferedReader in = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8)) {
    133                 this.parser = XMLInputFactory.newInstance().createXMLStreamReader(in);
     132                this.parser = XmlUtils.newSafeXMLInputFactory().createXMLStreamReader(in);
    134133                doParse();
    135134            }
  • trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java

    r13331 r13901  
    3535import javax.xml.transform.Transformer;
    3636import javax.xml.transform.TransformerException;
    37 import javax.xml.transform.TransformerFactory;
    3837import javax.xml.transform.TransformerFactoryConfigurationError;
    3938import javax.xml.transform.dom.DOMSource;
     
    5352import org.openstreetmap.josm.tools.Logging;
    5453import org.openstreetmap.josm.tools.Utils;
     54import org.openstreetmap.josm.tools.XmlUtils;
    5555import org.w3c.dom.DOMException;
    5656import org.w3c.dom.Document;
     
    228228        try {
    229229            String toXML = Main.pref.toXML(true);
    230             DocumentBuilder builder = Utils.newSafeDOMBuilder();
     230            DocumentBuilder builder = XmlUtils.newSafeDOMBuilder();
    231231            document = builder.parse(new ByteArrayInputStream(toXML.getBytes(StandardCharsets.UTF_8)));
    232232            exportDocument = builder.newDocument();
     
    258258            }
    259259            File f = new File(filename);
    260             Transformer ts = TransformerFactory.newInstance().newTransformer();
     260            Transformer ts = XmlUtils.newSafeTransformerFactory().newTransformer();
    261261            ts.setOutputProperty(OutputKeys.INDENT, "yes");
    262262            ts.transform(new DOMSource(exportDocument), new StreamResult(f.toURI().getPath()));
     
    406406        public void openAndReadXML(InputStream is) {
    407407            try {
    408                 Document document = Utils.parseSafeDOM(is);
     408                Document document = XmlUtils.parseSafeDOM(is);
    409409                synchronized (CustomConfigurator.class) {
    410410                    processXML(document);
     
    681681            Preferences tmpPref = new Preferences();
    682682            try {
    683                 Transformer xformer = TransformerFactory.newInstance().newTransformer();
     683                Transformer xformer = XmlUtils.newSafeTransformerFactory().newTransformer();
    684684                CharArrayWriter outputWriter = new CharArrayWriter(8192);
    685685                StreamResult out = new StreamResult(outputWriter);
  • trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java

    r12620 r13901  
    2727import org.openstreetmap.josm.tools.Utils;
    2828import org.openstreetmap.josm.tools.XmlParsingException;
     29import org.openstreetmap.josm.tools.XmlUtils;
    2930import org.w3c.dom.Document;
    3031import org.xml.sax.SAXException;
     
    124125                throw new OsmApiException(connection.getResponse().getResponseCode(),
    125126                        connection.getResponse().getHeaderField("Error"), null);
    126             Document d = Utils.parseSafeDOM(connection.getResponse().getContent());
     127            Document d = XmlUtils.parseSafeDOM(connection.getResponse().getContent());
    127128            return OsmServerUserInfoReader.buildFromXML(d);
    128129        } catch (SAXException | ParserConfigurationException e) {
  • trunk/src/org/openstreetmap/josm/io/Capabilities.java

    r13120 r13901  
    1414
    1515import org.openstreetmap.josm.tools.Logging;
    16 import org.openstreetmap.josm.tools.Utils;
     16import org.openstreetmap.josm.tools.XmlUtils;
    1717import org.xml.sax.Attributes;
    1818import org.xml.sax.InputSource;
     
    274274        public static Capabilities parse(InputSource inputSource) throws SAXException, IOException, ParserConfigurationException {
    275275            CapabilitiesParser parser = new CapabilitiesParser();
    276             Utils.parseSafeSAX(inputSource, parser);
     276            XmlUtils.parseSafeSAX(inputSource, parser);
    277277            return parser.getCapabilities();
    278278        }
  • trunk/src/org/openstreetmap/josm/io/DiffResultProcessor.java

    r13453 r13901  
    2828import org.openstreetmap.josm.tools.Utils;
    2929import org.openstreetmap.josm.tools.XmlParsingException;
     30import org.openstreetmap.josm.tools.XmlUtils;
    3031import org.xml.sax.Attributes;
    3132import org.xml.sax.InputSource;
     
    9293            progressMonitor.beginTask(tr("Parsing response from server..."));
    9394            InputSource inputSource = new InputSource(new StringReader(diffUploadResponse));
    94             Utils.parseSafeSAX(inputSource, new Parser());
     95            XmlUtils.parseSafeSAX(inputSource, new Parser());
    9596        } catch (XmlParsingException e) {
    9697            throw e;
  • trunk/src/org/openstreetmap/josm/io/GpxReader.java

    r13194 r13901  
    2727import org.openstreetmap.josm.data.gpx.WayPoint;
    2828import org.openstreetmap.josm.tools.Logging;
    29 import org.openstreetmap.josm.tools.Utils;
     29import org.openstreetmap.josm.tools.XmlUtils;
    3030import org.xml.sax.Attributes;
    3131import org.xml.sax.InputSource;
     
    582582        Parser parser = new Parser();
    583583        try {
    584             Utils.parseSafeSAX(inputSource, parser);
     584            XmlUtils.parseSafeSAX(inputSource, parser);
    585585            return true;
    586586        } catch (SAXException e) {
  • trunk/src/org/openstreetmap/josm/io/NameFinder.java

    r12620 r13901  
    2424import org.openstreetmap.josm.tools.UncheckedParseException;
    2525import org.openstreetmap.josm.tools.Utils;
     26import org.openstreetmap.josm.tools.XmlUtils;
    2627import org.xml.sax.Attributes;
    2728import org.xml.sax.InputSource;
     
    8990        InputSource inputSource = new InputSource(reader);
    9091        NameFinderResultParser parser = new NameFinderResultParser();
    91         Utils.parseSafeSAX(inputSource, parser);
     92        XmlUtils.parseSafeSAX(inputSource, parser);
    9293        return parser.getResult();
    9394    }
  • trunk/src/org/openstreetmap/josm/io/NoteReader.java

    r12620 r13901  
    2020import org.openstreetmap.josm.data.osm.User;
    2121import org.openstreetmap.josm.tools.Logging;
    22 import org.openstreetmap.josm.tools.Utils;
     22import org.openstreetmap.josm.tools.XmlUtils;
    2323import org.openstreetmap.josm.tools.date.DateUtils;
    2424import org.xml.sax.Attributes;
     
    216216        DefaultHandler parser = new Parser();
    217217        try {
    218             Utils.parseSafeSAX(inputSource, parser);
     218            XmlUtils.parseSafeSAX(inputSource, parser);
    219219        } catch (ParserConfigurationException e) {
    220220            Logging.error(e); // broken SAXException chaining
  • trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java

    r12620 r13901  
    1818import org.openstreetmap.josm.tools.CheckParameterUtil;
    1919import org.openstreetmap.josm.tools.Logging;
    20 import org.openstreetmap.josm.tools.Utils;
    2120import org.openstreetmap.josm.tools.XmlParsingException;
     21import org.openstreetmap.josm.tools.XmlUtils;
    2222import org.xml.sax.Attributes;
    2323import org.xml.sax.InputSource;
     
    153153            progressMonitor.beginTask("");
    154154            progressMonitor.indeterminateSubTask(tr("Parsing changeset content ..."));
    155             Utils.parseSafeSAX(source, new Parser());
     155            XmlUtils.parseSafeSAX(source, new Parser());
    156156        } catch (XmlParsingException e) {
    157157            throw e;
  • trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java

    r12495 r13901  
    2020import org.openstreetmap.josm.data.osm.User;
    2121import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    22 import org.openstreetmap.josm.tools.Utils;
    2322import org.openstreetmap.josm.tools.XmlParsingException;
     23import org.openstreetmap.josm.tools.XmlUtils;
    2424import org.openstreetmap.josm.tools.date.DateUtils;
    2525import org.xml.sax.Attributes;
     
    280280            progressMonitor.indeterminateSubTask(tr("Parsing list of changesets..."));
    281281            InputSource inputSource = new InputSource(new InvalidXmlCharacterFilter(new InputStreamReader(source, StandardCharsets.UTF_8)));
    282             Utils.parseSafeSAX(inputSource, parser.new Parser());
     282            XmlUtils.parseSafeSAX(inputSource, parser.new Parser());
    283283            return parser.getChangesets();
    284284        } catch (ParserConfigurationException | SAXException e) {
  • trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java

    r12620 r13901  
    1717import org.openstreetmap.josm.tools.CheckParameterUtil;
    1818import org.openstreetmap.josm.tools.Logging;
    19 import org.openstreetmap.josm.tools.Utils;
     19import org.openstreetmap.josm.tools.XmlUtils;
    2020import org.xml.sax.Attributes;
    2121import org.xml.sax.InputSource;
     
    9292        progressMonitor.beginTask(tr("Parsing OSM history data ..."));
    9393        try {
    94             Utils.parseSafeSAX(inputSource, new Parser());
     94            XmlUtils.parseSafeSAX(inputSource, new Parser());
    9595        } catch (ParserConfigurationException e) {
    9696            Logging.error(e); // broken SAXException chaining
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r13559 r13901  
    1717
    1818import javax.xml.stream.Location;
    19 import javax.xml.stream.XMLInputFactory;
    2019import javax.xml.stream.XMLStreamConstants;
    2120import javax.xml.stream.XMLStreamException;
     
    2928import org.openstreetmap.josm.data.osm.DataSet;
    3029import org.openstreetmap.josm.data.osm.DownloadPolicy;
    31 import org.openstreetmap.josm.data.osm.UploadPolicy;
    3230import org.openstreetmap.josm.data.osm.Node;
    3331import org.openstreetmap.josm.data.osm.NodeData;
     
    3836import org.openstreetmap.josm.data.osm.RelationMemberData;
    3937import org.openstreetmap.josm.data.osm.Tagged;
     38import org.openstreetmap.josm.data.osm.UploadPolicy;
    4039import org.openstreetmap.josm.data.osm.User;
    4140import org.openstreetmap.josm.data.osm.Way;
     
    4746import org.openstreetmap.josm.tools.UncheckedParseException;
    4847import org.openstreetmap.josm.tools.Utils;
     48import org.openstreetmap.josm.tools.XmlUtils;
    4949import org.openstreetmap.josm.tools.date.DateUtils;
    5050
     
    619619
    620620            try (InputStreamReader ir = UTFInputStreamReader.create(source)) {
    621                 XMLInputFactory factory = XMLInputFactory.newInstance();
    622                 // do not try to load external entities
    623                 factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
    624                 factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
    625                 setParser(factory.createXMLStreamReader(ir));
     621                setParser(XmlUtils.newSafeXMLInputFactory().createXMLStreamReader(ir));
    626622                parse();
    627623            }
  • trunk/src/org/openstreetmap/josm/io/OsmServerReader.java

    r13499 r13901  
    2525import org.openstreetmap.josm.tools.Utils;
    2626import org.openstreetmap.josm.tools.XmlParsingException;
     27import org.openstreetmap.josm.tools.XmlUtils;
    2728import org.w3c.dom.Document;
    2829import org.w3c.dom.Node;
     
    503504            monitor.indeterminateSubTask(subtask);
    504505            try (InputStream in = getInputStream(api, monitor.createSubTaskMonitor(1, true), reason)) {
    505                 return parser.parse(Utils.parseSafeDOM(in));
     506                return parser.parse(XmlUtils.parseSafeDOM(in));
    506507            }
    507508        } catch (OsmTransferException e) {
  • trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java

    r13796 r13901  
    2828import org.openstreetmap.josm.tools.MultiMap;
    2929import org.openstreetmap.josm.tools.Utils;
     30import org.openstreetmap.josm.tools.XmlUtils;
    3031import org.xml.sax.Attributes;
    3132import org.xml.sax.InputSource;
     
    9798                    .getContentReader()) {
    9899                InputSource is = new InputSource(in);
    99                 Utils.parseSafeSAX(is, parser);
     100                XmlUtils.parseSafeSAX(is, parser);
    100101                return parser.entries;
    101102            }
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r13204 r13901  
    4848import org.openstreetmap.josm.tools.MultiMap;
    4949import org.openstreetmap.josm.tools.Utils;
     50import org.openstreetmap.josm.tools.XmlUtils;
    5051import org.w3c.dom.Document;
    5152import org.w3c.dom.Element;
     
    742743
    743744        try {
    744             parseJos(Utils.parseSafeDOM(josIS), progressMonitor);
     745            parseJos(XmlUtils.parseSafeDOM(josIS), progressMonitor);
    745746        } catch (SAXException e) {
    746747            throw new IllegalDataException(e);
  • trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java

    r13204 r13901  
    2323import javax.xml.transform.Transformer;
    2424import javax.xml.transform.TransformerException;
    25 import javax.xml.transform.TransformerFactory;
    2625import javax.xml.transform.dom.DOMSource;
    2726import javax.xml.transform.stream.StreamResult;
     
    4645import org.openstreetmap.josm.tools.MultiMap;
    4746import org.openstreetmap.josm.tools.Utils;
     47import org.openstreetmap.josm.tools.XmlUtils;
    4848import org.w3c.dom.Document;
    4949import org.w3c.dom.Element;
     
    206206        DocumentBuilder builder = null;
    207207        try {
    208             builder = Utils.newSafeDOMBuilder();
     208            builder = XmlUtils.newSafeDOMBuilder();
    209209        } catch (ParserConfigurationException e) {
    210210            throw new IOException(e);
     
    311311            OutputStreamWriter writer = new OutputStreamWriter(out, StandardCharsets.UTF_8);
    312312            writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
    313             TransformerFactory transfac = TransformerFactory.newInstance();
    314             Transformer trans = transfac.newTransformer();
     313            Transformer trans = XmlUtils.newSafeTransformerFactory().newTransformer();
    315314            trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
    316315            trans.setOutputProperty(OutputKeys.INDENT, "yes");
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r13869 r13901  
    12671267    private static String getImgUrlFromWikiInfoPage(final String base, final String fn) {
    12681268        try {
    1269             final XMLReader parser = Utils.newSafeSAXParser().getXMLReader();
     1269            final XMLReader parser = XmlUtils.newSafeSAXParser().getXMLReader();
    12701270            parser.setContentHandler(new DefaultHandler() {
    12711271                @Override
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r13838 r13901  
    6767import javax.script.ScriptEngine;
    6868import javax.script.ScriptEngineManager;
    69 import javax.xml.XMLConstants;
    7069import javax.xml.parsers.DocumentBuilder;
    71 import javax.xml.parsers.DocumentBuilderFactory;
    7270import javax.xml.parsers.ParserConfigurationException;
    7371import javax.xml.parsers.SAXParser;
    74 import javax.xml.parsers.SAXParserFactory;
    7572import javax.xml.validation.SchemaFactory;
    76 import javax.xml.validation.SchemaFactoryConfigurationError;
    7773
    7874import org.openstreetmap.josm.spi.preferences.Config;
     
    13391335     * Returns the W3C XML Schema factory implementation. Robust method dealing with ContextClassLoader problems.
    13401336     * @return the W3C XML Schema factory implementation
     1337     * @deprecated Use {@link XmlUtils#newXmlSchemaFactory}
    13411338     * @since 13715
    13421339     */
     1340    @Deprecated
    13431341    public static SchemaFactory newXmlSchemaFactory() {
    1344         try {
    1345             return SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    1346         } catch (SchemaFactoryConfigurationError e) {
    1347             Logging.debug(e);
    1348             // Can happen with icedtea-web. Use workaround from https://issues.apache.org/jira/browse/GERONIMO-6185
    1349             Thread currentThread = Thread.currentThread();
    1350             ClassLoader old = currentThread.getContextClassLoader();
    1351             currentThread.setContextClassLoader(null);
    1352             try {
    1353                 return SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    1354             } finally {
    1355                 currentThread.setContextClassLoader(old);
    1356             }
    1357         }
     1342        return XmlUtils.newXmlSchemaFactory();
    13581343    }
    13591344
     
    13621347     * @return a new secure DOM builder, supporting XML namespaces
    13631348     * @throws ParserConfigurationException if a parser cannot be created which satisfies the requested configuration.
     1349     * @deprecated Use {@link XmlUtils#newSafeDOMBuilder}
    13641350     * @since 10404
    13651351     */
     1352    @Deprecated
    13661353    public static DocumentBuilder newSafeDOMBuilder() throws ParserConfigurationException {
    1367         DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
    1368         builderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
    1369         builderFactory.setNamespaceAware(true);
    1370         builderFactory.setValidating(false);
    1371         return builderFactory.newDocumentBuilder();
     1354        return XmlUtils.newSafeDOMBuilder();
    13721355    }
    13731356
     
    13811364     * @throws IOException if any IO errors occur.
    13821365     * @throws SAXException for SAX errors.
     1366     * @deprecated Use {@link XmlUtils#parseSafeDOM}
    13831367     * @since 10404
    13841368     */
     1369    @Deprecated
    13851370    public static Document parseSafeDOM(InputStream is) throws ParserConfigurationException, IOException, SAXException {
    1386         long start = System.currentTimeMillis();
    1387         Logging.debug("Starting DOM parsing of {0}", is);
    1388         Document result = newSafeDOMBuilder().parse(is);
    1389         if (Logging.isDebugEnabled()) {
    1390             Logging.debug("DOM parsing done in {0}", getDurationString(System.currentTimeMillis() - start));
    1391         }
    1392         return result;
     1371        return XmlUtils.parseSafeDOM(is);
    13931372    }
    13941373
     
    13981377     * @throws ParserConfigurationException if a parser cannot be created which satisfies the requested configuration.
    13991378     * @throws SAXException for SAX errors.
     1379     * @deprecated Use {@link XmlUtils#newSafeSAXParser}
    14001380     * @since 8287
    14011381     */
     1382    @Deprecated
    14021383    public static SAXParser newSafeSAXParser() throws ParserConfigurationException, SAXException {
    1403         SAXParserFactory parserFactory = SAXParserFactory.newInstance();
    1404         parserFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
    1405         parserFactory.setNamespaceAware(true);
    1406         return parserFactory.newSAXParser();
     1384        return XmlUtils.newSafeSAXParser();
    14071385    }
    14081386
     
    14161394     * @throws SAXException for SAX errors.
    14171395     * @throws IOException if any IO errors occur.
     1396     * @deprecated Use {@link XmlUtils#parseSafeSAX}
    14181397     * @since 8347
    14191398     */
     1399    @Deprecated
    14201400    public static void parseSafeSAX(InputSource is, DefaultHandler dh) throws ParserConfigurationException, SAXException, IOException {
    1421         long start = System.currentTimeMillis();
    1422         Logging.debug("Starting SAX parsing of {0} using {1}", is, dh);
    1423         newSafeSAXParser().parse(is, dh);
    1424         if (Logging.isDebugEnabled()) {
    1425             Logging.debug("SAX parsing done in {0}", getDurationString(System.currentTimeMillis() - start));
    1426         }
     1401        XmlUtils.parseSafeSAX(is, dh);
    14271402    }
    14281403
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r13715 r13901  
    245245    private Iterable<Object> start(final Reader in, final ContentHandler contentHandler) throws SAXException, IOException {
    246246        try {
    247             XMLReader reader = Utils.newSafeSAXParser().getXMLReader();
     247            XMLReader reader = XmlUtils.newSafeSAXParser().getXMLReader();
    248248            reader.setContentHandler(contentHandler);
    249249            try {
     
    285285     */
    286286    public Iterable<Object> startWithValidation(final Reader in, String namespace, String schemaSource) throws SAXException {
    287         SchemaFactory factory = Utils.newXmlSchemaFactory();
     287        SchemaFactory factory = XmlUtils.newXmlSchemaFactory();
    288288        try (CachedFile cf = new CachedFile(schemaSource); InputStream mis = cf.getInputStream()) {
    289289            Schema schema = factory.newSchema(new StreamSource(mis));
  • trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportSender.java

    r12869 r13901  
    2222import org.openstreetmap.josm.tools.OpenBrowser;
    2323import org.openstreetmap.josm.tools.Utils;
     24import org.openstreetmap.josm.tools.XmlUtils;
    2425import org.w3c.dom.Document;
    2526import org.xml.sax.SAXException;
     
    127128
    128129            try (InputStream in = connection.getContent()) {
    129                 return retrieveDebugToken(Utils.parseSafeDOM(in));
     130                return retrieveDebugToken(XmlUtils.parseSafeDOM(in));
    130131            }
    131132        } catch (IOException | SAXException | ParserConfigurationException | XPathExpressionException t) {
Note: See TracChangeset for help on using the changeset viewer.