Changeset 9603 in josm
- Timestamp:
- 2016-01-24T02:07:12+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r9095 r9603 105 105 106 106 private static class Layer { 107 private String format; 108 private String name; 109 private TileMatrixSet tileMatrixSet; 110 private String baseUrl; 111 private String style; 112 public Collection<String> tileMatrixSetLinks = new ArrayList<>(); 113 107 114 Layer(Layer l) { 108 115 if (l != null) { … … 117 124 Layer() { 118 125 } 119 120 private String format;121 private String name;122 private TileMatrixSet tileMatrixSet;123 private String baseUrl;124 private String style;125 public Collection<String> tileMatrixSetLinks = new ArrayList<>();126 126 } 127 127 … … 151 151 152 152 private static final class SelectLayerDialog extends ExtendedDialog { 153 private final Layer[] layers;153 private final transient Layer[] layers; 154 154 private final JTable list; 155 155 … … 256 256 private String handleTemplate(String url) { 257 257 Pattern pattern = Pattern.compile(PATTERN_HEADER); 258 StringBuffer output = new StringBuffer(); 258 StringBuffer output = new StringBuffer(); // NOSONAR 259 259 Matcher matcher = pattern.matcher(url); 260 260 while (matcher.find()) { … … 278 278 throw new IllegalArgumentException("Could not read data from: " + baseUrl); 279 279 } 280 XMLStreamReader reader = factory.createXMLStreamReader( 281 new ByteArrayInputStream(data) 282 ); 280 XMLStreamReader reader = factory.createXMLStreamReader(new ByteArrayInputStream(data)); 283 281 284 282 Collection<Layer> ret = null; … … 509 507 */ 510 508 private static TransferMode getTransferMode(XMLStreamReader reader) throws XMLStreamException { 511 QName GET_QNAME= new QName(OWS_NS_URL, "Get");512 513 Utils.ensure( GET_QNAME.equals(reader.getName()), "WMTS Parser state invalid. Expected element %s, got %s",514 GET_QNAME, reader.getName());509 QName getQname = new QName(OWS_NS_URL, "Get"); 510 511 Utils.ensure(getQname.equals(reader.getName()), "WMTS Parser state invalid. Expected element %s, got %s", 512 getQname, reader.getName()); 515 513 for (int event = reader.getEventType(); 516 reader.hasNext() && !(event == XMLStreamReader.END_ELEMENT && GET_QNAME.equals(reader.getName()));514 reader.hasNext() && !(event == XMLStreamReader.END_ELEMENT && getQname.equals(reader.getName())); 517 515 event = reader.next()) { 518 if (event == XMLStreamReader.START_ELEMENT && new QName(OWS_NS_URL, "Constraint").equals(reader.getName())) { 519 if ("GetEncoding".equals(reader.getAttributeValue("", "name"))) { 520 moveReaderToTag(reader, new QName[]{ 521 new QName(OWS_NS_URL, "AllowedValues"), 522 new QName(OWS_NS_URL, "Value") 523 }); 524 return TransferMode.fromString(reader.getElementText()); 525 } 516 if (event == XMLStreamReader.START_ELEMENT && new QName(OWS_NS_URL, "Constraint").equals(reader.getName()) 517 && "GetEncoding".equals(reader.getAttributeValue("", "name"))) { 518 moveReaderToTag(reader, new QName[]{ 519 new QName(OWS_NS_URL, "AllowedValues"), 520 new QName(OWS_NS_URL, "Value") 521 }); 522 return TransferMode.fromString(reader.getElementText()); 526 523 } 527 524 } … … 565 562 } 566 563 567 if (event == XMLStreamReader.END_ELEMENT) { 568 if (parentTag != null && parentTag.equals(reader.getName())) { 569 currentLevel -= 1; 570 searchTag = parentTag; 571 if (currentLevel >= 0) { 572 parentTag = tags[currentLevel]; 573 } else { 574 parentTag = null; 575 } 564 if (event == XMLStreamReader.END_ELEMENT && parentTag != null && parentTag.equals(reader.getName())) { 565 currentLevel -= 1; 566 searchTag = parentTag; 567 if (currentLevel >= 0) { 568 parentTag = tags[currentLevel]; 569 } else { 570 parentTag = null; 576 571 } 577 572 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r9398 r9603 502 502 503 503 @Override 504 @SuppressWarnings("resource") 504 505 public CachedFile getCachedFile() throws IOException { 505 return new CachedFile(url).setHttpAccept(MAPCSS_STYLE_MIME_TYPES); 506 return new CachedFile(url).setHttpAccept(MAPCSS_STYLE_MIME_TYPES); // NOSONAR 506 507 } 507 508 -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
r9243 r9603 117 117 118 118 @Override 119 @SuppressWarnings("resource") 119 120 public CachedFile getCachedFile() throws IOException { 120 return new CachedFile(url).setHttpAccept(XML_STYLE_MIME_TYPES); 121 return new CachedFile(url).setHttpAccept(XML_STYLE_MIME_TYPES); // NOSONAR 121 122 } 122 123
Note:
See TracChangeset
for help on using the changeset viewer.