Ignore:
Timestamp:
2017-02-12T16:32:18+01:00 (9 years ago)
Author:
Don-vip
Message:

refactor handling of null values - use Java 8 Optional where possible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r10972 r11553  
    1111import java.io.File;
    1212import java.util.List;
     13import java.util.Optional;
    1314
    1415import javax.swing.AbstractAction;
     
    301302            removeColorPropertyListener();
    302303        }
    303         if (name == null) {
    304             name = "";
    305         }
    306 
    307304        String oldValue = this.name;
    308         this.name = name;
     305        this.name = Optional.ofNullable(name).orElse("");
    309306        if (!this.name.equals(oldValue)) {
    310307            propertyChangeSupport.firePropertyChange(NAME_PROP, oldValue, this.name);
Note: See TracChangeset for help on using the changeset viewer.