Changeset 36270 in osm for applications/editors


Ignore:
Timestamp:
2024-06-04T23:55:44+02:00 (7 months ago)
Author:
taylor.smock
Message:

Fix graphview tests when run with asserts enabled

This also removes some additional asserts in code that were unrelated to the test
failures.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxspeed.java

    r32620 r36270  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.graphview.core.property;
     3
     4import java.util.Objects;
    35
    46import org.openstreetmap.josm.plugins.graphview.core.access.AccessParameters;
     
    3436    public <N, W, R, M> Float evaluateN(N node, AccessParameters accessParameters,
    3537            DataSource<N, W, R, M> dataSource) {
    36         assert node != null && accessParameters != null && dataSource != null;
     38        Objects.requireNonNull(node);
     39        Objects.requireNonNull(dataSource);
    3740
    3841        initializeIfNecessary(dataSource);
     
    4447    public <N, W, R, M> Float evaluateW(W way, boolean forward, AccessParameters accessParameters,
    4548            DataSource<N, W, R, M> dataSource) {
    46         assert way != null && accessParameters != null && dataSource != null;
     49        Objects.requireNonNull(dataSource);
     50        Objects.requireNonNull(way);
    4751
    4852        initializeIfNecessary(dataSource);
     
    5559
    5660        if (maxspeedString != null) {
    57 
    58             Float maxspeed = ValueStringParser.parseSpeed(maxspeedString);
    59             if (maxspeed != null) {
    60                 return maxspeed;
    61             }
    62 
     61            return ValueStringParser.parseSpeed(maxspeedString);
    6362        }
    6463
     
    6867    @Override
    6968    public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
    70         assert propertyValue instanceof Float;
    71         return true;
     69        return propertyValue instanceof Float;
    7270    }
    7371
Note: See TracChangeset for help on using the changeset viewer.