Changeset 8846 in josm
- Timestamp:
- 2015-10-10T01:40:42+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 185 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r8763 r8846 136 136 ImageryInfo ret = new ImageryInfo(info.getName(), url, "wms", info.getEulaAcceptanceRequired(), info.getCookies()); 137 137 if (layersString.length() > 2) { 138 ret.setName(ret.getName() + " "+ layersString.substring(0, layersString.length() - 2));138 ret.setName(ret.getName() + ' ' + layersString.substring(0, layersString.length() - 2)); 139 139 } 140 140 ret.setServerProjections(supportedCrs); -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r8836 r8846 188 188 } 189 189 } 190 putValue("active", true);190 putValue("active", Boolean.TRUE); 191 191 } 192 192 -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r8840 r8846 497 497 if (predecessors.get(n) == null) return true; 498 498 if (predecessors.get(n).size() == 1) { 499 NodePair p1 = successors.get(n). iterator().next();500 NodePair p2 = predecessors.get(n). iterator().next();499 NodePair p1 = successors.get(n).get(0); 500 NodePair p2 = predecessors.get(n).get(0); 501 501 return p1.equals(p2.swap()); 502 502 } -
trunk/src/org/openstreetmap/josm/actions/HistoryInfoWebAction.java
r8475 r8846 30 30 if (infoObject instanceof OsmPrimitive) { 31 31 OsmPrimitive primitive = (OsmPrimitive) infoObject; 32 return Main.getBaseBrowseUrl() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/"+ primitive.getId() + "/history";32 return Main.getBaseBrowseUrl() + '/' + OsmPrimitiveType.from(primitive).getAPIName() + '/' + primitive.getId() + "/history"; 33 33 } else { 34 34 return null; -
trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
r8836 r8846 262 262 try (Formatter us = new Formatter(Locale.US)) { 263 263 tOffset.setText(us.format( 264 "%1." + precision + "f; %1." + precision + "f",264 "%1." + precision + "f; %1." + precision + 'f', 265 265 layer.getDx(), layer.getDy()).toString()); 266 266 } -
trunk/src/org/openstreetmap/josm/actions/InfoWebAction.java
r8510 r8846 36 36 if (infoObject instanceof OsmPrimitive) { 37 37 OsmPrimitive primitive = (OsmPrimitive) infoObject; 38 return Main.getBaseBrowseUrl() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/"+ primitive.getId();38 return Main.getBaseBrowseUrl() + '/' + OsmPrimitiveType.from(primitive).getAPIName() + '/' + primitive.getId(); 39 39 } else if (infoObject instanceof Note) { 40 40 Note note = (Note) infoObject; -
trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java
r8598 r8846 188 188 if (s.wmsUrl.isEmpty()) { 189 189 try { 190 addWMSLayer(s.name + " (" + text + ")", text);190 addWMSLayer(s.name + " (" + text + ')', text); 191 191 break outer; 192 192 } catch (IllegalStateException ex) { … … 200 200 String id = m.group(1); 201 201 String newURL = s.wmsUrl.replaceAll("__s__", id); 202 String title = s.name + " (" + id + ")";202 String title = s.name + " (" + id + ')'; 203 203 addWMSLayer(title, newURL); 204 204 break outer; … … 207 207 if (s.idValidator.matcher(text).matches()) { 208 208 String newURL = s.wmsUrl.replaceAll("__s__", text); 209 String title = s.name + " (" + text + ")";209 String title = s.name + " (" + text + ')'; 210 210 addWMSLayer(title, newURL); 211 211 break outer; -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r8510 r8846 305 305 Main.main.undoRedo.add( 306 306 new SequenceCommand( 307 title1 + " "+ title2,307 title1 + ' ' + title2, 308 308 commands 309 309 )); -
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r8736 r8846 158 158 // else it's a .class, add the classpath and mainClass 159 159 cmd.add("-cp"); 160 cmd.add( "\"" + System.getProperty("java.class.path") + "\"");160 cmd.add('"' + System.getProperty("java.class.path") + '"'); 161 161 cmd.add(mainCommand[0]); 162 162 } -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r8802 r8846 172 172 String fn = file.getPath(); 173 173 if (ff instanceof ExtensionFileFilter) { 174 fn += "."+ ((ExtensionFileFilter) ff).getDefaultExtension();174 fn += '.' + ((ExtensionFileFilter) ff).getDefaultExtension(); 175 175 } else if (extension != null) { 176 fn += "."+ extension;176 fn += '.' + extension; 177 177 } 178 178 file = new File(fn); -
trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
r8540 r8846 115 115 if (canceled) return; 116 116 if (!layers.isEmpty()) { 117 Layer firstLayer = layers. iterator().next();117 Layer firstLayer = layers.get(0); 118 118 boolean noMap = Main.map == null; 119 119 if (noMap) { -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r8513 r8846 60 60 private static void shortenParam(ListIterator<String> it, String[] param, String source, String target) { 61 61 if (source != null && target.length() < source.length() && param[1].startsWith(source)) { 62 it.set(param[0] + "="+ param[1].replace(source, target));62 it.set(param[0] + '=' + param[1].replace(source, target)); 63 63 } 64 64 } -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r8540 r8846 455 455 Way w = relationMembers.get(i_r - k).getWay(); 456 456 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 457 backwards = false;457 backwards = Boolean.FALSE; 458 458 } else if ((w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) { 459 backwards = true;459 backwards = Boolean.TRUE; 460 460 } 461 461 break; … … 464 464 Way w = relationMembers.get(i_r + k).getWay(); 465 465 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 466 backwards = true;466 backwards = Boolean.TRUE; 467 467 } else if ((w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) { 468 backwards = false;468 backwards = Boolean.FALSE; 469 469 } 470 470 break; -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r8513 r8846 135 135 errorTime = Notification.TIME_VERY_LONG; 136 136 errMsg = 137 tr("The current selection cannot be used for unglueing.")+ "\n"+138 "\n"+139 tr("Select either:")+ "\n"+140 tr("* One tagged node, or")+ "\n"+141 tr("* One node that is used by more than one way, or")+ "\n"+142 tr("* One node that is used by more than one way and one of those ways, or")+ "\n"+143 tr("* One way that has one or more nodes that are used by more than one way, or")+ "\n"+144 tr("* One way and one or more of its nodes that are used by more than one way.")+ "\n"+145 "\n"+137 tr("The current selection cannot be used for unglueing.")+'\n'+ 138 '\n'+ 139 tr("Select either:")+'\n'+ 140 tr("* One tagged node, or")+'\n'+ 141 tr("* One node that is used by more than one way, or")+'\n'+ 142 tr("* One node that is used by more than one way and one of those ways, or")+'\n'+ 143 tr("* One way that has one or more nodes that are used by more than one way, or")+'\n'+ 144 tr("* One way and one or more of its nodes that are used by more than one way.")+'\n'+ 145 '\n'+ 146 146 tr("Note: If a way is selected, this way will get fresh copies of the unglued\n"+ 147 147 "nodes and the new nodes will be selected. Otherwise, all ways will get their\n"+ -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r8840 r8846 363 363 // TODO: proper i18n after stabilization 364 364 Collection<String> items = new ArrayList<>(); 365 items.add(tr("OSM Server URL:") + " "+ url.getHost());365 items.add(tr("OSM Server URL:") + ' ' + url.getHost()); 366 366 items.add(tr("Command")+": "+url.getPath()); 367 367 if (url.getQuery() != null) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r8840 r8846 167 167 @Override 168 168 public String toString() { 169 return "ReferenceSegment[en=" + en + ", p1=" + p1 + ", p2=" + p2 + ", perp=" + perpendicular + "]";169 return "ReferenceSegment[en=" + en + ", p1=" + p1 + ", p2=" + p2 + ", perp=" + perpendicular + ']'; 170 170 } 171 171 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r8840 r8846 960 960 else if (mode == Mode.MOVE && (System.currentTimeMillis() - mouseDownTime >= initialMoveDelay)) { 961 961 final boolean canMerge = getCurrentDataSet() != null && !getCurrentDataSet().getSelectedNodes().isEmpty(); 962 final String mergeHelp = canMerge ? " "+ tr("Ctrl to merge with nearest node.") : "";962 final String mergeHelp = canMerge ? ' ' + tr("Ctrl to merge with nearest node.") : ""; 963 963 return tr("Release the mouse button to stop moving.") + mergeHelp; 964 964 } else if (mode == Mode.ROTATE) -
trunk/src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java
r8674 r8846 34 34 @Override 35 35 public String toString() { 36 return "Range [start=" + start + ", end=" + end + "]";36 return "Range [start=" + start + ", end=" + end + ']'; 37 37 } 38 38 } -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r8840 r8846 207 207 try { 208 208 JTextComponent tf = (JTextComponent) hcb.getEditor().getEditorComponent(); 209 tf.getDocument().insertString(tf.getCaretPosition(), " "+ insertText, null);209 tf.getDocument().insertString(tf.getCaretPosition(), ' ' + insertText, null); 210 210 } catch (BadLocationException ex) { 211 211 throw new RuntimeException(ex.getMessage(), ex); … … 628 628 String all = allElements ? ", " + 629 629 /*all elements*/ trc("search", "A") : ""; 630 return "\"" + text + "\" (" + cs + rx + css + all + ", " + mode + ")";630 return '"' + text + "\" (" + cs + rx + css + all + ", " + mode + ')'; 631 631 } 632 632 -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r8840 r8846 159 159 case "timestamp": 160 160 // add leading/trailing space in order to get expected split (e.g. "a--" => {"a", ""}) 161 String rangeS = " " + tokenizer.readTextOrNumber() + " ";161 String rangeS = ' ' + tokenizer.readTextOrNumber() + ' '; 162 162 String[] rangeA = rangeS.split("/"); 163 163 if (rangeA.length == 1) { … … 371 371 @Override 372 372 public String toString() { 373 return key + "?";373 return key + '?'; 374 374 } 375 375 } … … 607 607 @Override 608 608 public String toString() { 609 return key + "="+ value;609 return key + '=' + value; 610 610 } 611 611 } … … 623 623 Double v = null; 624 624 try { 625 v = Double. parseDouble(referenceValue);625 v = Double.valueOf(referenceValue); 626 626 } catch (NumberFormatException ignore) { 627 627 } … … 1019 1019 @Override 1020 1020 public String toString() { 1021 return getString() + "=" + min + "-"+ max;1021 return getString() + '=' + min + '-' + max; 1022 1022 } 1023 1023 } … … 1244 1244 @Override 1245 1245 public String toString() { 1246 return "parent(" + match + ")";1246 return "parent(" + match + ')'; 1247 1247 } 1248 1248 } … … 1268 1268 @Override 1269 1269 public String toString() { 1270 return "child(" + match + ")";1270 return "child(" + match + ')'; 1271 1271 } 1272 1272 } -
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r8509 r8846 141 141 String text; 142 142 if (objects.size() == 1 && tags.size() == 1) { 143 OsmPrimitive primitive = objects. iterator().next();143 OsmPrimitive primitive = objects.get(0); 144 144 String msg = ""; 145 145 Map.Entry<String, String> entry = tags.entrySet().iterator().next(); -
trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java
r8777 r8846 85 85 if (objects.size() == 1) { 86 86 NameVisitor v = new NameVisitor(); 87 objects. iterator().next().accept(v);88 text += " "+tr(v.className)+" "+v.name;87 objects.get(0).accept(v); 88 text += ' '+tr(v.className)+' '+v.name; 89 89 } else { 90 text += " "+objects.size()+" "+trn("object", "objects", objects.size());90 text += ' '+objects.size()+' '+trn("object", "objects", objects.size()); 91 91 } 92 92 return text; -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java
r8836 r8846 69 69 this.a = a; 70 70 this.b = b; 71 this.pattern = getPatternFor(a + "|"+ b);71 this.pattern = getPatternFor(a + '|' + b); 72 72 } 73 73 -
trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java
r8510 r8846 84 84 85 85 final JLabel primitiveLabel = new JLabel( 86 primitive.getDisplayName(DefaultNameFormatter.getInstance()) + ":",86 primitive.getDisplayName(DefaultNameFormatter.getInstance()) + ':', 87 87 ImageProvider.get(primitive.getDisplayType()), 88 88 JLabel.LEFT -
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r8512 r8846 156 156 while (true) { 157 157 String filename = String.format("%1$s_%2$tY%2$tm%2$td_%2$tH%2$tM%2$tS%2$tL%3$s", 158 layer.layerFileName, now, index == 0 ? "" : "_"+ index);158 layer.layerFileName, now, index == 0 ? "" : '_' + index); 159 159 File result = new File(autosaveDir, filename+".osm"); 160 160 try { -
trunk/src/org/openstreetmap/josm/data/Bounds.java
r8510 r8846 262 262 } 263 263 264 @Override public String toString() { 265 return "Bounds["+minLat+","+minLon+","+maxLat+","+maxLon+"]"; 264 @Override 265 public String toString() { 266 return "Bounds["+minLat+','+minLon+','+maxLat+','+maxLon+']'; 266 267 } 267 268 268 269 public String toShortString(DecimalFormat format) { 269 return 270 format.format(minLat) + " " 270 return format.format(minLat) + ' ' 271 271 + format.format(minLon) + " / " 272 + format.format(maxLat) + " "272 + format.format(maxLat) + ' ' 273 273 + format.format(maxLon); 274 274 } -
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r8840 r8846 466 466 467 467 engine.eval("homeDir='"+normalizeDirName(Main.pref.getPreferencesDirectory().getAbsolutePath()) +"';"); 468 engine.eval("josmVersion="+Version.getInstance().getVersion()+ ";");468 engine.eval("josmVersion="+Version.getInstance().getVersion()+';'); 469 469 String className = CustomConfigurator.class.getName(); 470 470 engine.eval("API.messageBox="+className+".messageBox"); … … 740 740 741 741 private String normalizeDirName(String dir) { 742 String s = dir.replace( "\\", "/");742 String s = dir.replace('\\', '/'); 743 743 if (s.endsWith("/")) s = s.substring(0, s.length()-1); 744 744 return s; -
trunk/src/org/openstreetmap/josm/data/DataSource.java
r7575 r8846 71 71 @Override 72 72 public String toString() { 73 return "DataSource [bounds=" + bounds + ", origin=" + origin + "]";73 return "DataSource [bounds=" + bounds + ", origin=" + origin + ']'; 74 74 } 75 75 -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r8840 r8846 96 96 */ 97 97 public class Preferences { 98 99 private static final String[] OBSOLETE_PREF_KEYS = { 100 "remote.control.host", // replaced by individual values for IPv4 and IPv6. To remove end of 2015 101 "osm.notes.enableDownload", // was used prior to r8071 when notes was an hidden feature. To remove end of 2015 102 "mappaint.style.migration.switchedToMapCSS", // was used prior to 8315 for MapCSS switch. To remove end of 2015 103 "mappaint.style.migration.changedXmlName" // was used prior to 8315 for MapCSS switch. To remove end of 2015 104 }; 105 98 106 /** 99 107 * Internal storage for the preference directory. … … 789 797 public synchronized boolean getBoolean(final String key, final String specName, final boolean def) { 790 798 boolean generic = getBoolean(key, def); 791 String skey = key+ "."+specName;799 String skey = key+'.'+specName; 792 800 Setting<?> prop = settingsMap.get(skey); 793 801 if (prop instanceof StringSetting) … … 1077 1085 1078 1086 public synchronized int getInteger(String key, String specName, int def) { 1079 String v = get(key+ "."+specName);1087 String v = get(key+'.'+specName); 1080 1088 if (v.isEmpty()) 1081 1089 v = get(key, Integer.toString(def)); … … 1394 1402 if (fieldValue != null) { 1395 1403 if (f.getAnnotation(writeExplicitly.class) != null || !Objects.equals(fieldValue, defaultFieldValue)) { 1396 String key = f.getName().replace( "_", "-");1404 String key = f.getName().replace('_', '-'); 1397 1405 if (fieldValue instanceof Map) { 1398 1406 hash.put(key, mapToJson((Map) fieldValue)); … … 1420 1428 Field f; 1421 1429 try { 1422 f = klass.getDeclaredField(key_value.getKey().replace( "-", "_"));1430 f = klass.getDeclaredField(key_value.getKey().replace('-', '_')); 1423 1431 } catch (NoSuchFieldException ex) { 1424 1432 continue; … … 1837 1845 } 1838 1846 1839 String[] obsolete = { 1840 "remote.control.host", // replaced by individual values for IPv4 and IPv6. To remove end of 2015 1841 "osm.notes.enableDownload", // was used prior to r8071 when notes was an hidden feature. To remove end of 2015 1842 "mappaint.style.migration.switchedToMapCSS", // was used prior to 8315 for MapCSS switch. To remove end of 2015 1843 "mappaint.style.migration.changedXmlName" // was used prior to 8315 for MapCSS switch. To remove end of 2015 1844 }; 1845 for (String key : obsolete) { 1847 for (String key : OBSOLETE_PREF_KEYS) { 1846 1848 if (settingsMap.containsKey(key)) { 1847 1849 settingsMap.remove(key); -
trunk/src/org/openstreetmap/josm/data/ProjectionBounds.java
r8384 r8846 67 67 @Override 68 68 public String toString() { 69 return "ProjectionBounds["+minEast+","+minNorth+","+maxEast+","+maxNorth+ "]";69 return "ProjectionBounds["+minEast+","+minNorth+","+maxEast+","+maxNorth+']'; 70 70 } 71 71 -
trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java
r8558 r8846 238 238 return formatText(area / areaCustomValue, areaCustomName, format); 239 239 else if (!lowerOnly && a >= (bValue*bValue) / (aValue*aValue)) 240 return formatText(area / (bValue * bValue), bName + "\u00b2", format);240 return formatText(area / (bValue * bValue), bName + '\u00b2', format); 241 241 else if (a < threshold) 242 return "< " + formatText(threshold, aName + "\u00b2", format);242 return "< " + formatText(threshold, aName + '\u00b2', format); 243 243 else 244 return formatText(a, aName + "\u00b2", format);244 return formatText(a, aName + '\u00b2', format); 245 245 } 246 246 247 247 private static String formatText(double v, String unit, NumberFormat format) { 248 248 if (format != null) { 249 return format.format(v) + " "+ unit;249 return format.format(v) + ' ' + unit; 250 250 } 251 251 return String.format(Locale.US, "%." + (v < 9.999999 ? 2 : 1) + "f %s", v, unit); -
trunk/src/org/openstreetmap/josm/data/Version.java
r8510 r8846 226 226 String s = (v == JOSM_UNKNOWN_VERSION) ? "UNKNOWN" : Integer.toString(v); 227 227 if (buildName != null) { 228 s += " "+ buildName;228 s += ' ' + buildName; 229 229 } 230 230 if (isLocalBuild() && v != JOSM_UNKNOWN_VERSION) { 231 231 s += " SVN"; 232 232 } 233 String result = "JOSM/1.5 ("+ s+ " "+LanguageInfo.getJOSMLocaleCode()+")";233 String result = "JOSM/1.5 ("+ s+' '+LanguageInfo.getJOSMLocaleCode()+")"; 234 234 if (includeOsDetails && Main.platform != null) { 235 result += " "+ Main.platform.getOSDescription();235 result += ' ' + Main.platform.getOSDescription(); 236 236 } 237 237 return result; -
trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java
r8510 r8846 127 127 @Override 128 128 public String toString() { 129 return "Conflict [my=" + my + ", their=" + their + "]";129 return "Conflict [my=" + my + ", their=" + their + ']'; 130 130 } 131 131 } -
trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java
r8357 r8846 63 63 @Override 64 64 public String toString() { 65 return "CachedLatLon[lat="+lat()+",lon="+lon()+ "]";65 return "CachedLatLon[lat="+lat()+",lon="+lon()+']'; 66 66 } 67 67 } -
trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java
r8557 r8846 162 162 } 163 163 164 @Override public String toString() { 165 return "EastNorth[e="+x+", n="+y+"]"; 164 @Override 165 public String toString() { 166 return "EastNorth[e="+x+", n="+y+']'; 166 167 } 167 168 -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r8540 r8846 151 151 } 152 152 153 return sDegrees + "\u00B0" + sMinutes + "\'" + sSeconds + "\"";153 return sDegrees + '\u00B0' + sMinutes + '\'' + sSeconds + '\"'; 154 154 } 155 155 … … 173 173 } 174 174 175 return sDegrees + "\u00B0" + sMinutes + "\'";175 return sDegrees + '\u00B0' + sMinutes + '\''; 176 176 } 177 177 … … 325 325 NumberFormat nf = NumberFormat.getInstance(); 326 326 nf.setMaximumFractionDigits(5); 327 return "lat=" + nf.format(lat()) + "\u00B0, lon=" + nf.format(lon()) + "\u00B0";327 return "lat=" + nf.format(lat()) + "\u00B0, lon=" + nf.format(lon()) + '\u00B0'; 328 328 } 329 329 … … 370 370 } 371 371 372 @Override public String toString() { 373 return "LatLon[lat="+lat()+",lon="+lon()+"]"; 372 @Override 373 public String toString() { 374 return "LatLon[lat="+lat()+",lon="+lon()+']'; 374 375 } 375 376 -
trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
r8510 r8846 95 95 @Override 96 96 public String toString() { 97 return "WayPoint (" + (attr.containsKey(GPX_NAME) ? get(GPX_NAME) + ", " : "") + getCoor() + ", " + attr + ")";97 return "WayPoint (" + (attr.containsKey(GPX_NAME) ? get(GPX_NAME) + ", " : "") + getCoor() + ", " + attr + ')'; 98 98 } 99 99 -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r8840 r8846 300 300 s += " id=" + id; 301 301 } 302 s += "]";302 s += ']'; 303 303 return s; 304 304 } … … 861 861 public String getExtendedUrl() { 862 862 return imageryType.getTypeString() + (defaultMaxZoom != 0 863 ? "["+(defaultMinZoom != 0 ? defaultMinZoom+ "," : "")+defaultMaxZoom+"]" : "") + ":"+ url;863 ? "["+(defaultMinZoom != 0 ? defaultMinZoom+',' : "")+defaultMaxZoom+"]" : "") + ':' + url; 864 864 } 865 865 … … 875 875 String res = name; 876 876 if (pixelPerDegree != 0) { 877 res += " ("+pixelPerDegree+ ")";877 res += " ("+pixelPerDegree+')'; 878 878 } 879 879 return res; -
trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java
r8510 r8846 49 49 this.layerName = array.get(1); 50 50 this.name = array.get(2); 51 this.dx = Double. valueOf(array.get(3));52 this.dy = Double. valueOf(array.get(4));51 this.dx = Double.parseDouble(array.get(3)); 52 this.dy = Double.parseDouble(array.get(4)); 53 53 if (array.size() >= 7) { 54 this.centerX = Double. valueOf(array.get(5));55 this.centerY = Double. valueOf(array.get(6));54 this.centerX = Double.parseDouble(array.get(5)); 55 this.centerY = Double.parseDouble(array.get(6)); 56 56 } 57 57 if (projectionCode == null) { -
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java
r8737 r8846 105 105 @Override 106 106 public void clearCache(TileSource source) { 107 this.cache.remove(source.getName() + ":");107 this.cache.remove(source.getName() + ':'); 108 108 } 109 109 -
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
r8815 r8846 91 91 tsName = ""; 92 92 } 93 return tsName.replace( ":", "_") + ":"+ tileSource.getTileId(tile.getZoom(), tile.getXtile(), tile.getYtile());93 return tsName.replace(':', '_') + ':' + tileSource.getTileId(tile.getZoom(), tile.getXtile(), tile.getYtile()); 94 94 } 95 95 return null; -
trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
r8772 r8846 211 211 break; 212 212 default: 213 replacement = "{" + matcher.group(1) + "}";213 replacement = '{' + matcher.group(1) + '}'; 214 214 } 215 215 matcher.appendReplacement(url, replacement); -
trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
r7828 r8846 37 37 errorCount++; 38 38 if (errorCount <= MAX_ERRORS) { 39 writer.println( "["+ type + "] " + String.format(message, args));39 writer.println('[' + type + "] " + String.format(message, args)); 40 40 } 41 41 } … … 187 187 if (Main.isDebugEnabled()) { 188 188 StackTraceElement item = Thread.currentThread().getStackTrace()[2]; 189 String operation = getClass().getSimpleName() + "."+ item.getMethodName();189 String operation = getClass().getSimpleName() + '.' + item.getMethodName(); 190 190 long elapsedTime = System.currentTimeMillis() - startTime; 191 191 Main.debug(tr("Test ''{0}'' completed in {1}", -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r8540 r8846 275 275 public String toString() { 276 276 String coorDesc = isLatLonKnown() ? "lat="+lat+",lon="+lon : ""; 277 return "{Node id=" + getUniqueId() + " version=" + getVersion() + " " + getFlagsAsString() + " " + coorDesc+"}";277 return "{Node id=" + getUniqueId() + " version=" + getVersion() + ' ' + getFlagsAsString() + ' ' + coorDesc+'}'; 278 278 } 279 279 -
trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java
r8510 r8846 73 73 : null; 74 74 if (p == null) { 75 throw new IllegalArgumentException("Expecting n/node/w/way/r/relation/area, but got '" + x[0] + "'");75 throw new IllegalArgumentException("Expecting n/node/w/way/r/relation/area, but got '" + x[0] + '\''); 76 76 } 77 77 for (final Map.Entry<String, String> i : TextTagParser.readTagsFromText(x[1]).entrySet()) { -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r8836 r8846 80 80 @Override 81 81 public String toString() { 82 return super.toString() + "["+ level + "]: " + bbox();82 return super.toString() + '[' + level + "]: " + bbox(); 83 83 } 84 84 … … 361 361 362 362 if (!canRemove()) { 363 abort("attempt to remove non-empty child: " + this.content + " "+ Arrays.toString(this.getChildren()));363 abort("attempt to remove non-empty child: " + this.content + ' ' + Arrays.toString(this.getChildren())); 364 364 } 365 365 -
trunk/src/org/openstreetmap/josm/data/osm/RelationMemberData.java
r8510 r8846 36 36 @Override 37 37 public String toString() { 38 return (memberType != null ? memberType.getAPIName() : "undefined") + " "+ memberId;38 return (memberType != null ? memberType.getAPIName() : "undefined") + ' ' + memberId; 39 39 } 40 40 -
trunk/src/org/openstreetmap/josm/data/osm/Tag.java
r8419 r8846 112 112 return new Tag(x[0], x[1]); 113 113 } else { 114 throw new IllegalArgumentException( "'"+ s + "' does not contain '='");114 throw new IllegalArgumentException('\'' + s + "' does not contain '='"); 115 115 } 116 116 } … … 118 118 @Override 119 119 public String toString() { 120 return key + "="+ value;120 return key + '=' + value; 121 121 } 122 122 -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r8512 r8846 331 331 public String toString() { 332 332 String nodesDesc = isIncomplete() ? "(incomplete)" : "nodes=" + Arrays.toString(nodes); 333 return "{Way id=" + getUniqueId() + " version=" + getVersion()+ " " + getFlagsAsString() + " " + nodesDesc + "}";333 return "{Way id=" + getUniqueId() + " version=" + getVersion()+ ' ' + getFlagsAsString() + ' ' + nodesDesc + '}'; 334 334 } 335 335 -
trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java
r8510 r8846 94 94 @Override 95 95 public String toString() { 96 return "WaySegment [way=" + way.getUniqueId() + ", lowerIndex=" + lowerIndex + "]";96 return "WaySegment [way=" + way.getUniqueId() + ", lowerIndex=" + lowerIndex + ']'; 97 97 } 98 98 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r8540 r8846 238 238 if (get(key) != null) 239 239 return get(key); 240 key = "name:" + Locale.getDefault().getLanguage() + "_"+ Locale.getDefault().getCountry();240 key = "name:" + Locale.getDefault().getLanguage() + '_' + Locale.getDefault().getCountry(); 241 241 if (get(key) != null) 242 242 return get(key); … … 278 278 + (user != null ? "user=" + user + ", " : "") + "changesetId=" 279 279 + changesetId 280 + "]";280 + ']'; 281 281 } 282 282 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r8840 r8846 181 181 @Override 182 182 public String toString() { 183 return "BoundingXYVisitor["+bounds+ "]";183 return "BoundingXYVisitor["+bounds+']'; 184 184 } 185 185 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r8840 r8846 1729 1729 System.err.println("; phase 2 (draw): " + Utils.getDurationString(timeFinished - timePhase1) + 1730 1730 "; total: " + Utils.getDurationString(timeFinished - timeStart) + 1731 " (scale: " + circum + " zoom level: " + Selector.GeneralSelector.scale2level(circum) + ")");1731 " (scale: " + circum + " zoom level: " + Selector.GeneralSelector.scale2level(circum) + ')'); 1732 1732 } 1733 1733 -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r8836 r8846 199 199 throw new ProjectionConfigurationException(tr("UTM projection (''+proj=utm'') requires ''+zone=...'' parameter.")); 200 200 try { 201 zone = Integer. parseInt(zoneStr);201 zone = Integer.valueOf(zoneStr); 202 202 } catch (NumberFormatException e) { 203 203 zone = null; -
trunk/src/org/openstreetmap/josm/data/projection/Ellipsoid.java
r8795 r8846 181 181 @Override 182 182 public String toString() { 183 return "Ellipsoid{a="+a+", b="+b+ "}";183 return "Ellipsoid{a="+a+", b="+b+'}'; 184 184 } 185 185 -
trunk/src/org/openstreetmap/josm/data/projection/datum/CentricDatum.java
r5072 r8846 27 27 @Override 28 28 public String toString() { 29 return "CentricDatum{ellipsoid="+ellps+ "}";29 return "CentricDatum{ellipsoid="+ellps+'}'; 30 30 } 31 31 } -
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r8840 r8846 232 232 type = "n"; 233 233 } 234 strings.add(type + "_"+ o.getId());234 strings.add(type + '_' + o.getId()); 235 235 } 236 236 for (String o : strings) { … … 243 243 String ignorestring = getIgnoreGroup(); 244 244 if (descriptionEn != null) { 245 ignorestring += "_"+ descriptionEn;245 ignorestring += '_' + descriptionEn; 246 246 } 247 247 return ignorestring; … … 381 381 @Override 382 382 public String toString() { 383 return "TestError [tester=" + tester + ", code=" + code + ", message=" + message + "]";383 return "TestError [tester=" + tester + ", code=" + code + ", message=" + message + ']'; 384 384 } 385 385 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r8777 r8846 99 99 protected static final int DUPLICATE_NODE_WATERWAY = 17; 100 100 101 private static final String[] TYPES = { 102 "none", "highway", "railway", "waterway", "boundary", "power", "natural", "landuse", "building"}; 103 101 104 /** The map of potential duplicates. 102 105 * … … 168 171 169 172 Map<String, Boolean> typeMap = new HashMap<>(); 170 String[] types = {"none", "highway", "railway", "waterway", "boundary", "power", "natural", "landuse", "building"};171 173 172 174 // check whether we have multiple nodes at the same position with the same tag set … … 175 177 if (mm.get(tagSet).size() > 1) { 176 178 177 for (String type: types) {178 typeMap.put(type, false);179 for (String type: TYPES) { 180 typeMap.put(type, Boolean.FALSE); 179 181 } 180 182 … … 190 192 for (String type: typeMap.keySet()) { 191 193 if (keys.containsKey(type)) { 192 typeMap.put(type, true);194 typeMap.put(type, Boolean.TRUE); 193 195 typed = true; 194 196 } 195 197 } 196 198 if (!typed) { 197 typeMap.put("none", true);199 typeMap.put("none", Boolean.TRUE); 198 200 } 199 201 } 200 202 } 201 202 203 } 203 204 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/InternetTags.java
r8510 r8846 102 102 String ending = ""; 103 103 if (domain.contains("/")) { 104 int idx = domain.indexOf( "/");104 int idx = domain.indexOf('/'); 105 105 ending = domain.substring(idx, domain.length()); 106 106 domain = domain.substring(0, idx); -
trunk/src/org/openstreetmap/josm/data/validation/tests/Lanes.java
r8382 r8846 45 45 protected void checkNumberOfLanesByKey(final OsmPrimitive p, String lanesKey, String message) { 46 46 final Collection<String> keysForPattern = new ArrayList<>(Utils.filter(p.keySet(), 47 Predicates.stringContainsPattern(Pattern.compile( ":" + lanesKey + "$"))));47 Predicates.stringContainsPattern(Pattern.compile(':' + lanesKey + '$')))); 48 48 keysForPattern.removeAll(Arrays.asList(BLACKLIST)); 49 49 if (keysForPattern.isEmpty()) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r8840 r8846 126 126 @Override 127 127 public String toString() { 128 return "GroupedMapCSSRule [selectors=" + selectors + ", declaration=" + declaration + "]";128 return "GroupedMapCSSRule [selectors=" + selectors + ", declaration=" + declaration + ']'; 129 129 } 130 130 } … … 301 301 check.alternatives.add(val); 302 302 } else if ("assertMatch".equals(ai.key) && val != null) { 303 check.assertions.put(val, true);303 check.assertions.put(val, Boolean.TRUE); 304 304 } else if ("assertNoMatch".equals(ai.key) && val != null) { 305 check.assertions.put(val, false);305 check.assertions.put(val, Boolean.FALSE); 306 306 } else { 307 throw new IllegalDataException("Cannot add instruction " + ai.key + ": " + ai.val + "!");307 throw new IllegalDataException("Cannot add instruction " + ai.key + ": " + ai.val + '!'); 308 308 } 309 309 } … … 619 619 @Override 620 620 public String toString() { 621 return "MapCSSTagCheckerAndRule [rule=" + rule + "]";621 return "MapCSSTagCheckerAndRule [rule=" + rule + ']'; 622 622 } 623 623 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
r8510 r8846 240 240 @Override 241 241 public String toString() { 242 return "replaceAll(" + regExpr + ", " + replacement + ")";242 return "replaceAll(" + regExpr + ", " + replacement + ')'; 243 243 } 244 244 } … … 304 304 @Override 305 305 public String toString() { 306 return "synonyms(" + replacement + ", " + Arrays.toString(words) + ")";306 return "synonyms(" + replacement + ", " + Arrays.toString(words) + ')'; 307 307 } 308 308 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r8840 r8846 241 241 } 242 242 } catch (IOException e) { 243 errorSources += source + "\n";243 errorSources += source + '\n'; 244 244 } 245 245 } -
trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java
r8378 r8846 63 63 displayName = name; 64 64 } else { 65 displayName = size + " "+ trn(multipleClassname, multiplePluralClassname, size);65 displayName = size + ' ' + trn(multipleClassname, multiplePluralClassname, size); 66 66 if (multipleName.length() > 0) { 67 67 if (multipleName.length() <= MULTIPLE_NAME_MAX_LENGTH) { -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r8840 r8846 358 358 relationName = Long.toString(relation.getId()); 359 359 } else { 360 relationName = "\"" + relationName + "\"";360 relationName = '\"' + relationName + '\"'; 361 361 } 362 362 result.append(" (").append(relationName).append(", "); … … 443 443 String admin_level = relation.get("admin_level"); 444 444 if (admin_level != null) { 445 name += "["+admin_level+"]";445 name += '['+admin_level+']'; 446 446 } 447 447 … … 623 623 /* note: length == 0 should no longer happen, but leave the bracket code 624 624 nevertheless, who knows what future brings */ 625 sb.append((sb.length() > 0) ? " ("+nodes+ ")": nodes);625 sb.append((sb.length() > 0) ? " ("+nodes+')' : nodes); 626 626 decorateNameWithId(sb, way); 627 627 return sb.toString(); … … 664 664 sb.append(Long.toString(relation.getId())).append(", "); 665 665 } else { 666 sb.append( "\"").append(nameTag).append("\", ");666 sb.append('\"').append(nameTag).append("\", "); 667 667 } 668 668 -
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r8840 r8846 177 177 URL u = getClass().getResource(im); 178 178 if (u != null) { 179 m.appendReplacement(sb, Matcher.quoteReplacement("src=\"" + u + "\""));179 m.appendReplacement(sb, Matcher.quoteReplacement("src=\"" + u + '\"')); 180 180 } 181 181 } -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r8836 r8846 126 126 "\tjava -jar josm.jar <options>...\n\n"+ 127 127 tr("options")+":\n"+ 128 "\t--help|-h "+tr("Show this help")+ "\n"+129 "\t--geometry=widthxheight(+|-)x(+|-)y "+tr("Standard unix geometry argument")+ "\n"+130 "\t[--download=]minlat,minlon,maxlat,maxlon "+tr("Download the bounding box")+ "\n"+131 "\t[--download=]<URL> "+tr("Download the location at the URL (with lat=x&lon=y&zoom=z)")+ "\n"+132 "\t[--download=]<filename> "+tr("Open a file (any file type that can be opened with File/Open)")+ "\n"+133 "\t--downloadgps=minlat,minlon,maxlat,maxlon "+tr("Download the bounding box as raw GPS")+ "\n"+134 "\t--downloadgps=<URL> "+tr("Download the location at the URL (with lat=x&lon=y&zoom=z) as raw GPS")+ "\n"+135 "\t--selection=<searchstring> "+tr("Select with the given search")+ "\n"+136 "\t--[no-]maximize "+tr("Launch in maximized mode")+ "\n"+128 "\t--help|-h "+tr("Show this help")+'\n'+ 129 "\t--geometry=widthxheight(+|-)x(+|-)y "+tr("Standard unix geometry argument")+'\n'+ 130 "\t[--download=]minlat,minlon,maxlat,maxlon "+tr("Download the bounding box")+'\n'+ 131 "\t[--download=]<URL> "+tr("Download the location at the URL (with lat=x&lon=y&zoom=z)")+'\n'+ 132 "\t[--download=]<filename> "+tr("Open a file (any file type that can be opened with File/Open)")+'\n'+ 133 "\t--downloadgps=minlat,minlon,maxlat,maxlon "+tr("Download the bounding box as raw GPS")+'\n'+ 134 "\t--downloadgps=<URL> "+tr("Download the location at the URL (with lat=x&lon=y&zoom=z) as raw GPS")+'\n'+ 135 "\t--selection=<searchstring> "+tr("Select with the given search")+'\n'+ 136 "\t--[no-]maximize "+tr("Launch in maximized mode")+'\n'+ 137 137 "\t--reset-preferences "+tr("Reset the preferences to default")+"\n\n"+ 138 138 "\t--load-preferences=<url-to-xml> "+tr("Changes preferences according to the XML file")+"\n\n"+ … … 155 155 tr("examples")+":\n"+ 156 156 "\tjava -jar josm.jar track1.gpx track2.gpx london.osm\n"+ 157 "\tjava -jar josm.jar "+OsmUrlToBounds.getURL(43.2, 11.1, 13)+ "\n"+157 "\tjava -jar josm.jar "+OsmUrlToBounds.getURL(43.2, 11.1, 13)+'\n'+ 158 158 "\tjava -jar josm.jar london.osm --selection=http://www.ostertag.name/osm/OSM_errors_node-duplicate.xml\n"+ 159 159 "\tjava -jar josm.jar 43.2,11.1,43.4,11.4\n"+ … … 161 161 "\tjava -Djosm.home=/home/user/.josm_dev -jar josm.jar\n"+ 162 162 "\tjava -Xmx1024m -jar josm.jar\n\n"+ 163 tr("Parameters --download, --downloadgps, and --selection are processed in this order.")+ "\n"+164 tr("Make sure you load some data if you use --selection.")+ "\n"163 tr("Parameters --download, --downloadgps, and --selection are processed in this order.")+'\n'+ 164 tr("Make sure you load some data if you use --selection.")+'\n' 165 165 ); 166 166 } … … 212 212 213 213 Option(boolean requiresArgument) { 214 this.name = name().toLowerCase(Locale.ENGLISH).replace( "_", "-");214 this.name = name().toLowerCase(Locale.ENGLISH).replace('_', '-'); 215 215 this.requiresArg = requiresArgument; 216 216 } -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r8840 r8846 1438 1438 */ 1439 1439 public int getViewID() { 1440 String x = center.east() + "_" + center.north() + "_" + scale + "_"+1441 getWidth() + "_" + getHeight() + "_"+ getProjection().toString();1440 String x = center.east() + '_' + center.north() + '_' + scale + '_' + 1441 getWidth() + '_' + getHeight() + '_' + getProjection().toString(); 1442 1442 CRC32 id = new CRC32(); 1443 1443 id.update(x.getBytes(StandardCharsets.UTF_8)); -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
r8840 r8846 49 49 private static final int MAC_MOUSE_BUTTON3_MASK = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK; 50 50 51 private static final String[] N = { 52 ",", ".", "up", "right", "down", "left"}; 53 private static final int[] K = { 54 KeyEvent.VK_COMMA, KeyEvent.VK_PERIOD, KeyEvent.VK_UP, KeyEvent.VK_RIGHT, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT}; 55 51 56 // start and end point of selection rectangle 52 57 private Point iStartSelectionPoint; … … 65 70 iSlippyMapChooser.addMouseMotionListener(this); 66 71 67 String[] n = {",", ".", "up", "right", "down", "left"};68 int[] k = {KeyEvent.VK_COMMA, KeyEvent.VK_PERIOD, KeyEvent.VK_UP, KeyEvent.VK_RIGHT, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT};69 70 72 if (contentPane != null) { 71 for (int i = 0; i < n.length; ++i) {73 for (int i = 0; i < N.length; ++i) { 72 74 contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( 73 KeyStroke.getKeyStroke( k[i], KeyEvent.CTRL_DOWN_MASK), "MapMover.Zoomer." + n[i]);75 KeyStroke.getKeyStroke(K[i], KeyEvent.CTRL_DOWN_MASK), "MapMover.Zoomer." + N[i]); 74 76 } 75 77 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r8836 r8846 216 216 conflicts.getRelationConflicts().size(), 217 217 conflicts.getWayConflicts().size(), 218 conflicts.getNodeConflicts().size())+ ")");218 conflicts.getNodeConflicts().size())+')'); 219 219 } else { 220 220 setTitle(tr("Conflict")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
r8612 r8846 131 131 class DataText { 132 132 private static final String INDENT = " "; 133 private static final String NL = "\n";133 private static final char NL = '\n'; 134 134 135 135 private StringBuilder s = new StringBuilder(); … … 364 364 StyleList sl = elemstyles.get(osm, scale, nc); 365 365 for (ElemStyle s : sl) { 366 txtMappaint.append(" * ").append(s).append( "\n");366 txtMappaint.append(" * ").append(s).append('\n'); 367 367 } 368 368 txtMappaint.append("\n\n"); -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r8678 r8846 200 200 } 201 201 this.latLonCoordinates = ll; 202 tfLatLon.setText(ll.latToString(CoordinateFormat.getDefaultFormat()) + " "+ ll.lonToString(CoordinateFormat.getDefaultFormat()));202 tfLatLon.setText(ll.latToString(CoordinateFormat.getDefaultFormat()) + ' ' + ll.lonToString(CoordinateFormat.getDefaultFormat())); 203 203 EastNorth en = Main.getProjection().latlon2eastNorth(ll); 204 204 tfEastNorth.setText(en.east()+" "+en.north()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r8836 r8846 655 655 String line; 656 656 while ((line = reader.readLine()) != null) { 657 txtSource.append(line + "\n");657 txtSource.append(line + '\n'); 658 658 } 659 659 } finally { -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r8836 r8846 352 352 } 353 353 354 355 354 /** 356 355 * Hides the dialog … … 361 360 windowMenuItem.setState(false); 362 361 setIsShowing(false); 363 toggleAction.putValue("selected", false);362 toggleAction.putValue("selected", Boolean.FALSE); 364 363 } 365 364 -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r8836 r8846 226 226 if (infoObject instanceof User) { 227 227 User user = (User) infoObject; 228 return Main.getBaseUserUrl() + "/"+ Utils.encodeUrl(user.getName()).replaceAll("\\+", "%20");228 return Main.getBaseUserUrl() + '/' + Utils.encodeUrl(user.getName()).replaceAll("\\+", "%20"); 229 229 } else { 230 230 return null; -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r8840 r8846 1168 1168 if (values.size() == 1) { 1169 1169 url = TAGINFO_URL_PROP.get() + "tags/" + key /* do not URL encode key, otherwise addr:street does not work */ 1170 + "="+ Utils.encodeUrl(values.keySet().iterator().next());1170 + '=' + Utils.encodeUrl(values.keySet().iterator().next()); 1171 1171 } else { 1172 1172 url = TAGINFO_URL_PROP.get() + "keys/" + key; /* do not URL encode key, otherwise addr:street does not work */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r8840 r8846 232 232 new String[]{tr("Replace"), tr("Cancel")}); 233 233 ed.setButtonIcons(new String[]{"purge", "cancel"}); 234 ed.setContent(action+ "\n"+ tr("The new key is already used, overwrite values?"));234 ed.setContent(action+'\n'+ tr("The new key is already used, overwrite values?")); 235 235 ed.setCancelButton(2); 236 236 ed.toggleEnable(togglePref); … … 651 651 lines.add(code(sc.getKeyText()) + tr("to apply first suggestion")); 652 652 } 653 lines.add(code(KeyEvent.getKeyModifiersText(KeyEvent.SHIFT_MASK)+ "+"+KeyEvent.getKeyText(KeyEvent.VK_ENTER))653 lines.add(code(KeyEvent.getKeyModifiersText(KeyEvent.SHIFT_MASK)+'+'+KeyEvent.getKeyText(KeyEvent.VK_ENTER)) 654 654 +tr("to add without closing the dialog")); 655 655 sc = Shortcut.findShortcut(KeyEvent.VK_1, commandDownMask | KeyEvent.SHIFT_DOWN_MASK); … … 750 750 + "<table><tr>" 751 751 + "<td>" + count + ".</td>" 752 + "<td style='border:1px solid gray'>" + XmlWriter.encode(t.toString(), true) + "<"+752 + "<td style='border:1px solid gray'>" + XmlWriter.encode(t.toString(), true) + '<' + 753 753 "/td></tr></table></html>"); 754 754 tagLabel.setFont(tagLabel.getFont().deriveFont(Font.PLAIN)); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationDialogManager.java
r8836 r8846 90 90 @Override 91 91 public String toString() { 92 return "[Context: layer=" + layer.getName() + ",relation=" + relation.getId() + "]";92 return "[Context: layer=" + layer.getName() + ",relation=" + relation.getId() + ']'; 93 93 } 94 94 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionType.java
r8840 r8846 70 70 return "[P "+linkPrev+" ;N "+linkNext+" ;D "+direction+" ;L "+isLoop+ 71 71 " ;FP " + isOnewayLoopForwardPart+";BP " + isOnewayLoopBackwardPart+ 72 ";OH " + isOnewayHead+";OT " + isOnewayTail+ "]";72 ";OH " + isOnewayHead+";OT " + isOnewayTail+']'; 73 73 } 74 74 -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
r8836 r8846 601 601 if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) 602 602 return; 603 if (e.getURL() == null || e.getURL().toString().startsWith(url+ "#")) {603 if (e.getURL() == null || e.getURL().toString().startsWith(url+'#')) { 604 604 // Probably hyperlink event on a an A-element with a href consisting of a fragment only, i.e. "#ALocalFragment". 605 605 String fragment = getUrlFragment(e); -
trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
r8639 r8846 127 127 if (ret == null) 128 128 return ret; 129 ret = "/"+ ret + Main.pref.get("help.pathhelp", "/Help").replaceAll("^\\/+", ""); // remove leading /129 ret = '/' + ret + Main.pref.get("help.pathhelp", "/Help").replaceAll("^\\/+", ""); // remove leading / 130 130 return ret.replaceAll("\\/+", "\\/"); // collapse sequences of // 131 131 } … … 146 146 if (prefix == null || topic == null || topic.trim().isEmpty() || "/".equals(topic.trim())) 147 147 return prefix; 148 prefix += "/"+ topic;148 prefix += '/' + topic; 149 149 return prefix.replaceAll("\\/+", "\\/"); // collapse sequences of // 150 150 } -
trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
r8836 r8846 185 185 186 186 protected static String getUserUrl(String username) { 187 return Main.getBaseUserUrl() + "/"+ Utils.encodeUrl(username).replaceAll("\\+", "%20");187 return Main.getBaseUserUrl() + '/' + Utils.encodeUrl(username).replaceAll("\\+", "%20"); 188 188 } 189 189 -
trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
r8836 r8846 203 203 if (infoObject instanceof HistoryOsmPrimitive) { 204 204 HistoryOsmPrimitive hp = (HistoryOsmPrimitive) infoObject; 205 return hp.getUser() == null ? null : Main.getBaseUserUrl() + "/"+ hp.getUser().getName();205 return hp.getUser() == null ? null : Main.getBaseUserUrl() + '/' + hp.getUser().getName(); 206 206 } else { 207 207 return null; -
trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
r8836 r8846 314 314 lblHeading.setText( 315 315 "<html>" + tr("Authenticating at the HTTP proxy ''{0}'' failed. Please enter a valid username and a valid password.", 316 Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_HOST) + ":"+316 Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_HOST) + ':' + 317 317 Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_PORT)) + "</html>"); 318 318 lblWarning.setText("<html>" + -
trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
r8836 r8846 33 33 private static final Color colorError = new Color(255, 197, 197); 34 34 private static final String separator = System.getProperty("file.separator"); 35 private static final String ellipsis = "…"+ separator;35 private static final String ellipsis = '…' + separator; 36 36 37 37 private final JLabel lblLayerName = new JLabel(); -
trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java
r8760 r8846 96 96 tags.put("created_by", agent); 97 97 } else if (!created_by.contains(agent)) { 98 tags.put("created_by", created_by + ";"+ agent);98 tags.put("created_by", created_by + ';' + agent); 99 99 } 100 100 pnlTagEditor.getModel().initFromTags(tags); -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r8840 r8846 319 319 private String getSizeString(int size) { 320 320 StringBuilder ret = new StringBuilder(); 321 return ret.append(size).append( "x").append(size).toString();321 return ret.append(size).append('x').append(size).toString(); 322 322 } 323 323 … … 350 350 {"Tile url", url}, 351 351 {"Tile size", getSizeString(clickedTile.getTileSource().getTileSize()) }, 352 {"Tile display size", new StringBuilder().append(displaySize.width).append( "x").append(displaySize.height).toString()},352 {"Tile display size", new StringBuilder().append(displaySize.width).append('x').append(displaySize.height).toString()}, 353 353 }; 354 354 355 355 for (String[] entry: content) { 356 panel.add(new JLabel(tr(entry[0]) + ":"), GBC.std());356 panel.add(new JLabel(tr(entry[0]) + ':'), GBC.std()); 357 357 panel.add(GBC.glue(5, 0), GBC.std()); 358 358 panel.add(createTextField(entry[1]), GBC.eol().fill(GBC.HORIZONTAL)); … … 360 360 361 361 for (Entry<String, String> e: clickedTile.getMetadata().entrySet()) { 362 panel.add(new JLabel(tr("Metadata ") + tr(e.getKey()) + ":"), GBC.std());362 panel.add(new JLabel(tr("Metadata ") + tr(e.getKey()) + ':'), GBC.std()); 363 363 panel.add(GBC.glue(5, 0), GBC.std()); 364 364 String value = e.getValue(); … … 764 764 boolean zia = currentZoomLevel < this.getMaxZoomLvl(); 765 765 if (Main.isDebugEnabled()) { 766 Main.debug("zoomIncreaseAllowed(): " + zia + " "+ currentZoomLevel + " vs. " + this.getMaxZoomLvl());766 Main.debug("zoomIncreaseAllowed(): " + zia + ' ' + currentZoomLevel + " vs. " + this.getMaxZoomLvl()); 767 767 } 768 768 return zia; … … 1054 1054 for (String s: text.split(" ")) { 1055 1055 if (g.getFontMetrics().stringWidth(line.toString() + s) > tileSource.getTileSize()) { 1056 ret.append(line).append( "\n");1056 ret.append(line).append('\n'); 1057 1057 line.setLength(0); 1058 1058 } 1059 line.append(s).append( " ");1059 line.append(s).append(' '); 1060 1060 } 1061 1061 ret.append(line); … … 1528 1528 private Tile getTileForPixelpos(int px, int py) { 1529 1529 if (Main.isDebugEnabled()) { 1530 Main.debug("getTileForPixelpos("+px+", "+py+ ")");1530 Main.debug("getTileForPixelpos("+px+", "+py+')'); 1531 1531 } 1532 1532 MapView mv = Main.map.mapView; -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r8818 r8846 100 100 if (earliestDate.equals(latestDate)) { 101 101 DateFormat tf = DateUtils.getTimeFormat(DateFormat.SHORT); 102 ts += earliestDate + " ";102 ts += earliestDate + ' '; 103 103 ts += tf.format(bounds[0]) + " - " + tf.format(bounds[1]); 104 104 } else { -
trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
r8840 r8846 152 152 } 153 153 if (dx != 0 || dy != 0) { 154 panel.add(new JLabel(tr("Offset: ") + dx + ";"+ dy), GBC.eol().insets(0, 5, 10, 0));154 panel.add(new JLabel(tr("Offset: ") + dx + ';' + dy), GBC.eol().insets(0, 5, 10, 0)); 155 155 } 156 156 } -
trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
r8509 r8846 180 180 @Override 181 181 public String getToolTipText() { 182 return noteData.getNotes().size() + " "+ tr("Notes");182 return noteData.getNotes().size() + ' ' + tr("Notes"); 183 183 } 184 184 -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r8840 r8846 489 489 String nodeText = trn("{0} node", "{0} nodes", counter.nodes, counter.nodes); 490 490 if (counter.deletedNodes > 0) { 491 nodeText += " ("+trn("{0} deleted", "{0} deleted", counter.deletedNodes, counter.deletedNodes)+ ")";491 nodeText += " ("+trn("{0} deleted", "{0} deleted", counter.deletedNodes, counter.deletedNodes)+')'; 492 492 } 493 493 494 494 String wayText = trn("{0} way", "{0} ways", counter.ways, counter.ways); 495 495 if (counter.deletedWays > 0) { 496 wayText += " ("+trn("{0} deleted", "{0} deleted", counter.deletedWays, counter.deletedWays)+ ")";496 wayText += " ("+trn("{0} deleted", "{0} deleted", counter.deletedWays, counter.deletedWays)+')'; 497 497 } 498 498 499 499 String relationText = trn("{0} relation", "{0} relations", counter.relations, counter.relations); 500 500 if (counter.deletedRelations > 0) { 501 relationText += " ("+trn("{0} deleted", "{0} deleted", counter.deletedRelations, counter.deletedRelations)+ ")";501 relationText += " ("+trn("{0} deleted", "{0} deleted", counter.deletedRelations, counter.deletedRelations)+')'; 502 502 } 503 503 -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r8840 r8846 300 300 JOptionPane.showMessageDialog( 301 301 Main.parent, 302 tr("Could not read \"{0}\"", sel.getName())+ "\n"+x.getMessage(),302 tr("Could not read \"{0}\"", sel.getName())+'\n'+x.getMessage(), 303 303 tr("Error"), 304 304 JOptionPane.ERROR_MESSAGE … … 394 394 gc.gridx = 2; 395 395 gc.weightx = 0.2; 396 panelTf.add(new JLabel(" ["+dateFormat.toLocalizedPattern()+ "]"), gc);396 panelTf.add(new JLabel(" ["+dateFormat.toLocalizedPattern()+']'), gc); 397 397 398 398 gc.gridx = 0; … … 511 511 if (date != null) { 512 512 lbExifTime.setText(DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM).format(date)); 513 tfGpsTime.setText(DateUtils.getDateFormat(DateFormat.SHORT).format(date)+ " ");513 tfGpsTime.setText(DateUtils.getDateFormat(DateFormat.SHORT).format(date)+' '); 514 514 tfGpsTime.setEnabled(true); 515 515 } else { … … 928 928 : (int) Math.floor(tz/2) + ":30"; 929 929 if (sldTimezone.getValue() < 0) { 930 zone = "-"+ zone;930 zone = '-' + zone; 931 931 } 932 932 -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r8840 r8846 376 376 return "<html>" 377 377 + trn("{0} image loaded.", "{0} images loaded.", n, n) 378 + " "+ trn("{0} was found to be GPS tagged.", "{0} were found to be GPS tagged.", tagged, tagged)378 + ' ' + trn("{0} was found to be GPS tagged.", "{0} were found to be GPS tagged.", tagged, tagged) 379 379 + (newdata > 0 ? "<br>" + trn("{0} has updated GPS data.", "{0} have updated GPS data.", newdata, newdata) : "") 380 380 + "</html>"; -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r8840 r8846 106 106 } 107 107 if (names != null) { 108 names += ")";108 names += ')'; 109 109 } else { 110 110 names = ""; -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
r8840 r8846 112 112 String key = "draw.rawgps.layer.wpt.pattern"; 113 113 if (layerName != null) { 114 key += "."+ layerName;114 key += '.' + layerName; 115 115 } 116 116 TemplateEntryProperty result = CACHE.get(key); … … 127 127 String key = "draw.rawgps.layer.audiowpt.pattern"; 128 128 if (layerName != null) { 129 key += "."+ layerName;129 key += '.' + layerName; 130 130 } 131 131 TemplateEntryProperty result = CACHE.get(key); -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r8840 r8846 219 219 } 220 220 221 @Override public String getToolTipText() { 222 return data.size()+" "+trn("marker", "markers", data.size()); 223 } 224 225 @Override public void mergeFrom(Layer from) { 221 @Override 222 public String getToolTipText() { 223 return data.size()+' '+trn("marker", "markers", data.size()); 224 } 225 226 @Override 227 public void mergeFrom(Layer from) { 226 228 MarkerLayer layer = (MarkerLayer) from; 227 229 data.addAll(layer.data); -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/WebMarker.java
r8512 r8846 43 43 new Notification( 44 44 "<b>" + tr("There was an error while trying to display the URL for this marker") + "</b><br>" + 45 tr("(URL was: ") + webUrl + ")"+ "<br>" + error)45 tr("(URL was: ") + webUrl + ')' + "<br>" + error) 46 46 .setIcon(JOptionPane.ERROR_MESSAGE) 47 47 .setDuration(Notification.TIME_LONG) -
trunk/src/org/openstreetmap/josm/gui/mappaint/BoxTextElemStyle.java
r8840 r8846 231 231 @Override 232 232 public String toString() { 233 return "BoxTextElemStyle{" + super.toString() + " "+ text.toStringImpl()233 return "BoxTextElemStyle{" + super.toString() + ' ' + text.toStringImpl() 234 234 + " box=" + box + " hAlign=" + hAlign + " vAlign=" + vAlign + '}'; 235 235 } 236 237 236 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r8510 r8846 208 208 StringBuilder res = new StringBuilder("Cascade{ "); 209 209 for (Entry<String, Object> entry : prop.entrySet()) { 210 res.append(entry.getKey()+ ":");210 res.append(entry.getKey()+':'); 211 211 Object val = entry.getValue(); 212 212 if (val instanceof float[]) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r8582 r8846 132 132 throw new AssertionError("Range violated: " + e.getMessage() 133 133 + " (object: " + osm.getPrimitiveId() + ", current style: "+osm.mappaintStyle 134 + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b + ")", e);134 + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b + ')', e); 135 135 } 136 136 osm.mappaintCacheIdx = cacheIdx; -
trunk/src/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategy.java
r8726 r8846 63 63 @Override 64 64 public String toString() { 65 return "{" + getClass().getSimpleName() + " defaultLabel=" + defaultLabel + "}";65 return '{' + getClass().getSimpleName() + " defaultLabel=" + defaultLabel + '}'; 66 66 } 67 67 … … 119 119 @Override 120 120 public String toString() { 121 return "{" + getClass().getSimpleName() + " defaultLabelTag=" + defaultLabelTag + "}";121 return '{' + getClass().getSimpleName() + " defaultLabelTag=" + defaultLabelTag + '}'; 122 122 } 123 123 … … 277 277 name = comp; 278 278 } else { 279 name += " (" + comp + ")";279 name += " (" + comp + ')'; 280 280 } 281 281 break; … … 293 293 @Override 294 294 public String toString() { 295 return "{" + getClass().getSimpleName() + "}";295 return "{" + getClass().getSimpleName() +'}'; 296 296 } 297 297 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r8510 r8846 139 139 if (widthTag != null) { 140 140 try { 141 realWidth = Float. valueOf(widthTag);141 realWidth = Float.parseFloat(widthTag); 142 142 } catch (NumberFormatException nfe) { 143 143 Main.warn(nfe); -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineTextElemStyle.java
r8510 r8846 56 56 @Override 57 57 public String toString() { 58 return "LineTextElemStyle{" + super.toString() + "text=" + text + "}";58 return "LineTextElemStyle{" + super.toString() + "text=" + text + '}'; 59 59 } 60 60 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java
r8377 r8846 43 43 // be a modifier. Can be overridden in style definition. 44 44 if (!"default".equals(layer) && !"*".equals(layer)) { 45 c.put(MODIFIER, true);45 c.put(MODIFIER, Boolean.TRUE); 46 46 } 47 47 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
r8513 r8846 390 390 s.append(super.toString()); 391 391 if (mapImage != null) { 392 s.append(" icon=[" + mapImage + "]");392 s.append(" icon=[" + mapImage + ']'); 393 393 } 394 394 if (symbol != null) { 395 s.append(" symbol=[" + symbol + "]");395 s.append(" symbol=[" + symbol + ']'); 396 396 } 397 397 if (mapImageAngle != null) { 398 s.append(" mapImageAngle=[" + mapImageAngle + "]");398 s.append(" mapImageAngle=[" + mapImageAngle + ']'); 399 399 } 400 400 s.append('}'); -
trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java
r7864 r8846 21 21 public Range(double lower, double upper) { 22 22 if (lower < 0 || lower >= upper) 23 throw new IllegalArgumentException("Invalid range: "+lower+ "-"+upper);23 throw new IllegalArgumentException("Invalid range: "+lower+'-'+upper); 24 24 this.lower = lower; 25 25 this.upper = upper; -
trunk/src/org/openstreetmap/josm/gui/mappaint/RepeatImageElemStyle.java
r8444 r8846 91 91 return "RepeatImageStyle{" + super.toString() + "pattern=[" + pattern + 92 92 "], offset=" + offset + ", spacing=" + spacing + 93 ", phase=" + (-phase) + ", align=" + align + "}";93 ", phase=" + (-phase) + ", align=" + align + '}'; 94 94 } 95 95 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r8836 r8846 271 271 @Override 272 272 public String toString() { 273 return "[" + k + "'" + op + "'" + v + "]";273 return '[' + k + '\'' + op + '\'' + v + ']'; 274 274 } 275 275 } … … 458 458 @Override 459 459 public String toString() { 460 return "[" + (negateResult ? "!" : "") + label + "]";460 return '[' + (negateResult ? "!" : "") + label + ']'; 461 461 } 462 462 } … … 479 479 @Override 480 480 public String toString() { 481 return (not ? "!" : "") + "."+ id;481 return (not ? "!" : "") + '.' + id; 482 482 } 483 483 } … … 629 629 @Override 630 630 public String toString() { 631 return (not ? "!" : "") + ":"+ method.getName();631 return (not ? "!" : "") + ':' + method.getName(); 632 632 } 633 633 } … … 660 660 @Override 661 661 public String toString() { 662 return "[" + e + "]";662 return "[" + e + ']'; 663 663 } 664 664 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java
r8674 r8846 88 88 public String toString() { 89 89 return key + ": " + (val instanceof float[] ? Arrays.toString((float[]) val) : 90 val instanceof String ? "String<"+val+ ">": val) + ';';90 val instanceof String ? "String<"+val+'>' : val) + ';'; 91 91 } 92 92 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/LiteralExpression.java
r8376 r8846 28 28 return Arrays.toString((float[]) literal); 29 29 } 30 return "<" + literal + ">";30 return "<" + literal + '>'; 31 31 } 32 32 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java
r7879 r8846 70 70 @Override 71 71 public String toString() { 72 return "Declaration [instructions=" + instructions + ", idx=" + idx + "]";72 return "Declaration [instructions=" + instructions + ", idx=" + idx + ']'; 73 73 } 74 74 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r8840 r8846 106 106 try { 107 107 SUPPORTED_KEYS.add((String) f.get(null)); 108 if (!f.getName().toLowerCase(Locale.ENGLISH).replace( "_", "-").equals(f.get(null))) {108 if (!f.getName().toLowerCase(Locale.ENGLISH).replace('_', '-').equals(f.get(null))) { 109 109 throw new RuntimeException(f.getName()); 110 110 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r8836 r8846 432 432 @Override 433 433 public String toString() { 434 return left + " " + (ChildOrParentSelectorType.PARENT.equals(type) ? "<" : ">") + link + " "+ right;434 return left + " " + (ChildOrParentSelectorType.PARENT.equals(type) ? '<' : '>') + link + ' ' + right; 435 435 } 436 436 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlCondition.java
r8510 r8846 22 22 public String getKey() { 23 23 if (value != null) 24 return "n" + key + "="+ value;24 return 'n' + key + '=' + value; 25 25 else if (boolValue != null) 26 return "b" + key + "="+ OsmUtils.getNamedOsmBoolean(boolValue);26 return 'b' + key + '=' + OsmUtils.getNamedOsmBoolean(boolValue); 27 27 else 28 return "x"+ key;28 return 'x' + key; 29 29 } 30 30 … … 35 35 @Override 36 36 public String toString() { 37 return "Rule["+key+ ","+(boolValue != null ? "b="+boolValue : "v="+value)+"]";37 return "Rule["+key+','+(boolValue != null ? "b="+boolValue : "v="+value)+']'; 38 38 } 39 39 -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
r8510 r8846 162 162 String val = primitive.get(key); 163 163 IconPrototype p; 164 if ((p = icons.get( "n" + key + "="+ val)) != null) {164 if ((p = icons.get('n' + key + '=' + val)) != null) { 165 165 icon = update(icon, p, scale, mc); 166 166 } 167 if ((p = icons.get( "b" + key + "="+ OsmUtils.getNamedOsmBoolean(val))) != null) {167 if ((p = icons.get('b' + key + '=' + OsmUtils.getNamedOsmBoolean(val))) != null) { 168 168 icon = update(icon, p, scale, mc); 169 169 } 170 if ((p = icons.get( "x"+ key)) != null) {170 if ((p = icons.get('x' + key)) != null) { 171 171 icon = update(icon, p, scale, mc); 172 172 } … … 194 194 LinePrototype styleLine; 195 195 LinemodPrototype styleLinemod; 196 String idx = "n" + key + "="+ val;196 String idx = 'n' + key + '=' + val; 197 197 if ((styleArea = areas.get(idx)) != null && (closed || !styleArea.closed) && !isNotArea) { 198 198 p.area = update(p.area, styleArea, scale, mc); … … 209 209 } 210 210 } 211 idx = "b" + key + "="+ OsmUtils.getNamedOsmBoolean(val);211 idx = 'b' + key + '=' + OsmUtils.getNamedOsmBoolean(val); 212 212 if ((styleArea = areas.get(idx)) != null && (closed || !styleArea.closed) && !isNotArea) { 213 213 p.area = update(p.area, styleArea, scale, mc); … … 224 224 } 225 225 } 226 idx = "x"+ key;226 idx = 'x' + key; 227 227 if ((styleArea = areas.get(idx)) != null && (closed || !styleArea.closed) && !isNotArea) { 228 228 p.area = update(p.area, styleArea, scale, mc); -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSourceHandler.java
r8510 r8846 52 52 Color ret; 53 53 if (i < 0) { 54 ret = Main.pref.getColor("mappaint."+style.getPrefName()+ "."+colString, Color.red);54 ret = Main.pref.getColor("mappaint."+style.getPrefName()+'.'+colString, Color.red); 55 55 } else if (i == 0) { 56 56 ret = ColorHelper.html2color(colString); 57 57 } else { 58 ret = Main.pref.getColor("mappaint."+style.getPrefName()+ "."+colString.substring(0, i),58 ret = Main.pref.getColor("mappaint."+style.getPrefName()+'.'+colString.substring(0, i), 59 59 ColorHelper.html2color(colString.substring(i))); 60 60 } … … 73 73 74 74 private void error(String message) { 75 String warning = style.getDisplayString() + " (" + rule.cond.key + "="+ rule.cond.value + "): " + message;75 String warning = style.getDisplayString() + " (" + rule.cond.key + '=' + rule.cond.value + "): " + message; 76 76 Main.warn(warning); 77 77 style.logError(new Exception(warning)); -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r8512 r8846 16 16 import java.util.LinkedList; 17 17 import java.util.List; 18 import java.util.Set; 18 19 19 20 import javax.swing.BorderFactory; … … 76 77 private final PluginPreference preference; 77 78 private final PluginDownloadTask task; 78 private final List<PluginInformation> toDownload;79 private final Set<PluginInformation> toDownload; 79 80 80 81 private PluginDownloadAfterTask(PluginPreference preference, PluginDownloadTask task, 81 List<PluginInformation> toDownload) {82 Set<PluginInformation> toDownload) { 82 83 this.preference = preference; 83 84 this.task = task; … … 413 414 // 414 415 final PluginPreference preference = getPluginPreference(); 415 final List<PluginInformation> toDownload = preference.getPluginsScheduledForUpdateOrDownload();416 final Set<PluginInformation> toDownload = preference.getPluginsScheduledForUpdateOrDownload(); 416 417 final PluginDownloadTask task; 417 418 if (toDownload != null && !toDownload.isEmpty()) { -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r8836 r8846 151 151 } 152 152 }; 153 tblActiveSources.putClientProperty("terminateEditOnFocusLost", true);153 tblActiveSources.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); 154 154 tblActiveSources.setSelectionModel(selectionModel); 155 155 tblActiveSources.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileAction.java
r8510 r8846 81 81 if (!sel.getName().endsWith(".xml")) sel = new File(sel.getAbsolutePath()+".xml"); 82 82 if (!sel.getName().startsWith(schemaKey)) { 83 sel = new File(sel.getParentFile().getAbsolutePath()+ "/"+schemaKey+"_"+sel.getName());83 sel = new File(sel.getParentFile().getAbsolutePath()+'/'+schemaKey+'_'+sel.getName()); 84 84 } 85 85 return sel; -
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r8510 r8846 119 119 Color color = ColorHelper.html2color(html); 120 120 if (color == null) { 121 Main.warn("Unable to get color from '"+html+"' for color preference '"+value+ "'");121 Main.warn("Unable to get color from '"+html+"' for color preference '"+value+'\''); 122 122 } 123 123 row.add(value); -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java
r8568 r8846 89 89 protected static String sanitize(String s, ImageryType type) { 90 90 String ret = s; 91 String imageryType = type.getTypeString() + ":";91 String imageryType = type.getTypeString() + ':'; 92 92 if (ret.startsWith(imageryType)) { 93 93 // remove ImageryType from URL -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r8840 r8846 21 21 import java.util.LinkedList; 22 22 import java.util.List; 23 import java.util.Set; 23 24 24 25 import javax.swing.AbstractAction; … … 271 272 * @return the list of plugins waiting for update or download 272 273 */ 273 public List<PluginInformation> getPluginsScheduledForUpdateOrDownload() {274 public Set<PluginInformation> getPluginsScheduledForUpdateOrDownload() { 274 275 return model != null ? model.getPluginsScheduledForUpdateOrDownload() : null; 275 276 } -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
r8510 r8846 165 165 166 166 /** 167 * Replies the list of plugin informations to display 167 * Replies the list of plugin informations to display. 168 168 * 169 169 * @return the list of plugin informations to display … … 173 173 } 174 174 175 176 /** 177 * Replies the list of plugins waiting for update or download 178 * 179 * @return the list of plugins waiting for update or download 180 */ 181 public List<PluginInformation> getPluginsScheduledForUpdateOrDownload() { 182 List<PluginInformation> ret = new ArrayList<>(); 175 /** 176 * Replies the set of plugins waiting for update or download. 177 * 178 * @return the set of plugins waiting for update or download 179 */ 180 public Set<PluginInformation> getPluginsScheduledForUpdateOrDownload() { 181 Set<PluginInformation> ret = new HashSet<>(); 183 182 for (String plugin: pendingDownloads) { 184 183 PluginInformation pi = getPluginInformation(plugin); -
trunk/src/org/openstreetmap/josm/gui/progress/AbstractProgressMonitor.java
r8510 r8846 173 173 String newTitle; 174 174 if (extraText != null) { 175 newTitle = taskTitle + " "+ extraText;175 newTitle = taskTitle + ' ' + extraText; 176 176 } else { 177 177 newTitle = taskTitle; -
trunk/src/org/openstreetmap/josm/gui/progress/ProgressTaskId.java
r7937 r8846 7 7 8 8 public ProgressTaskId(String component, String task) { 9 this.id = component + "."+ task;9 this.id = component + '.' + task; 10 10 } 11 11 … … 29 29 ProgressTaskId other = (ProgressTaskId) obj; 30 30 return other.id.equals(id); 31 32 31 } 33 34 32 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r8840 r8846 130 130 */ 131 131 public String getName() { 132 return group != null ? group.getName() + "/"+ getLocaleName() : getLocaleName();132 return group != null ? group.getName() + '/' + getLocaleName() : getLocaleName(); 133 133 } 134 134 … … 137 137 */ 138 138 public String getRawName() { 139 return group != null ? group.getRawName() + "/"+ name : name;139 return group != null ? group.getRawName() + '/' + name : name; 140 140 } 141 141 -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r8840 r8846 247 247 locale_text = getLocaleText(text, text_context, null); 248 248 } 249 p.add(new JLabel(locale_text+ ":"), GBC.std().insets(0, 0, 10, 0));249 p.add(new JLabel(locale_text+':'), GBC.std().insets(0, 0, 10, 0)); 250 250 p.add(new JLabel(key), GBC.std().insets(0, 0, 10, 0)); 251 251 p.add(new JLabel(cstring), types == null ? GBC.eol() : GBC.std().insets(0, 0, 10, 0)); … … 360 360 @Override 361 361 public String toString() { 362 return getClass().getSimpleName() + " [" + fieldsToString() + "]";362 return getClass().getSimpleName() + " [" + fieldsToString() + ']'; 363 363 } 364 364 } … … 583 583 return "KeyedItem [key=" + key + ", text=" + text 584 584 + ", text_context=" + text_context + ", match=" + match 585 + "]";585 + ']'; 586 586 } 587 587 } … … 619 619 return "Key [key=" + key + ", value=" + value + ", text=" + text 620 620 + ", text_context=" + text_context + ", match=" + match 621 + "]";621 + ']'; 622 622 } 623 623 } … … 646 646 AutoCompletingTextField textField = new AutoCompletingTextField(); 647 647 if (alternative_autocomplete_keys != null) { 648 initAutoCompletionField(textField, (key + ","+ alternative_autocomplete_keys).split(","));648 initAutoCompletionField(textField, (key + ',' + alternative_autocomplete_keys).split(",")); 649 649 } else { 650 650 initAutoCompletionField(textField, key); … … 754 754 value = pnl; 755 755 } 756 p.add(new JLabel(locale_text+ ":"), GBC.std().insets(0, 0, 10, 0));756 p.add(new JLabel(locale_text+':'), GBC.std().insets(0, 0, 10, 0)); 757 757 p.add(value, GBC.eol().fill(GBC.HORIZONTAL)); 758 758 return true; … … 861 861 for (Check check : checks) { 862 862 if (Boolean.TRUE.equals(check.matches(tags))) { 863 return true;863 return Boolean.TRUE; 864 864 } 865 865 } … … 869 869 @Override 870 870 public String toString() { 871 return "CheckGroup [columns=" + columns + "]";871 return "CheckGroup [columns=" + columns + ']'; 872 872 } 873 873 } … … 981 981 + (check != null ? "check=" + check + ", " : "") 982 982 + (initialState != null ? "initialState=" + initialState 983 + ", " : "") + "def=" + def + "]";983 + ", " : "") + "def=" + def + ']'; 984 984 } 985 985 } -
trunk/src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java
r8537 r8846 131 131 for (KeyPressReleaseListener q: keyListeners) { 132 132 if (Main.isDebugEnabled()) { 133 Main.debug(q+" => doKeyPressed("+e+ ")");133 Main.debug(q+" => doKeyPressed("+e+')'); 134 134 } 135 135 q.doKeyPressed(e); … … 144 144 for (KeyPressReleaseListener q: keyListeners) { 145 145 if (Main.isDebugEnabled()) { 146 Main.debug(q+" => doKeyReleased("+e+ ")");146 Main.debug(q+" => doKeyReleased("+e+')'); 147 147 } 148 148 q.doKeyReleased(e); -
trunk/src/org/openstreetmap/josm/gui/widgets/HtmlPanel.java
r6890 r8846 37 37 f.isItalic() ? "italic" : "normal" 38 38 ); 39 rule = "body {" + rule + "}";39 rule = "body {" + rule + '}'; 40 40 rule = MessageFormat.format( 41 41 "font-family: ''{0}'';font-size: {1,number}pt; font-weight: {2}; font-style: {3}", … … 45 45 f.isItalic() ? "italic" : "normal" 46 46 ); 47 rule = "strong {" + rule + "}";47 rule = "strong {" + rule + '}'; 48 48 ss.addRule(rule); 49 49 ss.addRule("a {text-decoration: underline; color: blue}"); -
trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java
r8377 r8846 99 99 final Font f = UIManager.getFont("Label.font"); 100 100 final StyleSheet ss = new StyleSheet(); 101 ss.addRule((allBold ? "html" : "strong, b") + " {" + getFontRule(f) + "}");101 ss.addRule((allBold ? "html" : "strong, b") + " {" + getFontRule(f) + '}'); 102 102 ss.addRule("a {text-decoration: underline; color: blue}"); 103 ss.addRule("h1 {" + getFontRule(GuiHelper.getTitleFont()) + "}");103 ss.addRule("h1 {" + getFontRule(GuiHelper.getTitleFont()) + '}'); 104 104 ss.addRule("ol {margin-left: 1cm; margin-top: 0.1cm; margin-bottom: 0.2cm; list-style-type: decimal}"); 105 105 ss.addRule("ul {margin-left: 1cm; margin-top: 0.1cm; margin-bottom: 0.2cm; list-style-type: disc}"); 106 106 if ("km".equals(LanguageInfo.getJOSMLocaleCode())) { 107 107 // Fix rendering problem for Khmer script 108 ss.addRule("p {" + getFontRule(UIManager.getFont("Label.font")) + "}");108 ss.addRule("p {" + getFontRule(UIManager.getFont("Label.font")) + '}'); 109 109 } 110 110 kit.setStyleSheet(ss); -
trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java
r8840 r8846 1158 1158 } 1159 1159 } else { 1160 throwParseException(st, "unrecognized attribute \"" + name + "\"");1160 throwParseException(st, "unrecognized attribute \"" + name + '\"'); 1161 1161 } 1162 1162 } … … 1213 1213 parseSplit(st, split); 1214 1214 } else { 1215 throwParseException(st, "unrecognized node type '" + nodeType + "'");1215 throwParseException(st, "unrecognized node type '" + nodeType + '\''); 1216 1216 } 1217 1217 } -
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; -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r8840 r8846 1390 1390 pl.remove(pi.name); 1391 1391 pl.add(pi.name + " (" + (pi.localversion != null && !pi.localversion.isEmpty() 1392 ? pi.localversion : "unknown") + ")");1392 ? pi.localversion : "unknown") + ')'); 1393 1393 } 1394 1394 Collections.sort(pl); -
trunk/src/org/openstreetmap/josm/plugins/PluginListParser.java
r8510 r8846 70 70 while (line.length() > 70) { 71 71 manifest.append(line.substring(0, 70)).append('\n'); 72 line = " "+ line.substring(70);72 line = ' ' + line.substring(70); 73 73 } 74 74 manifest.append(line).append('\n'); -
trunk/src/org/openstreetmap/josm/tools/ColorHelper.java
r8510 r8846 63 63 if (col == null) 64 64 return null; 65 String code = "#"+int2hex(col.getRed())+int2hex(col.getGreen())+int2hex(col.getBlue());65 String code = '#'+int2hex(col.getRed())+int2hex(col.getGreen())+int2hex(col.getBlue()); 66 66 if (withAlpha) { 67 67 int alpha = col.getAlpha(); -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r8836 r8846 267 267 if (header != null) { 268 268 if (body != null && !header.equals(body)) { 269 msg = header + " (" + body + ")";269 msg = header + " (" + body + ')'; 270 270 } else { 271 271 msg = header; -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r8840 r8846 309 309 } 310 310 if (strings != null) { 311 String trans = strings.get(ctx == null ? text : "_:"+ctx+ "\n"+text);311 String trans = strings.get(ctx == null ? text : "_:"+ctx+'\n'+text); 312 312 if (trans != null) 313 313 return trans; … … 315 315 if (pstrings != null) { 316 316 i = pluralEval(1); 317 String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+ "\n"+text);317 String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+'\n'+text); 318 318 if (trans != null && trans.length > i) 319 319 return trans[i]; … … 339 339 if (pstrings != null) { 340 340 i = pluralEval(num); 341 String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+ "\n"+text);341 String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+'\n'+text); 342 342 if (trans != null && trans.length > i) 343 343 return trans[i]; … … 353 353 354 354 private static URL getTranslationFile(String lang) { 355 return Main.class.getResource("/data/"+lang.replace( "@", "-")+".lang");355 return Main.class.getResource("/data/"+lang.replace('@', '-')+".lang"); 356 356 } 357 357 -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r8840 r8846 720 720 subdir = ""; 721 721 } else if (!subdir.isEmpty() && !subdir.endsWith("/")) { 722 subdir += "/";722 subdir += '/'; 723 723 } 724 724 String[] extensions; … … 742 742 /* cache separately */ 743 743 if (dirs != null && !dirs.isEmpty()) { 744 cacheName = "id:" + id + ":"+ fullName;744 cacheName = "id:" + id + ':' + fullName; 745 745 if (archive != null) { 746 cacheName += ":"+ archive.getName();746 cacheName += ':' + archive.getName(); 747 747 } 748 748 } … … 838 838 bytes = Utils.decodeUrl(data).getBytes(StandardCharsets.UTF_8); 839 839 } catch (IllegalArgumentException ex) { 840 Main.warn("Unable to decode URL data part: "+ex.getMessage() + " (" + data + ")");840 Main.warn("Unable to decode URL data part: "+ex.getMessage() + " (" + data + ')'); 841 841 return null; 842 842 } … … 898 898 } else { 899 899 final String fn_md5 = Utils.md5Hex(fn); 900 url = b + fn_md5.substring(0, 1) + "/"+ fn_md5.substring(0, 2) + "/" + fn;900 url = b + fn_md5.substring(0, 1) + '/' + fn_md5.substring(0, 2) + "/" + fn; 901 901 } 902 902 result = getIfAvailableHttp(url, type); … … 922 922 inArchiveDir = ""; 923 923 } else if (!inArchiveDir.isEmpty()) { 924 inArchiveDir += "/";924 inArchiveDir += '/'; 925 925 } 926 926 String entryName = inArchiveDir + fullName; … … 1142 1142 } 1143 1143 if (GraphicsEnvironment.isHeadless()) { 1144 Main.warn("Cursors are not available in headless mode. Returning null for '"+name+ "'");1144 Main.warn("Cursors are not available in headless mode. Returning null for '"+name+'\''); 1145 1145 return null; 1146 1146 } -
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r8510 r8846 54 54 } else if (code.matches(".+@.+")) { 55 55 return code.substring(0, 1).toUpperCase(Locale.ENGLISH) + code.substring(1, 2) 56 + "-" + code.substring(3, 4).toUpperCase(Locale.ENGLISH) + code.substring(4) + ":";57 } 58 return code.substring(0, 1).toUpperCase(Locale.ENGLISH) + code.substring(1) + ":";56 + '-' + code.substring(3, 4).toUpperCase(Locale.ENGLISH) + code.substring(4) + ':'; 57 } 58 return code.substring(0, 1).toUpperCase(Locale.ENGLISH) + code.substring(1) + ':'; 59 59 } 60 60 … … 156 156 */ 157 157 public static Locale getLocale(String localeName) { 158 int country = localeName.indexOf( "_");159 int variant = localeName.indexOf( "@");158 int country = localeName.indexOf('_'); 159 int variant = localeName.indexOf('@'); 160 160 if (variant < 0 && country >= 0) 161 variant = localeName.indexOf( "_", country+1);161 variant = localeName.indexOf('_', country+1); 162 162 Locale l; 163 163 if (variant > 0 && country > 0) { … … 198 198 public static String getLanguageCodeXML() { 199 199 String code = getJOSMLocaleCode(); 200 code = code.replace( "@", "-");201 return code+ ".";200 code = code.replace('@', '-'); 201 return code+'.'; 202 202 } 203 203 … … 210 210 public static String getLanguageCodeManifest() { 211 211 String code = getJOSMLocaleCode(); 212 code = code.replace( "@", "-");213 return code+ "_";212 code = code.replace('@', '-'); 213 return code+'_'; 214 214 } 215 215 … … 239 239 if (v != null && !v.isEmpty()) { 240 240 if (c != null) 241 list.add(lang+ "_"+c+"@"+v);242 list.add(lang+ "@"+v);241 list.add(lang+'_'+c+'@'+v); 242 list.add(lang+'@'+v); 243 243 } 244 244 if (c != null) 245 list.add(lang+ "_"+c);245 list.add(lang+'_'+c); 246 246 list.add(lang); 247 247 return list; -
trunk/src/org/openstreetmap/josm/tools/MultiMap.java
r8510 r8846 232 232 List<String> entries = new ArrayList<>(map.size()); 233 233 for (Entry<A, Set<B>> entry : map.entrySet()) { 234 entries.add(entry.getKey() + "->{" + Utils.join(",", entry.getValue()) + "}");235 } 236 return "(" + Utils.join(",", entries) + ")";234 entries.add(entry.getKey() + "->{" + Utils.join(",", entry.getValue()) + '}'); 235 } 236 return '(' + Utils.join(",", entries) + ')'; 237 237 } 238 238 } -
trunk/src/org/openstreetmap/josm/tools/MultikeyActionsHandler.java
r8510 r8846 209 209 210 210 private String formatMenuText(KeyStroke keyStroke, String index, String description) { 211 String shortcutText = KeyEvent.getKeyModifiersText(keyStroke.getModifiers()) + "+"212 + KeyEvent.getKeyText(keyStroke.getKeyCode()) + ","+ index;211 String shortcutText = KeyEvent.getKeyModifiersText(keyStroke.getModifiers()) + '+' 212 + KeyEvent.getKeyText(keyStroke.getKeyCode()) + ',' + index; 213 213 214 214 return "<html><i>" + shortcutText + "</i> " + description; -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r8510 r8846 118 118 if (map.containsKey(key)) 119 119 return Double.parseDouble(map.get(key)); 120 return Double.parseDouble(map.get( "m"+key));120 return Double.parseDouble(map.get('m'+key)); 121 121 } 122 122 … … 296 296 double lon = Math.round(dlon * decimals); 297 297 lon /= decimals; 298 return Main.getOSMWebsite() + "/#map="+zoom+ "/"+lat+"/"+lon;298 return Main.getOSMWebsite() + "/#map="+zoom+'/'+lat+'/'+lon; 299 299 } 300 300 } -
trunk/src/org/openstreetmap/josm/tools/Pair.java
r8510 r8846 64 64 @Override 65 65 public String toString() { 66 return "<"+a+ ","+b+">";66 return "<"+a+','+b+'>'; 67 67 } 68 68 -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r8510 r8846 295 295 result += name; 296 296 if (sc != null && !sc.getKeyText().isEmpty()) { 297 result += " ";297 result += ' '; 298 298 if (canHtml) { 299 299 result += "<font size='-2'>"; 300 300 } 301 result += "("+sc.getKeyText()+")";301 result += '('+sc.getKeyText()+')'; 302 302 if (canHtml) { 303 303 result += "</font>"; … … 323 323 @Override 324 324 public String getOSDescription() { 325 return System.getProperty("os.name") + " "+ System.getProperty("os.version");325 return System.getProperty("os.name") + ' ' + System.getProperty("os.version"); 326 326 } 327 327 -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r8540 r8846 153 153 result += name; 154 154 if (sc != null && !sc.getKeyText().isEmpty()) { 155 result += " ";155 result += ' '; 156 156 result += "<font size='-2'>"; 157 result += "("+sc.getKeyText()+")";157 result += '('+sc.getKeyText()+')'; 158 158 result += "</font>"; 159 159 } … … 210 210 String version = Utils.execOutput(Arrays.asList(args)); 211 211 if (version != null && !version.contains("not installed")) { 212 return packageName + ":"+ version;212 return packageName + ':' + version; 213 213 } 214 214 } … … 336 336 @Override public String toString() { 337 337 return "ReleaseInfo [path=" + path + ", descriptionField=" + descriptionField + 338 ", idField=" + idField + ", releaseField=" + releaseField + "]";338 ", idField=" + idField + ", releaseField=" + releaseField + ']'; 339 339 } 340 340 … … 372 372 // If no description has been found, try to rebuild it with "id" + "release" (i.e. "name" + "version") 373 373 if (result == null && id != null && release != null) { 374 result = id + " "+ release;374 result = id + ' ' + release; 375 375 } 376 376 } catch (IOException e) { … … 533 533 Main.warn("extended font config - overriding ''{0}={1}'' with ''{2}''", key, prevValue, value); 534 534 } 535 w.append(key + "=" + value + "\n");535 w.append(key + '=' + value + '\n'); 536 536 } 537 537 w.append('\n'); … … 540 540 continue; 541 541 } 542 String key = "filename." + entry.name.replace( " ", "_");542 String key = "filename." + entry.name.replace(' ', '_'); 543 543 String value = entry.file; 544 544 String prevValue = props.getProperty(key); … … 546 546 Main.warn("extended font config - overriding ''{0}={1}'' with ''{2}''", key, prevValue, value); 547 547 } 548 w.append(key + "=" + value + "\n");548 w.append(key + '=' + value + '\n'); 549 549 } 550 550 w.append('\n'); 551 551 String fallback = props.getProperty("sequence.fallback"); 552 552 if (fallback != null) { 553 w.append("sequence.fallback=" + fallback + "," + Utils.join(",", allCharSubsets) + "\n");553 w.append("sequence.fallback=" + fallback + ',' + Utils.join(",", allCharSubsets) + '\n'); 554 554 } else { 555 w.append("sequence.fallback=" + Utils.join(",", allCharSubsets) + "\n");555 w.append("sequence.fallback=" + Utils.join(",", allCharSubsets) + '\n'); 556 556 } 557 557 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r8510 r8846 187 187 @Override 188 188 public String getOSDescription() { 189 return Utils.strip(System.getProperty("os.name")) + " "+189 return Utils.strip(System.getProperty("os.name")) + ' ' + 190 190 ((System.getenv("ProgramFiles(x86)") == null) ? "32" : "64") + "-Bit"; 191 191 } -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r8840 r8846 240 240 String modifText = KeyEvent.getKeyModifiersText(keyStroke.getModifiers()); 241 241 if ("".equals(modifText)) return KeyEvent.getKeyText(keyStroke.getKeyCode()); 242 return modifText + "+"+ KeyEvent.getKeyText(keyStroke.getKeyCode());242 return modifText + '+' + KeyEvent.getKeyText(keyStroke.getKeyCode()); 243 243 } 244 244 -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r8840 r8846 258 258 String value = entry.getValue(); 259 259 if (key.length() > MAX_KEY_LENGTH) { 260 r = warning(tr("Key is too long (max {0} characters):", MAX_KEY_LENGTH), key+ "="+value, "tags.paste.keytoolong");260 r = warning(tr("Key is too long (max {0} characters):", MAX_KEY_LENGTH), key+'='+value, "tags.paste.keytoolong"); 261 261 if (r == 2 || r == 3) return false; if (r == 4) return true; 262 262 } -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r8795 r8846 1208 1208 final List<String> lines = Arrays.asList(s.split("\\n")); 1209 1209 if (lines.size() > maxLines) { 1210 return join("\n", lines.subList(0, maxLines - 1)) + "\n " + "...";1210 return join("\n", lines.subList(0, maxLines - 1)) + "\n..."; 1211 1211 } else { 1212 1212 return s; … … 1341 1341 String old = System.setProperty(key, value); 1342 1342 if (!key.toLowerCase(Locale.ENGLISH).contains("password")) { 1343 Main.debug("System property '" + key + "' set to '" + value + "'. Old value was '" + old + "'");1343 Main.debug("System property '" + key + "' set to '" + value + "'. Old value was '" + old + '\''); 1344 1344 } else { 1345 1345 Main.debug("System property '" + key + "' changed."); … … 1397 1397 String name = filename.toLowerCase(Locale.ENGLISH); 1398 1398 for (String ext : extensions) { 1399 if (name.endsWith( "."+ ext.toLowerCase(Locale.ENGLISH)))1399 if (name.endsWith('.' + ext.toLowerCase(Locale.ENGLISH))) 1400 1400 return true; 1401 1401 } -
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r8510 r8846 144 144 b += line.replaceAll("<img ", "<img border=\"0\" ") 145 145 .replaceAll("<span class=\"icon\">.</span>", "") 146 .replaceAll("href=\"/", "href=\"" + baseurl + "/")146 .replaceAll("href=\"/", "href=\"" + baseurl + '/') 147 147 .replaceAll(" />", ">") 148 + "\n";148 + '\n'; 149 149 } else if (transl && line.contains("</div>")) { 150 150 transl = false; -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r8510 r8846 474 474 @Override 475 475 public String toString() { 476 return "WindowGeometry{topLeft="+topLeft+",extent="+extent+ "}";476 return "WindowGeometry{topLeft="+topLeft+",extent="+extent+'}'; 477 477 } 478 478 } -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r8840 r8846 133 133 if ("class".equals(fieldName) || "default".equals(fieldName) || "throw".equals(fieldName) || 134 134 "new".equals(fieldName) || "null".equals(fieldName)) { 135 fieldName += "_";135 fieldName += '_'; 136 136 } 137 137 try { -
trunk/src/org/openstreetmap/josm/tools/XmlParsingException.java
r8375 r8846 61 61 msg = getClass().getName(); 62 62 } 63 return msg + " "+ tr("(at line {0}, column {1})", lineNumber, columnNumber);63 return msg + ' ' + tr("(at line {0}, column {1})", lineNumber, columnNumber); 64 64 } 65 65 -
trunk/src/org/openstreetmap/josm/tools/template_engine/SearchExpressionCondition.java
r8376 r8846 26 26 @Override 27 27 public String toString() { 28 return condition.toString() + " '" + text + "'";28 return condition.toString() + " '" + text + '\''; 29 29 } 30 30 } -
trunk/src/org/openstreetmap/josm/tools/template_engine/Tokenizer.java
r8510 r8846 3 3 4 4 import java.util.Arrays; 5 import java.util.List; 5 import java.util.HashSet; 6 import java.util.Set; 6 7 7 8 public class Tokenizer { … … 36 37 @Override 37 38 public String toString() { 38 return type + (text != null ? " "+ text : "");39 return type + (text != null ? ' ' + text : ""); 39 40 } 40 41 } … … 42 43 public enum TokenType { CONDITION_START, VARIABLE_START, CONTEXT_SWITCH_START, END, PIPE, APOSTROPHE, TEXT, EOF } 43 44 44 private final List<Character> specialCharaters = Arrays.asList(new Character[] {'$', '?', '{', '}', '|', '\'', '!'});45 private final Set<Character> specialCharaters = new HashSet<>(Arrays.asList(new Character[] {'$', '?', '{', '}', '|', '\'', '!'})); 45 46 46 47 private final String template; -
trunk/src/org/openstreetmap/josm/tools/template_engine/Variable.java
r8404 r8846 56 56 @Override 57 57 public String toString() { 58 return "{" + variableName + "}";58 return '{' + variableName + '}'; 59 59 } 60 60
Note:
See TracChangeset
for help on using the changeset viewer.