Changeset 12537 in josm for trunk/src/org/openstreetmap/josm/data/Preferences.java
- Timestamp:
- 2017-07-30T00:22:46+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r12409 r12537 1457 1457 throw new IllegalArgumentException(ex); 1458 1458 } 1459 for (Entry<String, String> key _value : hash.entrySet()) {1459 for (Entry<String, String> keyValue : hash.entrySet()) { 1460 1460 Object value; 1461 1461 Field f; 1462 1462 try { 1463 f = klass.getDeclaredField(key _value.getKey().replace('-', '_'));1463 f = klass.getDeclaredField(keyValue.getKey().replace('-', '_')); 1464 1464 } catch (NoSuchFieldException ex) { 1465 1465 Main.trace(ex); … … 1471 1471 Utils.setObjectsAccessible(f); 1472 1472 if (f.getType() == Boolean.class || f.getType() == boolean.class) { 1473 value = Boolean.valueOf(key _value.getValue());1473 value = Boolean.valueOf(keyValue.getValue()); 1474 1474 } else if (f.getType() == Integer.class || f.getType() == int.class) { 1475 1475 try { 1476 value = Integer.valueOf(key _value.getValue());1476 value = Integer.valueOf(keyValue.getValue()); 1477 1477 } catch (NumberFormatException nfe) { 1478 1478 continue; … … 1480 1480 } else if (f.getType() == Double.class || f.getType() == double.class) { 1481 1481 try { 1482 value = Double.valueOf(key _value.getValue());1482 value = Double.valueOf(keyValue.getValue()); 1483 1483 } catch (NumberFormatException nfe) { 1484 1484 continue; 1485 1485 } 1486 1486 } else if (f.getType() == String.class) { 1487 value = key _value.getValue();1487 value = keyValue.getValue(); 1488 1488 } else if (f.getType().isAssignableFrom(Map.class)) { 1489 value = mapFromJson(key _value.getValue());1489 value = mapFromJson(keyValue.getValue()); 1490 1490 } else if (f.getType().isAssignableFrom(MultiMap.class)) { 1491 value = multiMapFromJson(key _value.getValue());1491 value = multiMapFromJson(keyValue.getValue()); 1492 1492 } else 1493 1493 throw new JosmRuntimeException("unsupported preference primitive type");
Note:
See TracChangeset
for help on using the changeset viewer.