Changeset 8846 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2015-10-10T01:40:42+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r8788 r8846 48 48 boolean done = false; 49 49 GpxData result = null; 50 String url = "trackpoints?bbox="+b.getMinLon()+ ","+b.getMinLat()+","+b.getMaxLon()+","+b.getMaxLat()+"&page=";50 String url = "trackpoints?bbox="+b.getMinLon()+','+b.getMinLat()+','+b.getMaxLon()+','+b.getMaxLat()+"&page="; 51 51 for (int i = 0; !done; ++i) { 52 52 progressMonitor.subTask(tr("Downloading points {0} to {1}...", i * 5000, (i + 1) * 5000)); … … 123 123 */ 124 124 protected String getRequestForBbox(double lon1, double lat1, double lon2, double lat2) { 125 return "map?bbox=" + lon1 + "," + lat1 + "," + lon2 + ","+ lat2;125 return "map?bbox=" + lon1 + ',' + lat1 + ',' + lon2 + ',' + lat2; 126 126 } 127 127 … … 190 190 CheckParameterUtil.ensureThat(noteLimit <= 10000, "Requested note limit is over API hard limit of 10000."); 191 191 CheckParameterUtil.ensureThat(daysClosed >= -1, "Requested note limit is less than -1."); 192 String url = "notes?limit=" + noteLimit + "&closed=" + daysClosed + "&bbox=" + lon1 + "," + lat1 + "," + lon2 + ","+ lat2;192 String url = "notes?limit=" + noteLimit + "&closed=" + daysClosed + "&bbox=" + lon1 + ',' + lat1 + ',' + lon2 + ',' + lat2; 193 193 try { 194 194 InputStream is = getInputStream(url, progressMonitor.createSubTaskMonitor(1, false)); -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r8840 r8846 289 289 while (entries.hasMoreElements()) { 290 290 ZipEntry entry = entries.nextElement(); 291 if (entry.getName().endsWith( "."+ extension)) {291 if (entry.getName().endsWith('.' + extension)) { 292 292 /* choose any file with correct extension. When more than 293 293 one file, prefer the one which matches namepart */ … … 415 415 if (ifModifiedSince != null && con.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED) { 416 416 if (Main.isDebugEnabled()) { 417 Main.debug("304 Not Modified ("+urlStr+ ")");417 Main.debug("304 Not Modified ("+urlStr+')'); 418 418 } 419 419 if (localFile == null) -
trunk/src/org/openstreetmap/josm/io/GpxExporter.java
r8540 r8846 45 45 private static final String GPL_WARNING = "<html><font color='red' size='-2'>" 46 46 + tr("Note: GPL is not compatible with the OSM license. Do not upload GPL licensed tracks.") + "</html>"; 47 48 private static final String[] LICENSES = { 49 "Creative Commons By-SA", 50 "Open Database License (ODbL)", 51 "public domain", 52 "GNU Lesser Public License (LGPL)", 53 "BSD License (MIT/X11)"}; 54 55 private static final String[] URLS = { 56 "https://creativecommons.org/licenses/by-sa/3.0", 57 "http://opendatacommons.org/licenses/odbl/1.0", 58 "public domain", 59 "https://www.gnu.org/copyleft/lesser.html", 60 "http://www.opensource.org/licenses/bsd-license.php"}; 47 61 48 62 /** … … 292 306 @Override 293 307 public void actionPerformed(ActionEvent e) { 294 final String[] licenses = { 295 "Creative Commons By-SA", 296 "Open Database License (ODbL)", 297 "public domain", 298 "GNU Lesser Public License (LGPL)", 299 "BSD License (MIT/X11)"}; 300 JList<String> l = new JList<>(licenses); 301 l.setVisibleRowCount(licenses.length); 308 JList<String> l = new JList<>(LICENSES); 309 l.setVisibleRowCount(LICENSES.length); 302 310 l.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 303 311 int answer = JOptionPane.showConfirmDialog( … … 310 318 if (answer != JOptionPane.OK_OPTION || l.getSelectedIndex() == -1) 311 319 return; 312 final String[] urls = {313 "https://creativecommons.org/licenses/by-sa/3.0",314 "http://opendatacommons.org/licenses/odbl/1.0",315 "public domain",316 "https://www.gnu.org/copyleft/lesser.html",317 "http://www.opensource.org/licenses/bsd-license.php"};318 320 String license = ""; 319 321 for (int i : l.getSelectedIndices()) { … … 322 324 break; 323 325 } 324 license += license.isEmpty() ? urls[i] : ", "+urls[i];326 license += license.isEmpty() ? URLS[i] : ", "+URLS[i]; 325 327 } 326 328 copyright.setText(license); -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r8840 r8846 178 178 break; 179 179 case "email": 180 data.put(META_AUTHOR_EMAIL, atts.getValue("id") + "@"+ atts.getValue("domain"));180 data.put(META_AUTHOR_EMAIL, atts.getValue("id") + '@' + atts.getValue("domain")); 181 181 } 182 182 break; … … 549 549 if (e instanceof SAXParseException) { 550 550 SAXParseException spe = (SAXParseException) e; 551 message += " "+ tr("(at line {0}, column {1})", spe.getLineNumber(), spe.getColumnNumber());551 message += ' ' + tr("(at line {0}, column {1})", spe.getLineNumber(), spe.getColumnNumber()); 552 552 } 553 553 Main.warn(message); -
trunk/src/org/openstreetmap/josm/io/GpxWriter.java
r8461 r8846 135 135 String[] tmp = data.getString(META_AUTHOR_EMAIL).split("@"); 136 136 if (tmp.length == 2) { 137 inline("email", "id=\"" + tmp[0] + "\" domain=\""+tmp[1]+ "\"");137 inline("email", "id=\"" + tmp[0] + "\" domain=\""+tmp[1]+'\"'); 138 138 } 139 139 } … … 146 146 if (attr.containsKey(META_COPYRIGHT_LICENSE) 147 147 || attr.containsKey(META_COPYRIGHT_YEAR)) { 148 openAtt("copyright", "author=\""+ data.get(META_COPYRIGHT_AUTHOR) + "\"");148 openAtt("copyright", "author=\""+ data.get(META_COPYRIGHT_AUTHOR) +'\"'); 149 149 if (attr.containsKey(META_COPYRIGHT_YEAR)) { 150 150 simpleTag("year", (String) data.get(META_COPYRIGHT_YEAR)); … … 171 171 if (bounds != null) { 172 172 String b = "minlat=\"" + bounds.getMinLat() + "\" minlon=\"" + bounds.getMinLon() + 173 "\" maxlat=\"" + bounds.getMaxLat() + "\" maxlon=\"" + bounds.getMaxLon() + "\"";173 "\" maxlat=\"" + bounds.getMaxLat() + "\" maxlon=\"" + bounds.getMaxLon() + '\"'; 174 174 inline("bounds", b); 175 175 } … … 222 222 223 223 private void open(String tag) { 224 out.print(indent + "<" + tag + ">");224 out.print(indent + '<' + tag + '>'); 225 225 indent += " "; 226 226 } 227 227 228 228 private void openAtt(String tag, String attributes) { 229 out.println(indent + "<" + tag + " " + attributes + ">");229 out.println(indent + '<' + tag + ' ' + attributes + '>'); 230 230 indent += " "; 231 231 } 232 232 233 233 private void inline(String tag, String attributes) { 234 out.println(indent + "<" + tag + " "+ attributes + "/>");234 out.println(indent + '<' + tag + ' ' + attributes + "/>"); 235 235 } 236 236 237 237 private void close(String tag) { 238 238 indent = indent.substring(2); 239 out.print(indent + "</" + tag + ">");239 out.print(indent + "</" + tag + '>'); 240 240 } 241 241 … … 253 253 open(tag); 254 254 out.print(encode(content)); 255 out.println("</" + tag + ">");255 out.println("</" + tag + '>'); 256 256 indent = indent.substring(2); 257 257 } … … 263 263 private void gpxLink(GpxLink link) { 264 264 if (link != null) { 265 openAtt("link", "href=\"" + link.uri + "\"");265 openAtt("link", "href=\"" + link.uri + '\"'); 266 266 simpleTag("text", link.text); 267 267 simpleTag("type", link.type); … … 290 290 if (pnt != null) { 291 291 LatLon c = pnt.getCoor(); 292 String coordAttr = "lat=\"" + c.lat() + "\" lon=\"" + c.lon() + "\"";292 String coordAttr = "lat=\"" + c.lat() + "\" lon=\"" + c.lon() + '\"'; 293 293 if (pnt.attr.isEmpty()) { 294 294 inline(type, coordAttr); -
trunk/src/org/openstreetmap/josm/io/JpgImporter.java
r8540 r8846 36 36 */ 37 37 public static final ExtensionFileFilter FILE_FILTER_WITH_FOLDERS = new ExtensionFileFilter( 38 "jpg,jpeg", "jpg", tr("Image Files") + " (*.jpg, "+ tr("folder")+ ")");38 "jpg,jpeg", "jpg", tr("Image Files") + " (*.jpg, "+ tr("folder")+')'); 39 39 40 40 /** -
trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
r8840 r8846 71 71 panel.add(new JLabel(trn("You have {0} unread message.", "You have {0} unread messages.", unread, unread)), 72 72 GBC.eol()); 73 panel.add(new UrlLabel(Main.getBaseUserUrl() + "/"+ userInfo.getDisplayName() + "/inbox",73 panel.add(new UrlLabel(Main.getBaseUserUrl() + '/' + userInfo.getDisplayName() + "/inbox", 74 74 tr("Click here to see your inbox.")), GBC.eol()); 75 75 panel.setOpaque(false); … … 97 97 } else if (!isRunning() && interval > 0 && isUserEnoughIdentified()) { 98 98 task = EXECUTOR.scheduleAtFixedRate(WORKER, 0, interval * 60, TimeUnit.SECONDS); 99 Main.info("Message notifier active (checks every "+interval+" minute"+(interval > 1 ? "s" : "")+ ")");99 Main.info("Message notifier active (checks every "+interval+" minute"+(interval > 1 ? "s" : "")+')'); 100 100 } 101 101 } -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r8734 r8846 351 351 // Run the fetchers 352 352 for (int i = 0; i < jobs.size() && !isCanceled(); i++) { 353 progressMonitor.subTask(msg + "... " + progressMonitor.getTicks() + "/"+ progressMonitor.getTicksCount());353 progressMonitor.subTask(msg + "... " + progressMonitor.getTicks() + '/' + progressMonitor.getTicksCount()); 354 354 try { 355 355 FetchResult result = ecs.take().get(); -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r8840 r8846 378 378 initialize(monitor); 379 379 // normal mode (0.6 and up) returns new object version. 380 ret = sendRequest("PUT", OsmPrimitiveType.from(osm).getAPIName()+ "/"+ osm.getId(), toXml(osm, true), monitor);380 ret = sendRequest("PUT", OsmPrimitiveType.from(osm).getAPIName()+'/' + osm.getId(), toXml(osm, true), monitor); 381 381 osm.setOsmId(osm.getId(), Integer.parseInt(ret.trim())); 382 382 osm.setChangesetId(getChangeset().getId()); … … 623 623 try { 624 624 url = new URL(new URL(getBaseUrl()), urlSuffix); 625 Main.info(requestMethod + " "+ url + "... ");625 Main.info(requestMethod + ' ' + url + "... "); 626 626 Main.debug(requestBody); 627 627 // fix #5369, see http://www.tikalk.com/java/forums/httpurlconnection-disable-keep-alive -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r8840 r8846 95 95 String username = response.getUsername() == null ? "" : response.getUsername(); 96 96 String password = response.getPassword() == null ? "" : String.valueOf(response.getPassword()); 97 token = username + ":"+ password;97 token = username + ':' + password; 98 98 try { 99 99 ByteBuffer bytes = encoder.encode(CharBuffer.wrap(token)); -
trunk/src/org/openstreetmap/josm/io/OsmExporter.java
r8291 r8846 86 86 // a truncated file. That can destroy lots of work. 87 87 if (file.exists()) { 88 tmpFile = new File(file.getPath() + "~");88 tmpFile = new File(file.getPath() + '~'); 89 89 Utils.copyFile(file, tmpFile); 90 90 } -
trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java
r8347 r8846 40 40 if (locator == null) 41 41 return ""; 42 return "(" + locator.getLineNumber() + "," + locator.getColumnNumber() + ")";42 return "(" + locator.getLineNumber() + ',' + locator.getColumnNumber() + ')'; 43 43 } 44 44 -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r8836 r8846 562 562 if (getLocation() == null) 563 563 return msg; 564 msg += " "+ tr("(at line {0}, column {1})", getLocation().getLineNumber(), getLocation().getColumnNumber());564 msg += ' ' + tr("(at line {0}, column {1})", getLocation().getLineNumber(), getLocation().getColumnNumber()); 565 565 int offset = getLocation().getCharacterOffset(); 566 566 if (offset > -1) { -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r8840 r8846 152 152 try { 153 153 if (reason != null && !reason.isEmpty()) { 154 Main.info("GET " + url + " (" + reason + ")");154 Main.info("GET " + url + " (" + reason + ')'); 155 155 } else { 156 156 Main.info("GET " + url); -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r8840 r8846 71 71 long minutes_left = ms_left / MSECS_PER_MINUTE; 72 72 long seconds_left = (ms_left / MSECS_PER_SECOND) % SECONDS_PER_MINUTE; 73 String time_left_str = Long.toString(minutes_left) + ":";73 String time_left_str = Long.toString(minutes_left) + ':'; 74 74 if (seconds_left < 10) { 75 time_left_str += "0";75 time_left_str += '0'; 76 76 } 77 77 return time_left_str + Long.toString(seconds_left); -
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r8565 r8846 185 185 if (n.getCoor() != null) { 186 186 out.print(" lat='"+LatLon.cDdHighPecisionFormatter.format(n.getCoor().lat())+ 187 "' lon='"+LatLon.cDdHighPecisionFormatter.format(n.getCoor().lon())+ "'");187 "' lon='"+LatLon.cDdHighPecisionFormatter.format(n.getCoor().lon())+'\''); 188 188 } 189 189 addTags(n, "node", true); … … 226 226 public void visit(Changeset cs) { 227 227 out.print(" <changeset "); 228 out.print(" id='"+cs.getId()+ "'");228 out.print(" id='"+cs.getId()+'\''); 229 229 if (cs.getUser() != null) { 230 out.print(" user='"+cs.getUser().getName() + "'");231 out.print(" uid='"+cs.getUser().getId() + "'");230 out.print(" user='"+cs.getUser().getName() +'\''); 231 out.print(" uid='"+cs.getUser().getId() +'\''); 232 232 } 233 233 if (cs.getCreatedAt() != null) { 234 out.print(" created_at='"+DateUtils.fromDate(cs.getCreatedAt()) + "'");234 out.print(" created_at='"+DateUtils.fromDate(cs.getCreatedAt()) +'\''); 235 235 } 236 236 if (cs.getClosedAt() != null) { 237 out.print(" closed_at='"+DateUtils.fromDate(cs.getClosedAt()) + "'");238 } 239 out.print(" open='"+ (cs.isOpen() ? "true" : "false") + "'");237 out.print(" closed_at='"+DateUtils.fromDate(cs.getClosedAt()) +'\''); 238 } 239 out.print(" open='"+ (cs.isOpen() ? "true" : "false") +'\''); 240 240 if (cs.getMin() != null) { 241 out.print(" min_lon='"+ cs.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES) + "'");242 out.print(" min_lat='"+ cs.getMin().latToString(CoordinateFormat.DECIMAL_DEGREES) + "'");241 out.print(" min_lon='"+ cs.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES) +'\''); 242 out.print(" min_lat='"+ cs.getMin().latToString(CoordinateFormat.DECIMAL_DEGREES) +'\''); 243 243 } 244 244 if (cs.getMax() != null) { 245 out.print(" max_lon='"+ cs.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES) + "'");246 out.print(" max_lat='"+ cs.getMin().latToString(CoordinateFormat.DECIMAL_DEGREES) + "'");245 out.print(" max_lon='"+ cs.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES) +'\''); 246 out.print(" max_lat='"+ cs.getMin().latToString(CoordinateFormat.DECIMAL_DEGREES) +'\''); 247 247 } 248 248 out.println(">"); … … 268 268 "' v='"+XmlWriter.encode(e.getValue())+ "' />"); 269 269 } 270 out.println(" </" + tagname + ">");270 out.println(" </" + tagname + '>'); 271 271 } else if (tagOpen) { 272 272 out.println(" />"); 273 273 } else { 274 out.println(" </" + tagname + ">");274 out.println(" </" + tagname + '>'); 275 275 } 276 276 } … … 283 283 out.print(" <"+tagname); 284 284 if (osm.getUniqueId() != 0) { 285 out.print(" id='"+ osm.getUniqueId()+ "'");285 out.print(" id='"+ osm.getUniqueId()+'\''); 286 286 } else 287 287 throw new IllegalStateException(tr("Unexpected id 0 for osm primitive found")); … … 295 295 } 296 296 if (action != null) { 297 out.print(" action='"+action+ "'");297 out.print(" action='"+action+'\''); 298 298 } 299 299 } 300 300 if (!osm.isTimestampEmpty()) { 301 out.print(" timestamp='"+DateUtils.fromTimestamp(osm.getRawTimestamp())+ "'");301 out.print(" timestamp='"+DateUtils.fromTimestamp(osm.getRawTimestamp())+'\''); 302 302 } 303 303 // user and visible added with 0.4 API 304 304 if (osm.getUser() != null) { 305 305 if (osm.getUser().isLocalUser()) { 306 out.print(" user='"+XmlWriter.encode(osm.getUser().getName())+ "'");306 out.print(" user='"+XmlWriter.encode(osm.getUser().getName())+'\''); 307 307 } else if (osm.getUser().isOsmUser()) { 308 308 // uid added with 0.6 309 out.print(" uid='"+ osm.getUser().getId()+ "'");310 out.print(" user='"+XmlWriter.encode(osm.getUser().getName())+ "'");309 out.print(" uid='"+ osm.getUser().getId()+'\''); 310 out.print(" user='"+XmlWriter.encode(osm.getUser().getName())+'\''); 311 311 } 312 312 } 313 out.print(" visible='"+osm.isVisible()+ "'");313 out.print(" visible='"+osm.isVisible()+'\''); 314 314 } 315 315 if (osm.getVersion() != 0) { 316 out.print(" version='"+osm.getVersion()+ "'");316 out.print(" version='"+osm.getVersion()+'\''); 317 317 } 318 318 if (this.changeset != null && this.changeset.getId() != 0) { 319 out.print(" changeset='"+this.changeset.getId()+ "'");319 out.print(" changeset='"+this.changeset.getId()+'\''); 320 320 } else if (osm.getChangesetId() > 0 && !osm.isNew()) { 321 out.print(" changeset='"+osm.getChangesetId()+ "'");321 out.print(" changeset='"+osm.getChangesetId()+'\''); 322 322 } 323 323 } -
trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java
r8788 r8846 50 50 String realQuery = completeOverpassQuery(overpassQuery); 51 51 return "interpreter?data=" + Utils.encodeUrl(realQuery) 52 + "&bbox=" + lon1 + "," + lat1 + "," + lon2 + ","+ lat2;52 + "&bbox=" + lon1 + ',' + lat1 + ',' + lon2 + ',' + lat2; 53 53 } 54 54 } 55 55 56 56 private String completeOverpassQuery(String query) { 57 int firstColon = query.indexOf( ";");57 int firstColon = query.indexOf(';'); 58 58 if (firstColon == -1) { 59 59 return "[bbox];" + query; -
trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java
r8510 r8846 55 55 if (response == null || response.isCanceled()) 56 56 return null; 57 credentialsTried.put(getRequestorType(), true);57 credentialsTried.put(getRequestorType(), Boolean.TRUE); 58 58 return new PasswordAuthentication(response.getUsername(), response.getPassword()); 59 59 } catch (CredentialsAgentException e) { -
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r8510 r8846 149 149 try { 150 150 bounds = new ImageryBounds( 151 atts.getValue("min-lat") + ","+152 atts.getValue("min-lon") + ","+153 atts.getValue("max-lat") + ","+151 atts.getValue("min-lat") + ',' + 152 atts.getValue("min-lon") + ',' + 153 atts.getValue("max-lat") + ',' + 154 154 atts.getValue("max-lon"), ","); 155 155 } catch (IllegalArgumentException e) { -
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r8650 r8846 121 121 final String getCapabilitiesQuery = "VERSION=1.1.1&SERVICE=WMS&REQUEST=GetCapabilities"; 122 122 if (getCapabilitiesUrl.getQuery() == null) { 123 getCapabilitiesUrl = new URL(serviceUrlStr + "?"+ getCapabilitiesQuery);123 getCapabilitiesUrl = new URL(serviceUrlStr + '?' + getCapabilitiesQuery); 124 124 } else if (!getCapabilitiesUrl.getQuery().isEmpty() && !getCapabilitiesUrl.getQuery().endsWith("&")) { 125 getCapabilitiesUrl = new URL(serviceUrlStr + "&"+ getCapabilitiesQuery);125 getCapabilitiesUrl = new URL(serviceUrlStr + '&' + getCapabilitiesQuery); 126 126 } else { 127 127 getCapabilitiesUrl = new URL(serviceUrlStr + getCapabilitiesQuery); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
r8510 r8846 109 109 command = command.substring(1); 110 110 } 111 String commandWithSlash = "/"+ command;111 String commandWithSlash = '/' + command; 112 112 if (handlers.get(commandWithSlash) != null) { 113 113 Main.info("RemoteControl: ignoring duplicate command " + command … … 116 116 if (!silent) { 117 117 Main.info("RemoteControl: adding command \"" + 118 command + "\" (handled by " + handler.getSimpleName() + ")");118 command + "\" (handled by " + handler.getSimpleName() + ')'); 119 119 } 120 120 handlers.put(commandWithSlash, handler); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
r8510 r8846 81 81 82 82 // Parse the arguments 83 Main.info("Adding node at (" + lat + ", " + lon + ")");83 Main.info("Adding node at (" + lat + ", " + lon + ')'); 84 84 85 85 // Create a new node … … 118 118 lon = Double.parseDouble(args.get("lon")); 119 119 } catch (NumberFormatException e) { 120 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+ ")", e);120 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+')', e); 121 121 } 122 122 if (!Main.main.hasEditLayer()) { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java
r8540 r8846 106 106 allCoordinates.add(new LatLon(lat, lon)); 107 107 } catch (NumberFormatException e) { 108 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+ ")", e);108 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+')', e); 109 109 } 110 110 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/FeaturesHandler.java
r8510 r8846 33 33 buf.append(", "); 34 34 } 35 String info = RequestProcessor.getHandlerInfoAsJSON( "/"+s);35 String info = RequestProcessor.getHandlerInfoAsJSON('/'+s); 36 36 if (info != null) { 37 37 buf.append(info); … … 48 48 contentType = "application/json"; 49 49 if (args.containsKey("jsonp")) { 50 content = args.get("jsonp") + " && " + args.get("jsonp") + "(" + content + ")";50 content = args.get("jsonp") + " && " + args.get("jsonp") + '(' + content + ')'; 51 51 } 52 52 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r8811 r8846 274 274 maxlon = LatLon.roundToOsmPrecision(Double.parseDouble(args.get("right"))); 275 275 } catch (NumberFormatException e) { 276 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+ ")", e);276 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+')', e); 277 277 } 278 278 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r8510 r8846 224 224 if (value == null || value.isEmpty()) { 225 225 error = true; 226 Main.warn( "'"+ myCommand + "' remote control request must have '" + key + "' parameter");226 Main.warn('\'' + myCommand + "' remote control request must have '" + key + "' parameter"); 227 227 missingKeys.add(key); 228 228 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/VersionHandler.java
r8444 r8846 23 23 contentType = "application/json"; 24 24 if (args.containsKey("jsonp")) { 25 content = args.get("jsonp") + " && " + args.get("jsonp") + "(" + content + ")";25 content = args.get("jsonp") + " && " + args.get("jsonp") + "(" + content + ')'; 26 26 } 27 27 } -
trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java
r8540 r8846 106 106 List<SessionReader.LayerDependency> deps = support.getLayerDependencies(); 107 107 if (!deps.isEmpty()) { 108 Layer layer = deps. iterator().next().getLayer();108 Layer layer = deps.get(0).getLayer(); 109 109 if (layer instanceof GpxLayer) { 110 110 gpxLayer = (GpxLayer) layer; -
trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java
r8803 r8846 49 49 AbstractTileSourceLayer tsLayer = (AbstractTileSourceLayer) layer; 50 50 if (attributes.containsKey("automatic-downloading")) { 51 tsLayer.autoLoad = Boolean. valueOf(attributes.get("automatic-downloading"));51 tsLayer.autoLoad = Boolean.parseBoolean(attributes.get("automatic-downloading")); 52 52 } 53 53 54 54 if (attributes.containsKey("automatically-change-resolution")) { 55 tsLayer.autoZoom = Boolean. valueOf(attributes.get("automatically-change-resolution"));55 tsLayer.autoZoom = Boolean.parseBoolean(attributes.get("automatically-change-resolution")); 56 56 } 57 57 58 58 if (attributes.containsKey("show-errors")) { 59 tsLayer.showErrors = Boolean. valueOf(attributes.get("show-errors"));59 tsLayer.showErrors = Boolean.parseBoolean(attributes.get("show-errors")); 60 60 } 61 61 } -
trunk/src/org/openstreetmap/josm/io/session/MarkerSessionImporter.java
r8509 r8846 49 49 List<SessionReader.LayerDependency> deps = support.getLayerDependencies(); 50 50 if (!deps.isEmpty()) { 51 Layer layer = deps. iterator().next().getLayer();51 Layer layer = deps.get(0).getLayer(); 52 52 if (layer instanceof GpxLayer) { 53 53 gpxLayer = (GpxLayer) layer;
Note:
See TracChangeset
for help on using the changeset viewer.