Ignore:
Timestamp:
2016-01-29T22:08:26+01:00 (4 years ago)
Author:
Don-vip
Message:

add more unit tests

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JosmAction.java

    r9594 r9675  
    208208     * @return the current edit layer. null, if no edit layer exists
    209209     */
    210     protected static OsmDataLayer getEditLayer() {
     210    public static OsmDataLayer getEditLayer() {
    211211        return Main.main != null ? Main.main.getEditLayer() : null;
    212212    }
  • trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java

    r8870 r9675  
    1414
    1515import org.openstreetmap.josm.Main;
     16import org.openstreetmap.josm.actions.JosmAction;
    1617import org.openstreetmap.josm.data.APIDataSet;
    1718import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    7374        }
    7475        tests = null;
    75         OsmDataLayer editLayer = Main.main.getEditLayer();
    76         editLayer.validationErrors.clear();
    77         editLayer.validationErrors.addAll(errors);
    78         Main.map.validatorDialog.tree.setErrors(errors);
    79         if (errors == null || errors.isEmpty())
     76        OsmDataLayer editLayer = JosmAction.getEditLayer();
     77        if (editLayer != null) {
     78            editLayer.validationErrors.clear();
     79            editLayer.validationErrors.addAll(errors);
     80        }
     81        if (Main.map != null) {
     82            Main.map.validatorDialog.tree.setErrors(errors);
     83        }
     84        if (errors.isEmpty())
    8085            return true;
    8186
Note: See TracChangeset for help on using the changeset viewer.