Changeset 19048 in josm for trunk/src/org/openstreetmap/josm/io/NoteReader.java
- Timestamp:
- 2024-04-19T16:21:11+02:00 (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/NoteReader.java
r17712 r19048 52 52 * Reads both API style and planet dump style formats. 53 53 */ 54 private class Parser extends DefaultHandler {54 private final class Parser extends DefaultHandler { 55 55 56 56 private NoteParseMode parseMode; … … 73 73 public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { 74 74 buffer.setLength(0); 75 switch (qName) {75 switch (qName) { 76 76 case "osm": 77 77 parseMode = NoteParseMode.API; … … 92 92 93 93 //The rest only applies for dump mode 94 switch (qName) {94 switch (qName) { 95 95 case "note": 96 96 thisNote = parseNoteFull(attrs); … … 113 113 } 114 114 if ("comment".equals(qName)) { 115 User commentUser = User.createOsmUser(commentUid, commentUsername);115 final User commentUser; 116 116 if (commentUid == 0) { 117 117 commentUser = User.getAnonymous(); 118 } else { 119 commentUser = User.createOsmUser(commentUid, commentUsername); 118 120 } 119 121 if (parseMode == NoteParseMode.API) { … … 177 179 178 180 static LatLon parseLatLon(UnaryOperator<String> attrs) { 179 doublelat = Double.parseDouble(attrs.apply("lat"));180 doublelon = Double.parseDouble(attrs.apply("lon"));181 final var lat = Double.parseDouble(attrs.apply("lat")); 182 final var lon = Double.parseDouble(attrs.apply("lon")); 181 183 return new LatLon(lat, lon); 182 184 } … … 195 197 196 198 static Note parseNoteFull(UnaryOperator<String> attrs) { 197 Notenote = parseNoteBasic(attrs);199 final var note = parseNoteBasic(attrs); 198 200 String id = attrs.apply("id"); 199 201 if (id != null) {
Note:
See TracChangeset
for help on using the changeset viewer.