- Timestamp:
- 2012-02-12T14:00:28+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r4900 r4920 266 266 } 267 267 268 /* remove end of 2012 */ 268 269 public File getOldPreferenceFile() { 269 270 return new File(getPreferencesDirFile(), "preferences"); … … 907 908 } 908 909 910 /* remove this workaround end of 2012, replace by direct access to structure */ 909 911 synchronized private List<String> getCollectionInternal(String key) { 910 912 List<String> prop = collectionProperties.get(key); … … 949 951 if (valueCopy.contains(null)) throw new RuntimeException("Error: Null as list element in preference setting (key '"+key+"')"); 950 952 collectionProperties.put(key, Collections.unmodifiableList(valueCopy)); 951 try {952 save();953 } catch(IOException e){954 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));955 }953 } 954 try { 955 save(); 956 } catch(IOException e){ 957 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile())); 956 958 } 957 959 } … … 1027 1029 } 1028 1030 1031 /* remove this workaround end of 2012 and replace by direct array access */ 1029 1032 synchronized private List<List<String>> getArrayInternal(String key) { 1030 1033 List<List<String>> prop = arrayProperties.get(key); … … 1078 1081 } 1079 1082 arrayProperties.put(key, Collections.unmodifiableList(valueCopy)); 1080 try {1081 save();1082 } catch(IOException e){1083 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));1084 }1083 } 1084 try { 1085 save(); 1086 } catch(IOException e){ 1087 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile())); 1085 1088 } 1086 1089 } … … 1123 1126 } 1124 1127 1128 /* remove this workaround end of 2012 and use direct access to proper variable */ 1125 1129 private synchronized List<Map<String, String>> getListOfStructsInternal(String key) { 1126 1130 List<Map<String, String>> prop = listOfStructsProperties.get(key); … … 1177 1181 } 1178 1182 listOfStructsProperties.put(key, Collections.unmodifiableList(valueCopy)); 1179 try {1180 save();1181 } catch(IOException e){1182 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));1183 }1183 } 1184 try { 1185 save(); 1186 } catch(IOException e){ 1187 System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile())); 1184 1188 } 1185 1189 } … … 1220 1224 /** 1221 1225 * Get a list of hashes which are represented by a struct-like class. 1222 * It reads lines of the form1223 * > key.0=prop:val \u001e prop:val \u001e ... \u001e prop:val1224 * > ...1225 * > key.N=prop:val \u001e prop:val \u001e ... \u001e prop:val1226 1226 * Possible properties are given by fields of the class klass that have 1227 1227 * the @pref annotation. … … 1642 1642 /* don't save default values */ 1643 1643 if(s == null || !s.equals(r)) { 1644 /* TODO: remove old format exception end of 2012 */ 1644 1645 if(r.contains("\u001e")) 1645 1646 {
Note:
See TracChangeset
for help on using the changeset viewer.