Changeset 8849 in josm
- Timestamp:
- 2015-10-10T14:30:12+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r8848 r8849 162 162 harmonizedKeys.clear(); 163 163 164 String errorSources = "";164 StringBuilder errorSources = new StringBuilder(); 165 165 for (String source : Main.pref.getCollection(PREF_SOURCES, DEFAULT_SOURCES)) { 166 166 try ( … … 239 239 } 240 240 } catch (IOException e) { 241 errorSources += source + '\n';242 } 243 } 244 245 if ( !errorSources.isEmpty())241 errorSources.append(source).append('\n'); 242 } 243 } 244 245 if (errorSources.length() > 0) 246 246 throw new IOException(tr("Could not access data file(s):\n{0}", errorSources)); 247 247 } -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java
r8840 r8849 363 363 private static final class StatisticsInfo { 364 364 public int numTags; 365 public Map<OsmPrimitiveType, Integer> sourceInfo;366 public Map<OsmPrimitiveType, Integer> targetInfo;365 public final Map<OsmPrimitiveType, Integer> sourceInfo; 366 public final Map<OsmPrimitiveType, Integer> targetInfo; 367 367 368 368 private StatisticsInfo() { 369 sourceInfo = new HashMap<>();370 targetInfo = new HashMap<>();369 sourceInfo = new EnumMap<>(OsmPrimitiveType.class); 370 targetInfo = new EnumMap<>(OsmPrimitiveType.class); 371 371 } 372 372 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategy.java
r8846 r8849 263 263 264 264 private String getPrimitiveName(OsmPrimitive n) { 265 String name = null;265 StringBuilder name = new StringBuilder(); 266 266 if (!n.hasKeys()) return null; 267 267 for (String rn : nameTags) { 268 name = n.get(rn); 269 if (name != null) { 268 String val = n.get(rn); 269 if (val != null) { 270 name.append(val); 270 271 break; 271 272 } … … 274 275 String comp = n.get(rn); 275 276 if (comp != null) { 276 if (name == null) {277 name = comp;277 if (name.length() == 0) { 278 name.append(comp); 278 279 } else { 279 name += " (" + comp + ')';280 name.append(" (").append(comp).append(')'); 280 281 } 281 282 break; 282 283 } 283 284 } 284 return name ;285 return name.toString(); 285 286 } 286 287 -
trunk/src/org/openstreetmap/josm/io/GpxExporter.java
r8846 r8849 318 318 if (answer != JOptionPane.OK_OPTION || l.getSelectedIndex() == -1) 319 319 return; 320 String license = "";320 StringBuilder license = new StringBuilder(); 321 321 for (int i : l.getSelectedIndices()) { 322 322 if (i == 2) { 323 license = "public domain";323 license = new StringBuilder("public domain"); 324 324 break; 325 325 } 326 license += license.isEmpty() ? URLS[i] : ", "+URLS[i]; 326 if (license.length() > 0) { 327 license.append(", "); 328 } 329 license.append(URLS[i]); 327 330 } 328 copyright.setText(license );331 copyright.setText(license.toString()); 329 332 copyright.setCaretPosition(0); 330 333 } -
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r8846 r8849 120 120 boolean transl = false; 121 121 boolean skip = false; 122 String b = "";123 String full = "";122 StringBuilder b = new StringBuilder(); 123 StringBuilder full = new StringBuilder(); 124 124 for (String line = in.readLine(); line != null; line = in.readLine()) { 125 full += line;125 full.append(line); 126 126 if (line.contains("<div id=\"searchable\">")) { 127 127 inside = true; … … 142 142 // add a border="0" attribute to images, otherwise the internal help browser 143 143 // will render a thick border around images inside an <a> element 144 b +=line.replaceAll("<img ", "<img border=\"0\" ")144 b.append(line.replaceAll("<img ", "<img border=\"0\" ") 145 145 .replaceAll("<span class=\"icon\">.</span>", "") 146 146 .replaceAll("href=\"/", "href=\"" + baseurl + '/') 147 .replaceAll(" />", ">") 148 + '\n';147 .replaceAll(" />", ">")) 148 .append('\n'); 149 149 } else if (transl && line.contains("</div>")) { 150 150 transl = false; … … 157 157 || b.indexOf(" does not exist. You can create it here.</p>") >= 0) 158 158 return ""; 159 if (b. isEmpty())159 if (b.length() == 0) 160 160 b = full; 161 161 return "<html><base href=\""+url.toExternalForm() +"\"> " + b + "</html>";
Note:
See TracChangeset
for help on using the changeset viewer.