Changeset 8394 in josm
- Timestamp:
- 2015-05-18T23:34:11+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r8390 r8394 137 137 if (dataset != null) { 138 138 String result = DatasetConsistencyTest.runTests(dataset); 139 if (result. length() == 0) {139 if (result.isEmpty()) { 140 140 text.append("Dataset consistency test: No problems found\n"); 141 141 } else { -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r8379 r8394 625 625 626 626 public static SearchSetting readFromString(String s) { 627 if (s. length() == 0)627 if (s.isEmpty()) 628 628 return null; 629 629 … … 664 664 665 665 public String writeToString() { 666 if (text == null || text. length() == 0)666 if (text == null || text.isEmpty()) 667 667 return ""; 668 668 -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r8250 r8394 619 619 keyPattern = Pattern.compile(key, regexFlags(false)); 620 620 } catch (PatternSyntaxException e) { 621 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()) );621 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e); 622 622 } catch (Exception e) { 623 throw new ParseError(tr(rxErrorMsgNoPos, key, e.getMessage()) );623 throw new ParseError(tr(rxErrorMsgNoPos, key, e.getMessage()), e); 624 624 } 625 625 } else { … … 630 630 valuePattern = Pattern.compile(this.value, regexFlags(false)); 631 631 } catch (PatternSyntaxException e) { 632 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()) );632 throw new ParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e); 633 633 } catch (Exception e) { 634 throw new ParseError(tr(rxErrorMsgNoPos, value, e.getMessage()) );634 throw new ParseError(tr(rxErrorMsgNoPos, value, e.getMessage()), e); 635 635 } 636 636 } else { -
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r8390 r8394 604 604 return; // some basic protection 605 605 } 606 if (address == null || path == null || address. length() == 0 || path.length() == 0) {606 if (address == null || path == null || address.isEmpty() || path.isEmpty()) { 607 607 log("Error: Please specify url=\"where to get file\" and path=\"where to place it\""); 608 608 return; -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r8390 r8394 769 769 */ 770 770 public boolean put(final String key, String value) { 771 if(value != null && value. length() == 0) {771 if(value != null && value.isEmpty()) { 772 772 value = null; 773 773 } -
trunk/src/org/openstreetmap/josm/data/imagery/Shape.java
r8291 r8394 72 72 throw new IllegalArgumentException(tr("Illegal latitude value ''{0}''", lat)); 73 73 } catch (NumberFormatException e) { 74 throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", sLat) );74 throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", sLat), e); 75 75 } 76 76 … … 80 80 throw new IllegalArgumentException(tr("Illegal longitude value ''{0}''", lon)); 81 81 } catch (NumberFormatException e) { 82 throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", sLon) );82 throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", sLon), e); 83 83 } 84 84 -
trunk/src/org/openstreetmap/josm/data/validation/routines/RegexValidator.java
r8390 r8394 109 109 int flags = caseSensitive ? 0: Pattern.CASE_INSENSITIVE; 110 110 for (int i = 0; i < regexs.length; i++) { 111 if (regexs[i] == null || regexs[i]. length() == 0) {111 if (regexs[i] == null || regexs[i].isEmpty()) { 112 112 throw new IllegalArgumentException("Regular expression[" + i + "] is missing"); 113 113 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r8378 r8394 354 354 withErrors.put(p, "LK"); 355 355 } 356 if (checkValues && (value==null || value.trim(). length() == 0) && !withErrors.contains(p, "EV")) {356 if (checkValues && (value==null || value.trim().isEmpty()) && !withErrors.contains(p, "EV")) { 357 357 errors.add( new TestError(this, Severity.WARNING, tr("Tags with empty values"), 358 358 tr(s, key), MessageFormat.format(s, key), EMPTY_VALUES, p) ); … … 563 563 String key = prop.getKey(); 564 564 String value = prop.getValue(); 565 if (value == null || value.trim(). length() == 0) {565 if (value == null || value.trim().isEmpty()) { 566 566 commands.add(new ChangePropertyCommand(p, key, null)); 567 567 } else if (value.startsWith(" ") || value.endsWith(" ")) { … … 679 679 try { 680 680 description = m.group(1); 681 if (description != null && description. length() == 0) {681 if (description != null && description.isEmpty()) { 682 682 description = null; 683 683 } -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r8390 r8394 274 274 } 275 275 if(n == null && way.get("building") != null) n = tr("building"); 276 if(n == null || n. length() == 0) {276 if(n == null || n.isEmpty()) { 277 277 n = String.valueOf(way.getId()); 278 278 } -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r8380 r8394 1013 1013 } 1014 1014 currentSearchText = searchTerm; 1015 if (searchTerm. length() == 0) {1015 if (searchTerm.isEmpty()) { 1016 1016 // No text to search 1017 1017 hideMenu(); -
trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
r8376 r8394 111 111 @Override 112 112 public void setCustomText(String text) { 113 if(text == null || text.trim(). length() == 0) {113 if(text == null || text.trim().isEmpty()) { 114 114 customText.setVisible(false); 115 115 adjustLayout(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
r8308 r8394 984 984 public void validate() { 985 985 String value = getComponent().getText(); 986 if (value == null || value.trim(). length() == 0) {986 if (value == null || value.trim().isEmpty()) { 987 987 feedbackInvalid(""); 988 988 return; … … 1003 1003 public int getUid() { 1004 1004 String value = getComponent().getText(); 1005 if (value == null || value.trim(). length() == 0) return 0;1005 if (value == null || value.trim().isEmpty()) return 0; 1006 1006 try { 1007 1007 int uid = Integer.parseInt(value.trim()); … … 1031 1031 public void validate() { 1032 1032 String value = getComponent().getText(); 1033 if (value.trim(). length() == 0) {1033 if (value.trim().isEmpty()) { 1034 1034 feedbackInvalid(tr("<html>The current value is not a valid user name.<br>Please enter an non-empty user name.</html>")); 1035 1035 return; … … 1120 1120 @Override 1121 1121 public boolean isValid() { 1122 if (getComponent().getText().trim(). length() == 0) return true;1122 if (getComponent().getText().trim().isEmpty()) return true; 1123 1123 return getDate() != null; 1124 1124 } … … 1157 1157 1158 1158 public Date getDate() { 1159 if (getComponent().getText().trim(). length() == 0)1159 if (getComponent().getText().trim().isEmpty()) 1160 1160 return null; 1161 1161 -
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r8390 r8394 296 296 @Override 297 297 public void actionPerformed(ActionEvent e) { 298 if (!isEnabled() || cbSearchExpression.getText().trim(). length() == 0)298 if (!isEnabled() || cbSearchExpression.getText().trim().isEmpty()) 299 299 return; 300 300 cbSearchExpression.addCurrentItemToHistory(); -
trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
r7862 r8394 144 144 public static String buildAbsoluteHelpTopic(String topic, LocaleType type) { 145 145 String prefix = getHelpTopicPrefix(type); 146 if (prefix == null || topic == null || topic.trim(). length() == 0|| "/".equals(topic.trim()))146 if (prefix == null || topic == null || topic.trim().isEmpty() || "/".equals(topic.trim())) 147 147 return prefix; 148 148 prefix += "/" + topic; -
trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java
r7937 r8394 54 54 55 55 private static class DownloadException extends Exception { 56 public DownloadException(String msg) { 57 super(msg); 56 /** 57 * Constructs a new {@code DownloadException}. 58 * @param message the detail message. The detail message is saved for 59 * later retrieval by the {@link #getMessage()} method. 60 * @param cause the cause (which is saved for later retrieval by the 61 * {@link #getCause()} method). (A <tt>null</tt> value is 62 * permitted, and indicates that the cause is nonexistent or unknown.) 63 */ 64 public DownloadException(String message, Throwable cause) { 65 super(message, cause); 58 66 } 59 67 } … … 133 141 String msg = tr("Cannot download file ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", file.getName(), address); 134 142 Main.warn(msg); 135 throw new DownloadException(msg );143 throw new DownloadException(msg, e); 136 144 } catch (IOException e) { 137 145 if (canceled) 138 146 return; 139 throw new DownloadException(e.getMessage() );147 throw new DownloadException(e.getMessage(), e); 140 148 } finally { 141 149 closeConnectionIfNeeded(); -
trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
r8390 r8394 120 120 sb.append("<hr/>"); 121 121 String userName = XmlWriter.encode(comment.getUser().getName()); 122 if (userName == null || userName.trim(). length() == 0) {122 if (userName == null || userName.trim().isEmpty()) { 123 123 userName = "<Anonymous>"; 124 124 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r8378 r8394 811 811 public void actionPerformed(ActionEvent e) { 812 812 String result = DatasetConsistencyTest.runTests(data); 813 if (result. length() == 0) {813 if (result.isEmpty()) { 814 814 JOptionPane.showMessageDialog(Main.parent, tr("No problems found")); 815 815 } else { -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r8393 r8394 317 317 String tzId = Main.pref.get("geoimage.timezoneid", ""); 318 318 TimeZone defaultTz; 319 if (tzId. length() == 0) {319 if (tzId.isEmpty()) { 320 320 defaultTz = TimeZone.getDefault(); 321 321 } else { … … 1308 1308 private double parseTimezone(String timezone) throws ParseException { 1309 1309 1310 if (timezone.isEmpty()) 1311 return 0; 1312 1310 1313 String error = tr("Error while parsing timezone.\nExpected format: {0}", "+H:MM"); 1311 1312 if (timezone.length() == 0)1313 return 0;1314 1314 1315 1315 char sgnTimezone = '+'; … … 1322 1322 case ' ' : 1323 1323 if (state != 2 || hTimezone.length() != 0) 1324 throw new ParseException(error, 0);1324 throw new ParseException(error, i); 1325 1325 break; 1326 1326 case '+' : … … 1330 1330 state = 2; 1331 1331 } else 1332 throw new ParseException(error, 0);1332 throw new ParseException(error, i); 1333 1333 break; 1334 1334 case ':' : … … 1337 1337 state = 3; 1338 1338 } else 1339 throw new ParseException(error, 0);1339 throw new ParseException(error, i); 1340 1340 break; 1341 1341 case '0' : case '1' : case '2' : case '3' : case '4' : … … 1351 1351 break; 1352 1352 default : 1353 throw new ParseException(error, 0);1353 throw new ParseException(error, i); 1354 1354 } 1355 1355 break; 1356 1356 default : 1357 throw new ParseException(error, 0);1357 throw new ParseException(error, i); 1358 1358 } 1359 1359 } … … 1368 1368 } catch (NumberFormatException nfe) { 1369 1369 // Invalid timezone 1370 throw new ParseException(error, 0);1371 } 1372 1373 if (h > 12 || m > 59 1374 throw new ParseException(error, 0);1370 throw new ParseException(error, 0); 1371 } 1372 1373 if (h > 12 || m > 59) 1374 throw new ParseException(error, 0); 1375 1375 else 1376 1376 return (h + m / 60.0) * (sgnTimezone == '-' ? -1 : 1); … … 1380 1380 String error = tr("Error while parsing offset.\nExpected format: {0}", "number"); 1381 1381 1382 if ( offset.length() > 0) {1382 if (!offset.isEmpty()) { 1383 1383 try { 1384 1384 if(offset.startsWith("+")) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r8097 r8394 224 224 225 225 /* non-prefixed path is generic path, always take it */ 226 if(a[0]. length() == 0|| source.getPrefName().equals(a[0])) {226 if(a[0].isEmpty() || source.getPrefName().equals(a[0])) { 227 227 dirs.add(a[1]); 228 228 } -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r8390 r8394 703 703 704 704 private static void prepareFileChooser(String url, AbstractFileChooser fc) { 705 if (url == null || url.trim(). length() == 0) return;705 if (url == null || url.trim().isEmpty()) return; 706 706 URL sourceUrl = null; 707 707 try { -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r8390 r8394 780 780 LAST_VALUES.put(key, v); 781 781 } 782 if (v.equals(originalValue) || (originalValue == null && v. length() == 0))782 if (v.equals(originalValue) || (originalValue == null && v.isEmpty())) 783 783 return; 784 784 … … 1156 1156 // no change if same as before 1157 1157 if (originalValue == null) { 1158 if (value. length() == 0)1158 if (value.isEmpty()) 1159 1159 return; 1160 1160 } else if (value.equals(originalValue.toString())) -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
r8308 r8394 81 81 try { 82 82 Long.parseLong(str); 83 if (currentText. length() == 0) {83 if (currentText.isEmpty()) { 84 84 // we don't autocomplete on numbers 85 85 super.insertString(offs, str, a); -
trunk/src/org/openstreetmap/josm/gui/util/RotationAngle.java
r8378 r8394 39 39 */ 40 40 public static RotationAngle buildStaticRotation(final String string) { 41 final double value;42 41 try { 43 value = parseCardinalRotation(string);44 } catch (IllegalArgumentException ignore) {45 throw new IllegalArgumentException("Invalid string: " + string );42 return buildStaticRotation(parseCardinalRotation(string)); 43 } catch (IllegalArgumentException e) { 44 throw new IllegalArgumentException("Invalid string: " + string, e); 46 45 } 47 return buildStaticRotation(value);48 46 } 49 47 -
trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
r8390 r8394 315 315 316 316 /** 317 * Constructs a new {@code ChangesetQueryUrlException} with the specified cause and detail message. 318 * 319 * @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()} method. 320 * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). 321 * (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) 322 */ 323 public ChangesetQueryUrlException(String message, Throwable cause) { 324 super(message, cause); 325 } 326 327 /** 317 328 * Constructs a new {@code ChangesetQueryUrlException} with the specified cause and a detail message of 318 329 * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class and detail message of <tt>cause</tt>). … … 329 340 protected int parseUid(String value) throws ChangesetQueryUrlException { 330 341 if (value == null || value.trim().isEmpty()) 331 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "uid", value)); 342 throw new ChangesetQueryUrlException( 343 tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "uid", value)); 332 344 int id; 333 345 try { 334 346 id = Integer.parseInt(value); 335 347 if (id <= 0) 336 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "uid", value)); 348 throw new ChangesetQueryUrlException( 349 tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "uid", value)); 337 350 } catch(NumberFormatException e) { 338 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "uid", value)); 351 throw new ChangesetQueryUrlException( 352 tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "uid", value), e); 339 353 } 340 354 return id; … … 343 357 protected boolean parseBoolean(String value, String parameter) throws ChangesetQueryUrlException { 344 358 if (value == null || value.trim().isEmpty()) 345 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter, value)); 359 throw new ChangesetQueryUrlException( 360 tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter, value)); 346 361 switch (value) { 347 362 case "true": … … 350 365 return false; 351 366 default: 352 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter, value)); 367 throw new ChangesetQueryUrlException( 368 tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter, value)); 353 369 } 354 370 } … … 356 372 protected Date parseDate(String value, String parameter) throws ChangesetQueryUrlException { 357 373 if (value == null || value.trim().isEmpty()) 358 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter, value)); 374 throw new ChangesetQueryUrlException( 375 tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter, value)); 359 376 DateFormat formatter = DateUtils.newIsoDateTimeFormat(); 360 377 try { 361 378 return formatter.parse(value); 362 379 } catch(ParseException e) { 363 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter, value)); 380 throw new ChangesetQueryUrlException( 381 tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter, value), e); 364 382 } 365 383 } … … 368 386 String[] dates = value.split(","); 369 387 if (dates == null || dates.length == 0 || dates.length > 2) 370 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "time", value)); 388 throw new ChangesetQueryUrlException( 389 tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "time", value)); 371 390 if (dates.length == 1) 372 391 return new Date[]{parseDate(dates[0], "time")}; … … 395 414 case "uid": 396 415 if (queryParams.containsKey("display_name")) 397 throw new ChangesetQueryUrlException(tr("Cannot create a changeset query including both the query parameters ''uid'' and ''display_name''")); 416 throw new ChangesetQueryUrlException( 417 tr("Cannot create a changeset query including both the query parameters ''uid'' and ''display_name''")); 398 418 csQuery.forUser(parseUid(queryParams.get("uid"))); 399 419 break; 400 420 case "display_name": 401 421 if (queryParams.containsKey("uid")) 402 throw new ChangesetQueryUrlException(tr("Cannot create a changeset query including both the query parameters ''uid'' and ''display_name''")); 422 throw new ChangesetQueryUrlException( 423 tr("Cannot create a changeset query including both the query parameters ''uid'' and ''display_name''")); 403 424 csQuery.forUser(queryParams.get("display_name")); 404 425 break; … … 435 456 break; 436 457 default: 437 throw new ChangesetQueryUrlException(tr("Unsupported parameter ''{0}'' in changeset query string", k)); 458 throw new ChangesetQueryUrlException( 459 tr("Unsupported parameter ''{0}'' in changeset query string", k)); 438 460 } 439 461 } -
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r7187 r8394 111 111 public final void initFromPreferences() { 112 112 String value = Main.pref.get(ProxyPreferencesPanel.PROXY_POLICY); 113 if (value. length() == 0) {113 if (value.isEmpty()) { 114 114 proxyPolicy = ProxyPolicy.NO_PROXY; 115 115 } else { -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r8390 r8394 361 361 osm.setChangesetId(getChangeset().getId()); 362 362 } catch(NumberFormatException e){ 363 throw new OsmTransferException(tr("Unexpected format of ID replied by the server. Got ''{0}''.", ret) );363 throw new OsmTransferException(tr("Unexpected format of ID replied by the server. Got ''{0}''.", ret), e); 364 364 } 365 365 } … … 384 384 } catch(NumberFormatException e) { 385 385 throw new OsmTransferException(tr("Unexpected format of new version of modified primitive ''{0}''. Got ''{1}''.", 386 osm.getId(), ret) );386 osm.getId(), ret), e); 387 387 } 388 388 } … … 427 427 changeset.setOpen(true); 428 428 } catch(NumberFormatException e){ 429 throw new OsmTransferException(tr("Unexpected format of ID replied by the server. Got ''{0}''.", ret) );429 throw new OsmTransferException(tr("Unexpected format of ID replied by the server. Got ''{0}''.", ret), e); 430 430 } 431 431 progressMonitor.setCustomText(tr("Successfully opened changeset {0}",changeset.getId())); -
trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java
r6716 r8394 35 35 } 36 36 37 @Override public void importData(File file, ProgressMonitor progressMonitor) throws IOException, IllegalDataException { 37 @Override 38 public void importData(File file, ProgressMonitor progressMonitor) throws IOException, IllegalDataException { 38 39 try { 39 40 importData(Compression.getUncompressedFileInputStream(file), file, progressMonitor); 40 41 } catch (FileNotFoundException e) { 41 42 Main.error(e); 42 throw new IOException(tr("File ''{0}'' does not exist.", file.getName()) );43 throw new IOException(tr("File ''{0}'' does not exist.", file.getName()), e); 43 44 } 44 45 } -
trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java
r7509 r8394 52 52 userInfo.setId(Integer.parseInt(v)); 53 53 } catch(NumberFormatException e) { 54 throw new XmlParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "id", "user", v) );54 throw new XmlParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "id", "user", v), e); 55 55 } 56 56 // -- display name … … 77 77 lat = Double.parseDouble(v); 78 78 } catch(NumberFormatException e) { 79 throw new XmlParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "lat", "home", v)); 79 throw new XmlParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", 80 "lat", "home", v), e); 80 81 } 81 82 … … 87 88 lon = Double.parseDouble(v); 88 89 } catch(NumberFormatException e) { 89 throw new XmlParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "lon", "home", v)); 90 throw new XmlParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", 91 "lon", "home", v), e); 90 92 } 91 93 … … 97 99 zoom = Integer.parseInt(v); 98 100 } catch(NumberFormatException e) { 99 throw new XmlParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "zoom", "home", v)); 101 throw new XmlParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", 102 "zoom", "home", v), e); 100 103 } 101 104 userInfo.setHome(new LatLon(lat,lon)); -
trunk/src/org/openstreetmap/josm/io/ProgressInputStream.java
r6380 r8394 38 38 progressMonitor.finishTask(); 39 39 if (con.getHeaderField("Error") != null) 40 throw new OsmTransferException(tr(con.getHeaderField("Error")) );40 throw new OsmTransferException(tr(con.getHeaderField("Error")), e); 41 41 throw new OsmTransferException(e); 42 42 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/DNSName.java
r8291 r8394 71 71 */ 72 72 public DNSName(String name) throws IOException { 73 if (name == null || name. length() == 0)73 if (name == null || name.isEmpty()) 74 74 throw new IOException("DNS name must not be null"); 75 75 if (name.indexOf(' ') != -1) -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
r7937 r8394 30 30 private double lat; 31 31 private double lon; 32 32 33 33 private Node node; 34 34 … … 47 47 return new String[] { "lat", "lon" }; 48 48 } 49 49 50 50 @Override 51 51 public String[] getOptionalParams() … … 63 63 return new String[] { 64 64 "/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==" 66 66 }; 67 67 } 68 68 69 69 @Override 70 70 public String getPermissionMessage() { … … 122 122 lon = Double.parseDouble(args.get("lon")); 123 123 } catch (NumberFormatException e) { 124 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")" );124 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")", e); 125 125 } 126 126 if (!Main.main.hasEditLayer()) { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java
r8332 r8394 104 104 allCoordinates.add(new LatLon(lat, lon)); 105 105 } catch (NumberFormatException e) { 106 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")" );106 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")", e); 107 107 } 108 108 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r8318 r8394 272 272 maxlon = LatLon.roundToOsmPrecision(Double.parseDouble(args.get("right"))); 273 273 } catch (NumberFormatException e) { 274 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")" );274 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")", e); 275 275 } 276 276 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r8338 r8394 223 223 if(mandatory != null) for (String key : mandatory) { 224 224 String value = args.get(key); 225 if ( (value == null) || (value.length() == 0)) {225 if (value == null || value.isEmpty()) { 226 226 error = true; 227 227 Main.warn("'" + myCommand + "' remote control request must have '" + key + "' parameter"); -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r8390 r8394 179 179 return new BufferedInputStream(new FileInputStream(file)); 180 180 } catch (FileNotFoundException e) { 181 throw new IOException(tr("File ''{0}'' does not exist.", file.getPath()) );181 throw new IOException(tr("File ''{0}'' does not exist.", file.getPath()), e); 182 182 } 183 183 } else if (inZipPath != null) { -
trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
r8291 r8394 137 137 } 138 138 } catch (MalformedURLException e) { 139 String msg = tr("Cannot download plugin ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", pi.name, pi.downloadlink); 139 String msg = tr("Cannot download plugin ''{0}''. Its download link ''{1}'' is not a valid URL. Skipping download.", 140 pi.name, pi.downloadlink); 140 141 Main.warn(msg); 141 throw new PluginDownloadException(msg );142 throw new PluginDownloadException(msg, e); 142 143 } catch (IOException e) { 143 144 if (canceled) -
trunk/src/org/openstreetmap/josm/tools/CopyList.java
r8285 r8394 178 178 } catch (IndexOutOfBoundsException e) { 179 179 checkForComodification(); 180 throw new NoSuchElementException( );180 throw new NoSuchElementException(e.getMessage()); 181 181 } 182 182 } … … 196 196 expectedModCount = modCount; 197 197 } catch (IndexOutOfBoundsException e) { 198 throw new ConcurrentModificationException( );198 throw new ConcurrentModificationException(e); 199 199 } 200 200 } -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r8390 r8394 153 153 Matcher m = p.matcher(preferenceValue); 154 154 if (!m.find()) 155 throw new WindowGeometryException(tr("Preference with key ''{0}'' does not include ''{1}''. Cannot restore window geometry from preferences.", preferenceKey, field)); 155 throw new WindowGeometryException( 156 tr("Preference with key ''{0}'' does not include ''{1}''. Cannot restore window geometry from preferences.", 157 preferenceKey, field)); 156 158 v = m.group(1); 157 159 return Integer.parseInt(v); … … 159 161 throw e; 160 162 } catch(NumberFormatException e) { 161 throw new WindowGeometryException(tr("Preference with key ''{0}'' does not provide an int value for ''{1}''. Got {2}. Cannot restore window geometry from preferences.", preferenceKey, field, v)); 163 throw new WindowGeometryException( 164 tr("Preference with key ''{0}'' does not provide an int value for ''{1}''. Got {2}. Cannot restore window geometry from preferences.", 165 preferenceKey, field, v), e); 162 166 } catch(Exception e) { 163 throw new WindowGeometryException(tr("Failed to parse field ''{1}'' in preference with key ''{0}''. Exception was: {2}. Cannot restore window geometry from preferences.", preferenceKey, field, e.toString()), e); 167 throw new WindowGeometryException( 168 tr("Failed to parse field ''{1}'' in preference with key ''{0}''. Exception was: {2}. Cannot restore window geometry from preferences.", 169 preferenceKey, field, e.toString()), e); 164 170 } 165 171 } … … 168 174 String value = Main.pref.get(preferenceKey); 169 175 if (value == null || value.isEmpty()) 170 throw new WindowGeometryException(tr("Preference with key ''{0}'' does not exist. Cannot restore window geometry from preferences.", preferenceKey)); 176 throw new WindowGeometryException( 177 tr("Preference with key ''{0}'' does not exist. Cannot restore window geometry from preferences.", preferenceKey)); 171 178 topLeft = new Point(); 172 179 extent = new Dimension();
Note:
See TracChangeset
for help on using the changeset viewer.