Changeset 7012 in josm for trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
- Timestamp:
- 2014-04-27T15:35:47+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r7005 r7012 112 112 if (value == null) { 113 113 throwException(tr("Missing mandatory attribute ''{0}''.", "open")); 114 } else if ( value.equals("true")) {114 } else if ("true".equals(value)) { 115 115 current.setOpen(true); 116 } else if ( value.equals("false")) {116 } else if ("false".equals(value)) { 117 117 current.setOpen(false); 118 118 } else { … … 160 160 @Override 161 161 public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { 162 if (qName.equals("osm")) { 162 switch (qName) { 163 case "osm": 163 164 if (atts == null) { 164 165 throwException(tr("Missing mandatory attribute ''{0}'' of XML element {1}.", "version", "osm")); … … 168 169 throwException(tr("Missing mandatory attribute ''{0}''.", "version")); 169 170 } 170 if (!( v.equals("0.6"))) {171 if (!("0.6".equals(v))) { 171 172 throwException(tr("Unsupported version: {0}", v)); 172 173 } 173 } else if (qName.equals("changeset")) { 174 break; 175 case "changeset": 174 176 current = new Changeset(); 175 177 parseChangesetAttributes(current, atts); 176 } else if (qName.equals("tag")) { 178 break; 179 case "tag": 177 180 String key = atts.getValue("k"); 178 181 String value = atts.getValue("v"); 179 182 current.put(key, value); 180 } else { 183 break; 184 default: 181 185 throwException(tr("Undefined element ''{0}'' found in input stream. Aborting.", qName)); 182 186 } … … 185 189 @Override 186 190 public void endElement(String uri, String localName, String qName) throws SAXException { 187 if ( qName.equals("changeset")) {191 if ("changeset".equals(qName)) { 188 192 changesets.add(current); 189 193 }
Note:
See TracChangeset
for help on using the changeset viewer.
