Changeset 10116 in josm


Ignore:
Timestamp:
2016-04-07T00:39:57+02:00 (8 years ago)
Author:
Don-vip
Message:

add more unit tests

Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java

    r9231 r10116  
    9595    protected void validateRequest() throws RequestHandlerBadRequestException {
    9696        allCoordinates.clear();
    97         for (String coordinatesString : args.get("way").split(";\\s*")) {
     97        for (String coordinatesString : (args != null ? args.get("way") : "").split(";\\s*")) {
    9898            String[] coordinates = coordinatesString.split(",\\s*", 2);
    9999            if (coordinates.length < 2) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java

    r8510 r10116  
    116116    @Override
    117117    protected void validateRequest() throws RequestHandlerBadRequestException {
    118         String url = args.get("url");
    119         String type = args.get("type");
    120         String cookies = args.get("cookies");
     118        String url = args != null ? args.get("url") : null;
     119        String type = args != null ? args.get("type") : null;
     120        String cookies = args != null ? args.get("cookies") : null;
    121121        try {
    122122            ImageryLayer.create(new ImageryInfo(null, url, type, null, cookies));
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r8846 r10116  
    269269        maxlon = 0;
    270270        try {
    271             minlat = LatLon.roundToOsmPrecision(Double.parseDouble(args.get("bottom")));
    272             maxlat = LatLon.roundToOsmPrecision(Double.parseDouble(args.get("top")));
    273             minlon = LatLon.roundToOsmPrecision(Double.parseDouble(args.get("left")));
    274             maxlon = LatLon.roundToOsmPrecision(Double.parseDouble(args.get("right")));
     271            minlat = LatLon.roundToOsmPrecision(Double.parseDouble(args != null ? args.get("bottom") : ""));
     272            maxlat = LatLon.roundToOsmPrecision(Double.parseDouble(args != null ? args.get("top") : ""));
     273            minlon = LatLon.roundToOsmPrecision(Double.parseDouble(args != null ? args.get("left") : ""));
     274            maxlon = LatLon.roundToOsmPrecision(Double.parseDouble(args != null ? args.get("right") : ""));
    275275        } catch (NumberFormatException e) {
    276276            throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+')', e);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java

    r8510 r10116  
    105105    protected void validateRequest() throws RequestHandlerBadRequestException {
    106106        ps.clear();
    107         for (String i : args.get("objects").split(",\\s*")) {
     107        for (String i : (args != null ? args.get("objects") : "").split(",\\s*")) {
    108108            try {
    109109                ps.add(SimplePrimitiveId.fromString(i));
Note: See TracChangeset for help on using the changeset viewer.