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/io/UploadDialog.java

    r11452 r11553  
    2525import java.util.Map;
    2626import java.util.Map.Entry;
     27import java.util.Optional;
    2728import java.util.concurrent.TimeUnit;
    2829
     
    343344     */
    344345    public Changeset getChangeset() {
    345         Changeset cs = pnlChangesetManagement.getSelectedChangeset();
    346         if (cs == null) {
    347             cs = new Changeset();
    348         }
     346        Changeset cs = Optional.ofNullable(pnlChangesetManagement.getSelectedChangeset()).orElseGet(Changeset::new);
    349347        cs.setKeys(pnlTagSettings.getTags(false));
    350348        return cs;
Note: See TracChangeset for help on using the changeset viewer.