Changeset 9829 in josm for trunk/src/org
- Timestamp:
- 2016-02-19T02:34:18+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r9827 r9829 1418 1418 */ 1419 1419 public String toXML(Collection<Entry<String, Setting<?>>> settings, boolean nopass, boolean defaults) { 1420 StringWriter sw = new StringWriter(); 1421 PrintWriter pw = new PrintWriter(sw); 1422 PreferencesWriter prefWriter = new PreferencesWriter(pw, nopass, defaults); 1423 prefWriter.write(settings); 1424 sw.flush(); 1425 StringBuffer sb = sw.getBuffer(); 1426 return sb.toString(); 1420 try ( 1421 StringWriter sw = new StringWriter(); 1422 PreferencesWriter prefWriter = new PreferencesWriter(new PrintWriter(sw), nopass, defaults); 1423 ) { 1424 prefWriter.write(settings); 1425 sw.flush(); 1426 return sw.toString(); 1427 } catch (IOException e) { 1428 Main.error(e); 1429 return null; 1430 } 1427 1431 } 1428 1432
Note:
See TracChangeset
for help on using the changeset viewer.