- Timestamp:
- 2018-10-03T20:39:59+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r14153 r14290 210 210 public void setIcon(final String iconName) { 211 211 this.iconName = iconName; 212 if ( !TaggingPresetReader.isLoadIcons()) {212 if (iconName == null || !TaggingPresetReader.isLoadIcons()) { 213 213 return; 214 214 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r14284 r14290 41 41 import java.util.List; 42 42 import java.util.Map; 43 import java.util.Objects; 43 44 import java.util.Set; 44 45 import java.util.TreeSet; … … 277 278 protected String subdir; 278 279 /** image file name */ 279 protected String name;280 protected final String name; 280 281 /** archive file to take image from */ 281 282 protected File archive; … … 327 328 * @param name the name of the image. If it does not end with '.png' or '.svg', 328 329 * both extensions are tried. 330 * @throws NullPointerException if name is null 329 331 */ 330 332 public ImageProvider(String subdir, String name) { 331 333 this.subdir = subdir; 332 this.name = name;334 this.name = Objects.requireNonNull(name, "name"); 333 335 } 334 336 … … 337 339 * @param name the name of the image. If it does not end with '.png' or '.svg', 338 340 * both extensions are tried. 341 * @throws NullPointerException if name is null 339 342 */ 340 343 public ImageProvider(String name) { 341 this.name = name;344 this.name = Objects.requireNonNull(name, "name"); 342 345 } 343 346 … … 863 866 // This method is called from different thread and modifying HashMap concurrently can result 864 867 // for example in loops in map entries (ie freeze when such entry is retrieved) 865 if (name == null)866 return null;867 868 868 869 String prefix = isDisabled ? "dis:" : ""; … … 2089 2090 return ("ImageProvider [" 2090 2091 + (dirs != null && !dirs.isEmpty() ? "dirs=" + dirs + ", " : "") + (id != null ? "id=" + id + ", " : "") 2091 + (subdir != null && !subdir.isEmpty() ? "subdir=" + subdir + ", " : "") + (name != null ? "name=" + name + ", " : "")2092 + (subdir != null && !subdir.isEmpty() ? "subdir=" + subdir + ", " : "") + "name=" + name + ", " 2092 2093 + (archive != null ? "archive=" + archive + ", " : "") 2093 2094 + (inArchiveDir != null && !inArchiveDir.isEmpty() ? "inArchiveDir=" + inArchiveDir : "") + ']').replaceAll(", \\]", "]");
Note:
See TracChangeset
for help on using the changeset viewer.