Changeset 6990 in josm for trunk/src/org/openstreetmap/josm/data/Preferences.java
- Timestamp:
- 2014-04-19T00:36:43+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r6986 r6990 1365 1365 int event = parser.next(); 1366 1366 if (event == XMLStreamConstants.START_ELEMENT) { 1367 if (parser.getLocalName().equals("tag")) { 1367 String localName = parser.getLocalName(); 1368 if ("tag".equals(localName)) { 1368 1369 settingsMap.put(parser.getAttributeValue(null, "key"), new StringSetting(parser.getAttributeValue(null, "value"))); 1369 1370 jumpToEnd(); 1370 } else if ( parser.getLocalName().equals("list") ||1371 parser.getLocalName().equals("collection") ||1372 parser.getLocalName().equals("lists") ||1373 parser.getLocalName().equals("maps")1371 } else if ("list".equals(localName) || 1372 "collection".equals(localName) || 1373 "lists".equals(localName) || 1374 "maps".equals(localName) 1374 1375 ) { 1375 1376 parseToplevelList(); 1376 1377 } else { 1377 throwException("Unexpected element: "+ parser.getLocalName());1378 throwException("Unexpected element: "+localName); 1378 1379 } 1379 1380 } else if (event == XMLStreamConstants.END_ELEMENT) { … … 1404 1405 int event = parser.next(); 1405 1406 if (event == XMLStreamConstants.START_ELEMENT) { 1406 if (parser.getLocalName().equals("entry")) { 1407 String localName = parser.getLocalName(); 1408 if ("entry".equals(localName)) { 1407 1409 if (entries == null) { 1408 1410 entries = new ArrayList<String>(); … … 1410 1412 entries.add(parser.getAttributeValue(null, "value")); 1411 1413 jumpToEnd(); 1412 } else if ( parser.getLocalName().equals("list")) {1414 } else if ("list".equals(localName)) { 1413 1415 if (lists == null) { 1414 1416 lists = new ArrayList<List<String>>(); 1415 1417 } 1416 1418 lists.add(parseInnerList()); 1417 } else if ( parser.getLocalName().equals("map")) {1419 } else if ("map".equals(localName)) { 1418 1420 if (maps == null) { 1419 1421 maps = new ArrayList<Map<String, String>>(); … … 1421 1423 maps.add(parseMap()); 1422 1424 } else { 1423 throwException("Unexpected element: "+ parser.getLocalName());1425 throwException("Unexpected element: "+localName); 1424 1426 } 1425 1427 } else if (event == XMLStreamConstants.END_ELEMENT) { … … 1434 1436 settingsMap.put(key, new MapListSetting(Collections.unmodifiableList(maps))); 1435 1437 } else { 1436 if ( name.equals("lists")) {1438 if ("lists".equals(name)) { 1437 1439 settingsMap.put(key, new ListListSetting(Collections.<List<String>>emptyList())); 1438 } else if ( name.equals("maps")) {1440 } else if ("maps".equals(name)) { 1439 1441 settingsMap.put(key, new MapListSetting(Collections.<Map<String, String>>emptyList())); 1440 1442 } else { … … 1449 1451 int event = parser.next(); 1450 1452 if (event == XMLStreamConstants.START_ELEMENT) { 1451 if ( parser.getLocalName().equals("entry")) {1453 if ("entry".equals(parser.getLocalName())) { 1452 1454 entries.add(parser.getAttributeValue(null, "value")); 1453 1455 jumpToEnd(); … … 1467 1469 int event = parser.next(); 1468 1470 if (event == XMLStreamConstants.START_ELEMENT) { 1469 if ( parser.getLocalName().equals("tag")) {1471 if ("tag".equals(parser.getLocalName())) { 1470 1472 map.put(parser.getAttributeValue(null, "key"), parser.getAttributeValue(null, "value")); 1471 1473 jumpToEnd(); … … 1500 1502 @Override 1501 1503 public void visit(StringSetting setting) { 1502 if (noPassword && key.equals("osm-server.password"))1504 if (noPassword && "osm-server.password".equals(key)) 1503 1505 return; // do not store plain password. 1504 1506 /* don't save default values */
Note:
See TracChangeset
for help on using the changeset viewer.