Changeset 10300 in josm for trunk/src/org/openstreetmap/josm
- Timestamp:
- 2016-05-30T01:17:28+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r10299 r10300 367 367 return rhs; 368 368 } 369 370 protected static String parenthesis(Match m) { 371 return '(' + m.toString() + ')'; 372 } 369 373 } 370 374 … … 413 417 @Override 414 418 public String toString() { 415 return "!" + match;419 return '!' + match.toString(); 416 420 } 417 421 … … 473 477 @Override 474 478 public String toString() { 475 return (lhs instanceof AbstractBinaryMatch && !(lhs instanceof And) ? ("(" + lhs + ')') : lhs) + " && "476 + (rhs instanceof AbstractBinaryMatch && !(rhs instanceof And) ? ("(" + rhs + ')') : rhs);479 return (lhs instanceof AbstractBinaryMatch && !(lhs instanceof And) ? parenthesis(lhs) : lhs) + " && " 480 + (rhs instanceof AbstractBinaryMatch && !(rhs instanceof And) ? parenthesis(rhs) : rhs); 477 481 } 478 482 } … … 503 507 @Override 504 508 public String toString() { 505 return (lhs instanceof AbstractBinaryMatch && !(lhs instanceof Or) ? ("(" + lhs + ')') : lhs) + " || "506 + (rhs instanceof AbstractBinaryMatch && !(rhs instanceof Or) ? ("(" + rhs + ')') : rhs);509 return (lhs instanceof AbstractBinaryMatch && !(lhs instanceof Or) ? parenthesis(lhs) : lhs) + " || " 510 + (rhs instanceof AbstractBinaryMatch && !(rhs instanceof Or) ? parenthesis(rhs) : rhs); 507 511 } 508 512 } … … 533 537 @Override 534 538 public String toString() { 535 return (lhs instanceof AbstractBinaryMatch && !(lhs instanceof Xor) ? ("(" + lhs + ')') : lhs) + " ^ "536 + (rhs instanceof AbstractBinaryMatch && !(rhs instanceof Xor) ? ("(" + rhs + ')') : rhs);539 return (lhs instanceof AbstractBinaryMatch && !(lhs instanceof Xor) ? parenthesis(lhs) : lhs) + " ^ " 540 + (rhs instanceof AbstractBinaryMatch && !(rhs instanceof Xor) ? parenthesis(rhs) : rhs); 537 541 } 538 542 } -
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r10299 r10300 171 171 while (true) { 172 172 String filename = String.format("%1$s_%2$tY%2$tm%2$td_%2$tH%2$tM%2$tS%2$tL%3$s", 173 layer.layerFileName, now, index == 0 ? "" : ( "_" + index));173 layer.layerFileName, now, index == 0 ? "" : ('_' + Integer.toString(index))); 174 174 File result = new File(autosaveDir, filename + '.' + Main.pref.get("autosave.extension", "osm")); 175 175 try { -
trunk/src/org/openstreetmap/josm/data/ProjectionBounds.java
r9419 r10300 106 106 @Override 107 107 public String toString() { 108 return "ProjectionBounds["+minEast+ ","+minNorth+","+maxEast+","+maxNorth+']';108 return "ProjectionBounds["+minEast+','+minNorth+','+maxEast+','+maxNorth+']'; 109 109 } 110 110 -
trunk/src/org/openstreetmap/josm/data/Version.java
r9407 r10300 191 191 s += " SVN"; 192 192 } 193 String result = "JOSM/1.5 ("+ s+' '+LanguageInfo.getJOSMLocaleCode()+ ")";193 String result = "JOSM/1.5 ("+ s+' '+LanguageInfo.getJOSMLocaleCode()+')'; 194 194 if (includeOsDetails && Main.platform != null) { 195 195 result += ' ' + Main.platform.getOSDescription(); -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r10212 r10300 863 863 public String getExtendedUrl() { 864 864 return imageryType.getTypeString() + (defaultMaxZoom != 0 865 ? "["+(defaultMinZoom != 0 ? Integer.toString(defaultMinZoom) + ',' : "")+defaultMaxZoom+"]": "") + ':' + url;865 ? ('['+(defaultMinZoom != 0 ? (Integer.toString(defaultMinZoom) + ',') : "")+defaultMaxZoom+"]") : "") + ':' + url; 866 866 } 867 867 -
trunk/src/org/openstreetmap/josm/data/notes/Note.java
r10134 r10300 148 148 @Override 149 149 public String toString() { 150 return tr("Note") + " "+ id + ": " + getFirstComment();150 return tr("Note") + ' ' + id + ": " + getFirstComment(); 151 151 } 152 152 } -
trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java
r9371 r10300 57 57 @Override 58 58 public String toString() { 59 return type + " "+ id;59 return type.toString() + ' ' + id; 60 60 } 61 61 -
trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java
r10298 r10300 1815 1815 case '\uFF0E': // fullwidth full stop 1816 1816 case '\uFF61': // halfwidth ideographic full stop 1817 return ascii + "."; // restore the missing stop1817 return ascii + '.'; // restore the missing stop 1818 1818 default: 1819 1819 return ascii; -
trunk/src/org/openstreetmap/josm/data/validation/tests/ConditionalKeys.java
r8680 r10300 104 104 // <restriction-value> @ <condition>[;<restriction-value> @ <condition>] 105 105 final List<ConditionalValue> r = new ArrayList<>(); 106 final Patternpart = Pattern.compile("([^@\\p{Space}][^@]*?)"107 + "\\s*@\\s*" + "(\\([^)\\p{Space}][^)]+?\\)|[^();\\p{Space}][^();]*?)\\s*") ;108 final Matcher m = Pattern.compile( "("+ part + ")(;\\s*" + part + ")*").matcher(value);106 final String part = Pattern.compile("([^@\\p{Space}][^@]*?)" 107 + "\\s*@\\s*" + "(\\([^)\\p{Space}][^)]+?\\)|[^();\\p{Space}][^();]*?)\\s*").toString(); 108 final Matcher m = Pattern.compile('(' + part + ")(;\\s*" + part + ")*").matcher(value); 109 109 if (!m.matches()) { 110 110 throw new ConditionalParsingException(tr("Does not match pattern ''restriction value @ condition''")); -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r10285 r10300 258 258 @Override 259 259 public String toString() { 260 return "LayerChangeAdapter [wrapped=" + wrapped + "]"; 261 } 262 260 return "LayerChangeAdapter [wrapped=" + wrapped + ']'; 261 } 263 262 } 264 263 … … 314 313 @Override 315 314 public String toString() { 316 return "EditLayerChangeAdapter [wrapped=" + wrapped + "]"; 317 } 318 315 return "EditLayerChangeAdapter [wrapped=" + wrapped + ']'; 316 } 319 317 } 320 318 -
trunk/src/org/openstreetmap/josm/gui/dialogs/DeleteFromRelationConfirmationDialog.java
r10179 r10300 114 114 numParentRelations, numParentRelations); 115 115 @I18n.QuirkyPluralString 116 final String msg = "<html>" + msg1 + " "+ msg2 + "</html>";116 final String msg = "<html>" + msg1 + ' ' + msg2 + "</html>"; 117 117 htmlPanel.getEditorPane().setText(msg); 118 118 invalidate(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
r10254 r10300 72 72 p.setVisible(false); 73 73 74 mSpltPane.add(p, "L"+i);74 mSpltPane.add(p, 'L'+Integer.toString(i)); 75 75 panels.add(p); 76 76 … … 257 257 ch.add(new Divider()); 258 258 } 259 Leaf l = new Leaf( "L"+i);259 Leaf l = new Leaf('L'+Integer.toString(i)); 260 260 l.setWeight(1.0 / numPanels); 261 261 ch.add(l); -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r9214 r10300 200 200 tfLatLon.setText(ll.latToString(CoordinateFormat.getDefaultFormat()) + ' ' + ll.lonToString(CoordinateFormat.getDefaultFormat())); 201 201 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 202 tfEastNorth.setText( en.east()+" "+en.north());202 tfEastNorth.setText(Double.toString(en.east()) + ' ' + Double.toString(en.north())); 203 203 setOkEnabled(true); 204 204 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r10179 r10300 688 688 p.add(new JScrollPane(txtErrors), GBC.std().fill()); 689 689 for (T t : items) { 690 txtErrors.append(t + "\n");690 txtErrors.append(t.toString() + '\n'); 691 691 } 692 692 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityAction.java
r10245 r10300 299 299 @Override 300 300 public String toString() { 301 return "OpacitySlider [getRealValue()=" + getRealValue() + "]";301 return "OpacitySlider [getRealValue()=" + getRealValue() + ']'; 302 302 } 303 303 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r10254 r10300 812 812 Shortcut sc = Shortcut.findShortcut(KeyEvent.VK_1, commandDownMask); 813 813 if (sc != null) { 814 lines.add(sc.getKeyText() + " "+ tr("to apply first suggestion"));815 } 816 lines.add(KeyEvent.getKeyModifiersText(KeyEvent.SHIFT_MASK)+'+'+KeyEvent.getKeyText(KeyEvent.VK_ENTER) + " "814 lines.add(sc.getKeyText() + ' ' + tr("to apply first suggestion")); 815 } 816 lines.add(KeyEvent.getKeyModifiersText(KeyEvent.SHIFT_MASK)+'+'+KeyEvent.getKeyText(KeyEvent.VK_ENTER) + ' ' 817 817 +tr("to add without closing the dialog")); 818 818 sc = Shortcut.findShortcut(KeyEvent.VK_1, commandDownMask | KeyEvent.SHIFT_DOWN_MASK); 819 819 if (sc != null) { 820 lines.add(sc.getKeyText() + " "+ tr("to add first suggestion without closing the dialog"));820 lines.add(sc.getKeyText() + ' ' + tr("to add first suggestion without closing the dialog")); 821 821 } 822 822 final JLabel helpLabel = new JLabel("<html>" + Utils.join("<br>", lines) + "</html>"); -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r10179 r10300 1625 1625 return null; 1626 1626 if (Main.isTraceEnabled()) { 1627 Main.trace("Clicked on tile: " + clickedTile.getXtile() + " "+ clickedTile.getYtile() +1627 Main.trace("Clicked on tile: " + clickedTile.getXtile() + ' ' + clickedTile.getYtile() + 1628 1628 " currentZoomLevel: " + currentZoomLevel); 1629 1629 } -
trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
r10179 r10300 304 304 return process(to); 305 305 } 306 307 @Override 308 public String toString() { 309 return "GammaImageProcessor [gamma=" + gamma + ']'; 310 } 306 311 } 307 312 … … 387 392 @Override 388 393 public String toString() { 389 return "SharpenImageProcessor [sharpenLevel=" + sharpenLevel + "]";394 return "SharpenImageProcessor [sharpenLevel=" + sharpenLevel + ']'; 390 395 } 391 396 } … … 437 442 @Override 438 443 public String toString() { 439 return "ColorfulImageProcessor [colorfulness=" + colorfulness + "]";444 return "ColorfulImageProcessor [colorfulness=" + colorfulness + ']'; 440 445 } 441 446 } … … 470 475 int type = src.getType(); 471 476 if (type != dest.getType()) { 472 Main.trace("Cannot apply color filter: Src / Dest differ in type (" + type + "/" + dest.getType() + ")");477 Main.trace("Cannot apply color filter: Src / Dest differ in type (" + type + '/' + dest.getType() + ')'); 473 478 return src; 474 479 } -
trunk/src/org/openstreetmap/josm/gui/layer/MapViewPaintable.java
r10031 r10300 31 31 */ 32 32 public PaintableInvalidationEvent(MapViewPaintable paintable) { 33 super();34 33 this.paintable = paintable; 35 34 } … … 45 44 @Override 46 45 public String toString() { 47 return "LayerInvalidationEvent [layer=" + paintable + "]";46 return "LayerInvalidationEvent [layer=" + paintable + ']'; 48 47 } 49 48 } -
trunk/src/org/openstreetmap/josm/gui/layer/NativeScaleLayer.java
r9914 r10300 240 240 StringBuilder stringBuilder = new StringBuilder(); 241 241 for (Scale s: this.scales) { 242 stringBuilder.append(s + "\n");242 stringBuilder.append(s.toString() + '\n'); 243 243 } 244 244 return stringBuilder.toString(); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r10280 r10300 804 804 final GpxLayer gpxLayer = new GpxLayer(gpxData, tr("Converted from: {0}", getName())); 805 805 if (getAssociatedFile() != null) { 806 final String filename = getAssociatedFile().getName().replaceAll(Pattern.quote(".gpx.osm") + "$", "") + ".gpx";806 String filename = getAssociatedFile().getName().replaceAll(Pattern.quote(".gpx.osm") + '$', "") + ".gpx"; 807 807 gpxLayer.setAssociatedFile(new File(getAssociatedFile().getParentFile(), filename)); 808 808 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java
r9277 r10300 95 95 96 96 private BufferedImage loadThumb(ImageEntry entry) { 97 final String cacheIdent = entry.getFile() +":"+maxSize;97 final String cacheIdent = entry.getFile().toString()+':'+maxSize; 98 98 99 99 if (!cacheOff && cache != null) { -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r10050 r10300 222 222 @Override 223 223 public String getToolTipText() { 224 return data.size()+" "+trn("marker", "markers", data.size());224 return Integer.toString(data.size())+' '+trn("marker", "markers", data.size()); 225 225 } 226 226 227 227 @Override 228 228 public void mergeFrom(Layer from) { 229 MarkerLayer layer = (MarkerLayer) from; 230 data.addAll(layer.data); 231 Collections.sort(data, new Comparator<Marker>() { 232 @Override 233 public int compare(Marker o1, Marker o2) { 234 return Double.compare(o1.time, o2.time); 235 } 236 }); 229 if (from instanceof MarkerLayer) { 230 data.addAll(((MarkerLayer) from).data); 231 Collections.sort(data, new Comparator<Marker>() { 232 @Override 233 public int compare(Marker o1, Marker o2) { 234 return Double.compare(o1.time, o2.time); 235 } 236 }); 237 } 237 238 } 238 239 -
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r10200 r10300 130 130 } catch (NumberFormatException e) { 131 131 if (Main.isDebugEnabled()) { 132 Main.debug( "'"+o+"' cannot be converted to float");132 Main.debug('\'' + (String) o + "' cannot be converted to float"); 133 133 } 134 134 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r10245 r10300 743 743 private final Expression e; 744 744 745 /** 746 * Constructs a new {@code ExpressionFactory} 747 * @param e expression 748 */ 745 749 public ExpressionCondition(Expression e) { 746 750 this.e = e; … … 755 759 @Override 756 760 public String toString() { 757 return "[" + e+ ']';761 return '[' + e.toString() + ']'; 758 762 } 759 763 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/LiteralExpression.java
r8846 r10300 9 9 /** 10 10 * Simple literal value, that does not depend on other expressions. 11 * @since 5705 11 12 */ 12 13 public class LiteralExpression implements Expression { 13 14 private final Object literal; 14 15 16 /** 17 * Constructs a new {@code LiteralExpression}. 18 * @param literal literal 19 */ 15 20 public LiteralExpression(Object literal) { 16 21 CheckParameterUtil.ensureParameterNotNull(literal); … … 28 33 return Arrays.toString((float[]) literal); 29 34 } 30 return "<" + literal+ '>';35 return '<' + literal.toString() + '>'; 31 36 } 32 37 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r10033 r10300 435 435 @Override 436 436 public String toString() { 437 return left + " "+ (ChildOrParentSelectorType.PARENT.equals(type) ? '<' : '>') + link + ' ' + right;437 return left.toString() + ' ' + (ChildOrParentSelectorType.PARENT.equals(type) ? '<' : '>') + link + ' ' + right; 438 438 } 439 439 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LabelCompositionStrategy.java
r9371 r10300 269 269 @Override 270 270 public String toString() { 271 return "{" + getClass().getSimpleName() +'}';271 return '{' + getClass().getSimpleName() + '}'; 272 272 } 273 273 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r10254 r10300 530 530 @Override 531 531 public String toString() { 532 return (types == null ? "" : types ) + " "+ name;532 return (types == null ? "" : types.toString()) + ' ' + name; 533 533 } 534 534 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java
r9422 r10300 168 168 @Override 169 169 public String toString() { 170 return classification + " "+ preset;170 return Integer.toString(classification) + ' ' + preset; 171 171 } 172 172 } -
trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
r10216 r10300 241 241 CheckParameterUtil.ensureParameterNotNull(changesetIds, "changesetIds"); 242 242 if (changesetIds.size() > MAX_CHANGESETS_NUMBER) { 243 Main.warn("Changeset query built with more than " + MAX_CHANGESETS_NUMBER + " changeset ids (" + changesetIds.size() + ")");243 Main.warn("Changeset query built with more than " + MAX_CHANGESETS_NUMBER + " changeset ids (" + changesetIds.size() + ')'); 244 244 } 245 245 this.changesetIds = changesetIds; -
trunk/src/org/openstreetmap/josm/io/MultiFetchOverpassObjectReader.java
r9669 r10300 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.io; 3 4 import java.util.Set; 3 5 4 6 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 5 7 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference; 6 8 import org.openstreetmap.josm.tools.Utils; 7 8 import java.util.Set;9 9 10 10 /** … … 20 20 @Override 21 21 public Object apply(Long x) { 22 return type.getAPIName() + "("+ x + ");>;";22 return type.getAPIName() + '(' + x + ");>;"; 23 23 } 24 24 }; 25 final String query = "("+ Utils.join("", Utils.transform(idPackage, toOverpassExpression)) + ");out meta;";25 final String query = '(' + Utils.join("", Utils.transform(idPackage, toOverpassExpression)) + ");out meta;"; 26 26 return "interpreter?data=" + Utils.encodeUrl(query); 27 27 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/VersionHandler.java
r8846 r10300 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/plugins/PluginHandler.java
r10245 r10300 1229 1229 return true; 1230 1230 } else if (jar != null) { 1231 Main.warn("Invalid jar file ''"+jar+"'' (exists: "+jar.exists()+", canRead: "+jar.canRead()+ ")");1231 Main.warn("Invalid jar file ''"+jar+"'' (exists: "+jar.exists()+", canRead: "+jar.canRead()+')'); 1232 1232 } 1233 1233 return false; -
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r10160 r10300 122 122 final boolean hasReason = reasonForRequest != null && !reasonForRequest.isEmpty(); 123 123 Main.info("{0} {1}{2} -> {3}{4}", 124 requestMethod, url, hasReason ? " (" + reasonForRequest + ")": "",124 requestMethod, url, hasReason ? (" (" + reasonForRequest + ')') : "", 125 125 connection.getResponseCode(), 126 126 connection.getContentLengthLong() > 0 127 ? " (" + Utils.getSizeString(connection.getContentLengthLong(), Locale.getDefault()) + ")"127 ? (" (" + Utils.getSizeString(connection.getContentLengthLong(), Locale.getDefault()) + ')') 128 128 : "" 129 129 ); -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r10212 r10300 928 928 } else { 929 929 final String fnMD5 = Utils.md5Hex(fn); 930 url = b + fnMD5.substring(0, 1) + '/' + fnMD5.substring(0, 2) + "/"+ fn;930 url = b + fnMD5.substring(0, 1) + '/' + fnMD5.substring(0, 2) + '/' + fn; 931 931 } 932 932 result = getIfAvailableHttp(url, type); -
trunk/src/org/openstreetmap/josm/tools/Pair.java
r9983 r10300 42 42 Pair<?, ?> pair = (Pair<?, ?>) other; 43 43 return Objects.equals(a, pair.a) && 44 44 Objects.equals(b, pair.b); 45 45 } 46 46 … … 62 62 @Override 63 63 public String toString() { 64 return "<"+a+','+b+'>';64 return '<'+a.toString()+','+b.toString()+'>'; 65 65 } 66 66 -
trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java
r10285 r10300 70 70 if (className.equals(element.getClassName()) && "getCallingMethod".equals(element.getMethodName())) { 71 71 StackTraceElement toReturn = stackTrace[i + offset]; 72 return toReturn.getClassName().replaceFirst(".*\\.", "") + "#"+ toReturn.getMethodName();72 return toReturn.getClassName().replaceFirst(".*\\.", "") + '#' + toReturn.getMethodName(); 73 73 } 74 74 } -
trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java
r10285 r10300 124 124 125 125 private static String niceThreadName(Thread thread) { 126 String name = "Thread: " + thread.getName() + " (" + thread.getId() + ")";126 String name = "Thread: " + thread.getName() + " (" + thread.getId() + ')'; 127 127 ThreadGroup threadGroup = thread.getThreadGroup(); 128 128 if (threadGroup != null) { … … 221 221 @Override 222 222 public String toString() { 223 StringBuilder builder = new StringBuilder();224 builder.append("CrashReportedException [on thread ");225 builder.append(caughtOnThread);226 builder.append("]");227 return builder.toString();223 return new StringBuilder(48) 224 .append("CrashReportedException [on thread ") 225 .append(caughtOnThread) 226 .append(']') 227 .toString(); 228 228 } 229 229 … … 235 235 this.key = key; 236 236 this.value = value; 237 238 237 } 239 238 … … 273 272 */ 274 273 public void printSection(PrintWriter out) { 275 out.println(sectionName + ":");274 out.println(sectionName + ':'); 276 275 if (entries.isEmpty()) { 277 276 out.println("No data collected.");
Note:
See TracChangeset
for help on using the changeset viewer.