Changeset 9732 in josm for trunk/src/org
- Timestamp:
- 2016-02-04T00:48:38+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r9214 r9732 273 273 // 274 274 final OsmDataLayer layer = createNewLayer(newLayerName); 275 Main.main.addLayer(layer, computeBbox(bounds)); 275 if (Main.main != null) 276 Main.main.addLayer(layer, computeBbox(bounds)); 276 277 return layer; 277 278 } -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r9353 r9732 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.IOException; 6 7 import java.io.InputStream; 7 8 import java.net.HttpURLConnection; … … 122 123 } 123 124 125 if ("file".equals(url.getProtocol())) { 126 try { 127 return url.openStream(); 128 } catch (IOException e) { 129 throw new OsmTransferException(e); 130 } 131 } 132 124 133 final HttpClient client = HttpClient.create(url); 125 134 activeConnection = client; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
r8846 r9732 115 115 protected void validateRequest() throws RequestHandlerBadRequestException { 116 116 try { 117 lat = Double.parseDouble(args .get("lat"));118 lon = Double.parseDouble(args .get("lon"));117 lat = Double.parseDouble(args != null ? args.get("lat") : ""); 118 lon = Double.parseDouble(args != null ? args.get("lon") : ""); 119 119 } catch (NumberFormatException e) { 120 120 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+')', e); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
r8444 r9732 98 98 @Override 99 99 protected void validateRequest() throws RequestHandlerBadRequestException { 100 String urlString = args .get("url");100 String urlString = args != null ? args.get("url") : null; 101 101 if (Main.pref.getBoolean("remotecontrol.importhandler.fix_url_query", true)) { 102 102 urlString = Utils.fixURLQuery(urlString); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r8929 r9732 223 223 List<String> missingKeys = new LinkedList<>(); 224 224 boolean error = false; 225 if (mandatory != null) for (String key : mandatory) { 226 String value = args.get(key); 227 if (value == null || value.isEmpty()) { 228 error = true; 229 Main.warn('\'' + myCommand + "' remote control request must have '" + key + "' parameter"); 230 missingKeys.add(key); 225 if (mandatory != null && args != null) { 226 for (String key : mandatory) { 227 String value = args.get(key); 228 if (value == null || value.isEmpty()) { 229 error = true; 230 Main.warn('\'' + myCommand + "' remote control request must have '" + key + "' parameter"); 231 missingKeys.add(key); 232 } 231 233 } 232 234 } 233 235 Set<String> knownParams = new HashSet<>(); 234 if (mandatory != null) Collections.addAll(knownParams, mandatory); 235 if (optional != null) Collections.addAll(knownParams, optional); 236 for (String par: args.keySet()) { 237 if (!knownParams.contains(par)) { 238 Main.warn("Unknown remote control parameter {0}, skipping it", par); 236 if (mandatory != null) 237 Collections.addAll(knownParams, mandatory); 238 if (optional != null) 239 Collections.addAll(knownParams, optional); 240 if (args != null) { 241 for (String par: args.keySet()) { 242 if (!knownParams.contains(par)) { 243 Main.warn("Unknown remote control parameter {0}, skipping it", par); 244 } 239 245 } 240 246 } -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r9720 r9732 1221 1221 */ 1222 1222 public static String fixURLQuery(String url) { 1223 if (url .indexOf('?') == -1)1223 if (url == null || url.indexOf('?') == -1) 1224 1224 return url; 1225 1225
Note:
See TracChangeset
for help on using the changeset viewer.