Changeset 15759 in josm


Ignore:
Timestamp:
2020-01-25T21:11:55+01:00 (5 years ago)
Author:
simon04
Message:

GpxLayer: use Map.getOrDefault (Java 8)

File:
1 edited

Legend:

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

    r15736 r15759  
    202202            for (IGpxTrack trk : data.getTracks()) {
    203203                info.append("<tr><td>");
    204                 if (trk.getAttributes().containsKey(GpxConstants.GPX_NAME)) {
    205                     info.append(trk.get(GpxConstants.GPX_NAME));
    206                 }
     204                info.append(trk.getAttributes().getOrDefault(GpxConstants.GPX_NAME, ""));
    207205                info.append("</td><td>");
    208                 if (trk.getAttributes().containsKey(GpxConstants.GPX_DESC)) {
    209                     info.append(' ').append(trk.get(GpxConstants.GPX_DESC));
    210                 }
     206                info.append(trk.getAttributes().getOrDefault(GpxConstants.GPX_DESC, ""));
    211207                info.append("</td><td>");
    212208                info.append(getTimespanForTrack(trk));
Note: See TracChangeset for help on using the changeset viewer.