Ignore:
Timestamp:
2017-09-03T12:32:11+02:00 (3 years ago)
Author:
bastiK
Message:

see #15229 - remove dependencies of CheckParameterUtil on various data classes

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java

    r12675 r12713  
    7676    public ParentRelationLoadingTask(Relation child, OsmDataLayer layer, boolean full, PleaseWaitProgressMonitor monitor) {
    7777        super(tr("Download referring relations"), monitor, false /* don't ignore exception */);
    78         CheckParameterUtil.ensureValidPrimitiveId(child, "child");
     78        CheckParameterUtil.ensure(child, "child", "id > 0", ch -> ch.getUniqueId() > 0);
    7979        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
    8080        referrers = null;
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java

    r12634 r12713  
    8181     */
    8282    public HistoryLoadTask add(PrimitiveId pid) {
    83         CheckParameterUtil.ensureValidPrimitiveId(pid, "pid");
     83        CheckParameterUtil.ensure(pid, "pid", "pid > 0", id -> id.getUniqueId() > 0);
    8484        toLoad.add(pid);
    8585        return this;
     
    119119     */
    120120    public HistoryLoadTask add(OsmPrimitive primitive) {
    121         CheckParameterUtil.ensureValidPrimitiveId(primitive, "primitive");
     121        CheckParameterUtil.ensure(primitive, "primitive", "id > 0", prim -> prim.getUniqueId() > 0);
    122122        return add(primitive.getPrimitiveId());
    123123    }
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java

    r12600 r12713  
    216216
    217217    private void setDisplacement(EastNorth displacement) {
    218         CheckParameterUtil.ensureValidCoordinates(displacement, "displacement");
     218        CheckParameterUtil.ensure(displacement, "displacement", EastNorth::isValid);
    219219        this.displacement = displacement;
    220220        fireSettingsChange(DISPLACEMENT);
Note: See TracChangeset for help on using the changeset viewer.