Changeset 10741 in josm


Ignore:
Timestamp:
2016-08-06T00:00:24+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11924 - XMLReaderFactory has been deprecated in Java 9, see https://bugs.openjdk.java.net/browse/JDK-8152912

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/kitfox/svg/SVGUniverse.java

    r8149 r10741  
    6363import javax.imageio.ImageIO;
    6464import javax.xml.bind.DatatypeConverter;
     65import javax.xml.parsers.ParserConfigurationException;
     66import javax.xml.parsers.SAXParserFactory;
    6567import org.xml.sax.EntityResolver;
    6668import org.xml.sax.InputSource;
     
    6870import org.xml.sax.SAXParseException;
    6971import org.xml.sax.XMLReader;
    70 import org.xml.sax.helpers.XMLReaderFactory;
    7172
    7273/**
     
    574575    }
    575576
    576     private XMLReader getXMLReaderCached() throws SAXException
     577    private XMLReader getXMLReaderCached() throws SAXException, ParserConfigurationException
    577578    {
    578579        if (cachedReader == null)
    579580        {
    580             cachedReader = XMLReaderFactory.createXMLReader();
     581            SAXParserFactory factory = SAXParserFactory.newInstance();
     582            factory.setNamespaceAware(true);
     583            cachedReader = factory.newSAXParser().getXMLReader();
    581584        }
    582585        return cachedReader;
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r10731 r10741  
    5656import javax.swing.ImageIcon;
    5757import javax.xml.bind.DatatypeConverter;
     58import javax.xml.parsers.ParserConfigurationException;
    5859
    5960import org.openstreetmap.josm.Main;
     
    8081import org.xml.sax.XMLReader;
    8182import org.xml.sax.helpers.DefaultHandler;
    82 import org.xml.sax.helpers.XMLReaderFactory;
    8383
    8484import com.kitfox.svg.SVGDiagram;
     
    12161216    private static String getImgUrlFromWikiInfoPage(final String base, final String fn) {
    12171217        try {
    1218             final XMLReader parser = XMLReaderFactory.createXMLReader();
     1218            final XMLReader parser = Utils.newSafeSAXParser().getXMLReader();
    12191219            parser.setContentHandler(new DefaultHandler() {
    12201220                @Override
     
    12391239            Main.trace(r);
    12401240            return r.getResult();
    1241         } catch (IOException | SAXException e) {
     1241        } catch (IOException | SAXException | ParserConfigurationException e) {
    12421242            Main.warn("Parsing " + base + fn + " failed:\n" + e);
    12431243            return null;
Note: See TracChangeset for help on using the changeset viewer.