Ignore:
Timestamp:
2015-05-18T23:34:11+02:00 (9 years ago)
Author:
Don-vip
Message:
  • global use of String.isEmpty()
  • Correctness - Method throws alternative exception from catch block without history
Location:
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler
Files:
4 edited

Legend:

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

    r7937 r8394  
    3030    private double lat;
    3131    private double lon;
    32    
     32
    3333    private Node node;
    3434
     
    4747        return new String[] { "lat", "lon" };
    4848    }
    49    
     49
    5050    @Override
    5151    public String[] getOptionalParams()
     
    6363        return new String[] {
    6464            "/add_node?lat=11&lon=22",
    65             "/add_node?lon=13.3&lat=53.2&addtags=natural=tree|name=%20%20%20==Great%20Oak==" 
     65            "/add_node?lon=13.3&lat=53.2&addtags=natural=tree|name=%20%20%20==Great%20Oak=="
    6666        };
    6767    }
    68    
     68
    6969    @Override
    7070    public String getPermissionMessage() {
     
    122122            lon = Double.parseDouble(args.get("lon"));
    123123        } catch (NumberFormatException e) {
    124             throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")");
     124            throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")", e);
    125125        }
    126126        if (!Main.main.hasEditLayer()) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java

    r8332 r8394  
    104104                allCoordinates.add(new LatLon(lat, lon));
    105105            } catch (NumberFormatException e) {
    106                 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")");
     106                throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")", e);
    107107            }
    108108        }
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r8318 r8394  
    272272            maxlon = LatLon.roundToOsmPrecision(Double.parseDouble(args.get("right")));
    273273        } catch (NumberFormatException e) {
    274             throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")");
     274            throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")", e);
    275275        }
    276276
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java

    r8338 r8394  
    223223        if(mandatory != null) for (String key : mandatory) {
    224224            String value = args.get(key);
    225             if ((value == null) || (value.length() == 0)) {
     225            if (value == null || value.isEmpty()) {
    226226                error = true;
    227227                Main.warn("'" + myCommand + "' remote control request must have '" + key + "' parameter");
Note: See TracChangeset for help on using the changeset viewer.