Changeset 15401 in josm for trunk/src/org
- Timestamp:
- 2019-10-01T09:31:13+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r15394 r15401 121 121 122 122 private Object getValueForClass(Class<?> klass, String value) { 123 if ( klass == Boolean.TYPE)123 if (boolean.class.equals(klass)) 124 124 return parseBoolean(value); 125 else if (klass == Integer.TYPE || klass == Long.TYPE) 125 else if (Integer.class.equals(klass)) 126 return Integer.valueOf(value); 127 else if (Long.class.equals(klass)) 126 128 return Long.valueOf(value); 127 else if (klass == Float.TYPE || klass == Double.TYPE) 129 else if (Float.class.equals(klass)) 130 return Float.valueOf(value); 131 else if (Double.class.equals(klass)) 128 132 return Double.valueOf(value); 129 133 return value; … … 144 148 } 145 149 if (f != null && Modifier.isPublic(f.getModifiers()) && ( 146 String.class.equals(f.getType()) || boolean.class.equals(f.getType()))) { 150 String.class.equals(f.getType()) || boolean.class.equals(f.getType()) || 151 Float.class.equals(f.getType()) || Double.class.equals(f.getType()) || 152 Long.class.equals(f.getType()) || Integer.class.equals(f.getType()))) { 147 153 f.set(c, getValueForClass(f.getType(), value)); 148 154 } else {
Note:
See TracChangeset
for help on using the changeset viewer.