- Timestamp:
- 2010-12-08T22:33:58+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r3708 r3709 616 616 } 617 617 618 /** 619 * Get a list of values for a certain key 620 * @param key the identifier for the setting 621 * @param def the default value. 622 * @return the corresponding value if the property has been set before, 623 * def otherwise 624 */ 618 625 synchronized public Collection<String> getCollection(String key, Collection<String> def) { 626 putCollectionDefault(key, def); 619 627 String s = get(key); 620 if(def != null)621 putCollectionDefault(key, def);622 628 if(s != null && s.length() != 0) 623 629 return Arrays.asList(s.split("\u001e")); … … 651 657 652 658 synchronized private void putCollectionDefault(String key, Collection<String> val) { 653 String s = null; 654 for(String a : val) 655 { 656 if(s != null) { 657 s += "\u001e" + a; 658 } else { 659 s = a; 660 } 661 } 662 putDefault(key, s); 659 if (val == null) { 660 putDefault(key, null); 661 } else { 662 String s = null; 663 for(String a : val) 664 { 665 if(s != null) { 666 s += "\u001e" + a; 667 } else { 668 s = a; 669 } 670 } 671 putDefault(key, s); 672 } 663 673 } 664 674
Note:
See TracChangeset
for help on using the changeset viewer.