Changeset 8347 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2015-05-11T13:50:25+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r8318 r8347 379 379 InputSource inputSource = new InputSource(reader); 380 380 NameFinderResultParser parser = new NameFinderResultParser(); 381 Utils. newSafeSAXParser().parse(inputSource, parser);381 Utils.parseSafeSAX(inputSource, parser); 382 382 this.data = parser.getResult(); 383 383 } -
trunk/src/org/openstreetmap/josm/io/Capabilities.java
r8345 r8347 272 272 public static Capabilities parse(InputSource inputSource) throws SAXException, IOException, ParserConfigurationException { 273 273 CapabilitiesParser parser = new CapabilitiesParser(); 274 Utils. newSafeSAXParser().parse(inputSource, parser);274 Utils.parseSafeSAX(inputSource, parser); 275 275 return parser.getCapabilities(); 276 276 } -
trunk/src/org/openstreetmap/josm/io/DiffResultProcessor.java
r8346 r8347 84 84 progressMonitor.beginTask(tr("Parsing response from server...")); 85 85 InputSource inputSource = new InputSource(new StringReader(diffUploadResponse)); 86 Utils. newSafeSAXParser().parse(inputSource, new Parser());86 Utils.parseSafeSAX(inputSource, new Parser()); 87 87 } catch(XmlParsingException e) { 88 88 throw e; -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r8345 r8347 542 542 Parser parser = new Parser(); 543 543 try { 544 Utils. newSafeSAXParser().parse(inputSource, parser);544 Utils.parseSafeSAX(inputSource, parser); 545 545 return true; 546 546 } catch (SAXException e) { -
trunk/src/org/openstreetmap/josm/io/NoteReader.java
r8287 r8347 222 222 DefaultHandler parser = new Parser(); 223 223 try { 224 Utils. newSafeSAXParser().parse(inputSource, parser);224 Utils.parseSafeSAX(inputSource, parser); 225 225 } catch (ParserConfigurationException e) { 226 226 Main.error(e); // broken SAXException chaining -
trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
r8308 r8347 151 151 progressMonitor.beginTask(""); 152 152 progressMonitor.indeterminateSubTask(tr("Parsing changeset content ...")); 153 Utils. newSafeSAXParser().parse(source, new Parser());153 Utils.parseSafeSAX(source, new Parser()); 154 154 } catch(XmlParsingException e) { 155 155 throw e; -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r8291 r8347 278 278 progressMonitor.indeterminateSubTask(tr("Parsing list of changesets...")); 279 279 InputSource inputSource = new InputSource(new InvalidXmlCharacterFilter(new InputStreamReader(source, StandardCharsets.UTF_8))); 280 Utils. newSafeSAXParser().parse(inputSource, parser.new Parser());280 Utils.parseSafeSAX(inputSource, parser.new Parser()); 281 281 return parser.getChangesets(); 282 282 } catch(ParserConfigurationException | SAXException e) { -
trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java
r8308 r8347 91 91 progressMonitor.beginTask(tr("Parsing OSM history data ...")); 92 92 try { 93 Utils. newSafeSAXParser().parse(inputSource, new Parser());93 Utils.parseSafeSAX(inputSource, new Parser()); 94 94 } catch (ParserConfigurationException e) { 95 95 Main.error(e); // broken SAXException chaining -
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r8344 r8347 57 57 .getInputStream()) { 58 58 InputSource is = new InputSource(UTFInputStreamReader.create(in)); 59 Utils. newSafeSAXParser().parse(is, parser);59 Utils.parseSafeSAX(is, parser); 60 60 return parser.entries; 61 61 } -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r8308 r8347 59 59 import org.openstreetmap.josm.Main; 60 60 import org.openstreetmap.josm.data.Version; 61 import org.xml.sax.InputSource; 61 62 import org.xml.sax.SAXException; 63 import org.xml.sax.helpers.DefaultHandler; 62 64 63 65 /** … … 1227 1229 return parserFactory.newSAXParser(); 1228 1230 } 1231 1232 /** 1233 * Parse the content given {@link org.xml.sax.InputSource} as XML using the specified {@link org.xml.sax.helpers.DefaultHandler}. 1234 * This method uses a secure SAX parser, supporting XML namespaces. 1235 * 1236 * @param is The InputSource containing the content to be parsed. 1237 * @param dh The SAX DefaultHandler to use. 1238 * @throws ParserConfigurationException if a parser cannot be created which satisfies the requested configuration. 1239 * @throws SAXException for SAX errors. 1240 * @throws IOException if any IO errors occur. 1241 * @since 8347 1242 */ 1243 public static void parseSafeSAX(InputSource is, DefaultHandler dh) throws ParserConfigurationException, SAXException, IOException { 1244 long start = System.currentTimeMillis(); 1245 if (Main.isDebugEnabled()) { 1246 Main.debug("Starting SAX parsing of "+is+" using "+dh); 1247 } 1248 newSafeSAXParser().parse(is, dh); 1249 if (Main.isDebugEnabled()) { 1250 Main.debug("SAX parsing done in " + getDurationString(System.currentTimeMillis()-start)); 1251 } 1252 } 1229 1253 }
Note:
See TracChangeset
for help on using the changeset viewer.