Changeset 5339 in josm


Ignore:
Timestamp:
2012-07-14T16:20:14+02:00 (7 years ago)
Author:
Don-vip
Message:

see #7505 - Add toString() method on History objects to ease debugging

Location:
trunk/src/org/openstreetmap/josm/data/osm/history
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/history/History.java

    r5171 r5339  
    231231        return type;
    232232    }
     233
     234    @Override
     235    public String toString() {
     236        String result = "History ["
     237                + (type != null ? "type=" + type + ", " : "") + "id=" + id;
     238        if (versions != null) {
     239            result += ", versions=\n";
     240            for (HistoryOsmPrimitive v : versions) {
     241                result += "\t" + v + ",\n";
     242            }
     243        }
     244        result += "]";
     245        return result;
     246    }
    233247}
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java

    r5266 r5339  
    231231        return true;
    232232    }
     233
     234    @Override
     235    public String toString() {
     236        return getClass().getSimpleName() + " [version=" + version + ", id=" + id + ", visible=" + visible + ", "
     237                + (timestamp != null ? "timestamp=" + timestamp : "") + ", "
     238                + (user != null ? "user=" + user + ", " : "") + "changesetId="
     239                + changesetId
     240                + "]";
     241    }
    233242}
Note: See TracChangeset for help on using the changeset viewer.