Changeset 4614 in josm
- Timestamp:
- 2011-11-27T11:32:47+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r4612 r4614 890 890 891 891 valueCopy = new ArrayList<String>(value); 892 if (valueCopy.contains(null)) throw new RuntimeException("Error: Null as list element in preference setting (key '"+key+"')"); 892 893 collectionProperties.put(key, Collections.unmodifiableList(valueCopy)); 893 894 try { … … 1000 1001 1001 1002 valueCopy = new ArrayList<List<String>>(value.size()); 1003 if (valueCopy.contains(null)) throw new RuntimeException("Error: Null as list element in preference setting (key '"+key+"')"); 1002 1004 for (Collection<String> lst : value) { 1003 valueCopy.add(Collections.unmodifiableList(new ArrayList<String>(lst))); 1005 List<String> lstCopy = new ArrayList<String>(lst); 1006 if (lstCopy.contains(null)) throw new RuntimeException("Error: Null as inner list element in preference setting (key '"+key+"')"); 1007 valueCopy.add(Collections.unmodifiableList(lstCopy)); 1004 1008 } 1005 1009 arrayProperties.put(key, Collections.unmodifiableList(valueCopy)); … … 1093 1097 1094 1098 valueCopy = new ArrayList<Map<String, String>>(value.size()); 1099 if (valueCopy.contains(null)) throw new RuntimeException("Error: Null as list element in preference setting (key '"+key+"')"); 1095 1100 for (Map<String, String> map : value) { 1096 valueCopy.add(Collections.unmodifiableMap(new LinkedHashMap<String,String>(map))); 1101 Map<String, String> mapCopy = new LinkedHashMap<String,String>(map); 1102 if (mapCopy.keySet().contains(null)) throw new RuntimeException("Error: Null as map key in preference setting (key '"+key+"')"); 1103 if (mapCopy.values().contains(null)) throw new RuntimeException("Error: Null as map value in preference setting (key '"+key+"')"); 1104 valueCopy.add(Collections.unmodifiableMap(mapCopy)); 1097 1105 } 1098 1106 listOfStructsProperties.put(key, Collections.unmodifiableList(valueCopy));
Note:
See TracChangeset
for help on using the changeset viewer.