Changeset 6264 in josm
- Timestamp:
- 2013-09-27T01:16:28+02:00 (11 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r6245 r6264 156 156 */ 157 157 public String findSummaryDocumentation() { 158 String result = "<table>";158 StringBuilder result = new StringBuilder("<table>"); 159 159 for (Class<? extends DownloadTask> taskClass : downloadTasks) { 160 160 if (taskClass != null) { 161 161 try { 162 162 DownloadTask task = taskClass.getConstructor().newInstance(); 163 result += task.acceptsDocumentationSummary();163 result.append(task.acceptsDocumentationSummary()); 164 164 } catch (Exception e) { 165 165 e.printStackTrace(); … … 167 167 } 168 168 } 169 result += "</table>";170 return result ;169 result.append("</table>"); 170 return result.toString(); 171 171 } 172 172 -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayNoTagCorrector.java
r5732 r6264 64 64 return tags.iterator().next().toString(); 65 65 } else if (tags.size() > 1) { 66 String s = "<ul>";66 StringBuilder s = new StringBuilder("<ul>"); 67 67 for (Tag t : tags) { 68 s += "<li>" + t.toString() + "</li>";68 s.append("<li>").append(t).append("</li>"); 69 69 } 70 s += "</ul>";71 return s ;70 s.append("</ul>"); 71 return s.toString(); 72 72 } else { 73 73 return ""; -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r6248 r6264 144 144 if (i.bounds != null) { 145 145 bounds = i.bounds.encodeAsString(","); 146 String shapesString = "";146 StringBuilder shapesString = new StringBuilder(); 147 147 for (Shape s : i.bounds.getShapes()) { 148 if ( !shapesString.isEmpty()) {149 shapesString += ";";148 if (shapesString.length() > 0) { 149 shapesString.append(";"); 150 150 } 151 shapesString += s.encodeAsString(",");152 } 153 if ( !shapesString.isEmpty()) {154 shapes = shapesString ;151 shapesString.append(s.encodeAsString(",")); 152 } 153 if (shapesString.length() > 0) { 154 shapes = shapesString.toString(); 155 155 } 156 156 } -
trunk/src/org/openstreetmap/josm/data/osm/TigerUtils.java
r6231 r6264 44 44 } 45 45 } 46 String combined = "";46 StringBuilder combined = new StringBuilder(); 47 47 for (Object part : resultSet) { 48 if (combined.length() > 0) 49 combined += ":"; 50 combined += part; 48 if (combined.length() > 0) { 49 combined.append(":"); 50 } 51 combined.append(part); 51 52 } 52 return combined ;53 return combined.toString(); 53 54 } 54 55 -
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r6084 r6264 241 241 @Override 242 242 public String toString() { 243 String result ="History ["244 + (type != null ? "type=" + type + ", " : "") + "id=" + id ;243 StringBuilder result = new StringBuilder("History [" 244 + (type != null ? "type=" + type + ", " : "") + "id=" + id); 245 245 if (versions != null) { 246 result += ", versions=\n";246 result.append(", versions=\n"); 247 247 for (HistoryOsmPrimitive v : versions) { 248 result += "\t" + v + ",\n";248 result.append("\t").append(v).append(",\n"); 249 249 } 250 250 } 251 result += "]";252 return result ;251 result.append("]"); 252 return result.toString(); 253 253 } 254 254 } -
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r6069 r6264 170 170 public String getIgnoreState() { 171 171 Collection<String> strings = new TreeSet<String>(); 172 String ignorestring = getIgnoreSubGroup();172 StringBuilder ignorestring = new StringBuilder(getIgnoreSubGroup()); 173 173 for (OsmPrimitive o : primitives) { 174 174 // ignore data not yet uploaded … … 186 186 } 187 187 for (String o : strings) { 188 ignorestring += ":" + o;189 } 190 return ignorestring ;188 ignorestring.append(":").append(o); 189 } 190 return ignorestring.toString(); 191 191 } 192 192 -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r6251 r6264 686 686 Main.pref.put(PREF_USE_IGNORE_FILE, prefUseIgnoreFile.isSelected()); 687 687 Main.pref.put(PREF_USE_SPELL_FILE, prefUseSpellFile.isSelected()); 688 String sources = "";688 StringBuilder sources = new StringBuilder(); 689 689 if (sourcesList.getModel().getSize() > 0) { 690 String sb = "";691 690 for (int i = 0; i < sourcesList.getModel().getSize(); ++i) { 692 sb += ";"+sourcesList.getModel().getElementAt(i); 693 } 694 sources = sb.substring(1); 695 } 696 if (sources.length() == 0) { 697 sources = null; 698 } 699 return Main.pref.put(PREF_SOURCES, sources); 691 if (sources.length() > 0) { 692 sources.append(";"); 693 } 694 sources.append(sourcesList.getModel().getElementAt(i)); 695 } 696 } 697 return Main.pref.put(PREF_SOURCES, sources.length() > 0 ? sources.toString() : null); 700 698 } 701 699 -
trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java
r6069 r6264 33 33 */ 34 34 public void visit(Collection<? extends OsmPrimitive> data) { 35 String multipleName = "";35 StringBuilder multipleName = new StringBuilder(); 36 36 String multiplePluralClassname = null; 37 37 size = data.size(); … … 44 44 } 45 45 if (name != null && !name.isEmpty() && multipleName.length() <= MULTIPLE_NAME_MAX_LENGTH) { 46 if ( !multipleName.isEmpty()) {47 multipleName += ", ";46 if (multipleName.length() > 0) { 47 multipleName.append(", "); 48 48 } 49 multipleName += name;49 multipleName.append(name); 50 50 } 51 51 … … 64 64 } else { 65 65 displayName = size + " " + trn(multipleClassname, multiplePluralClassname, size); 66 if ( !multipleName.isEmpty()) {66 if (multipleName.length() > 0) { 67 67 if (multipleName.length() <= MULTIPLE_NAME_MAX_LENGTH) { 68 68 displayName += ": " + multipleName; -
trunk/src/org/openstreetmap/josm/gui/SplashScreen.java
r6084 r6264 40 40 private SwingRenderingProgressMonitor progressMonitor; 41 41 42 /** 43 * Constructs a new {@code SplashScreen}. 44 */ 42 45 public SplashScreen() { 43 46 super(); … … 157 160 public void setCustomText(String message) { 158 161 if(message.isEmpty()) 159 message = " "; / * prevent killing of additional line */162 message = " "; // prevent killing of additional line 160 163 lblCustomText.setText(message); 161 164 repaint(); … … 198 201 messages.add(taskTitle); 199 202 } 200 String html = "";203 StringBuilder html = new StringBuilder(); 201 204 int i = 0; 202 205 for (String m : messages) { 203 html += "<p class=\"entry" + (++i) + "\">" + m + "</p>";206 html.append("<p class=\"entry").append(++i).append("\">").append(m).append("</p>"); 204 207 } 205 208 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java
r6084 r6264 311 311 if (referrers.isEmpty()) 312 312 return tr("(none)"); 313 String str = "<html>";313 StringBuilder str = new StringBuilder("<html>"); 314 314 for (OsmPrimitive r: referrers) { 315 str = str + r.getDisplayName(DefaultNameFormatter.getInstance()) + "<br>";316 } 317 str = str + "</html>";318 return str ;315 str.append(r.getDisplayName(DefaultNameFormatter.getInstance())).append("<br>"); 316 } 317 str.append("</html>"); 318 return str.toString(); 319 319 } 320 320 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java
r6258 r6264 451 451 setIcon(ImageProvider.get("data", "object")); 452 452 } 453 String text = "";453 StringBuilder text = new StringBuilder(); 454 454 for (Entry<OsmPrimitiveType, Integer> entry: stat.entrySet()) { 455 455 OsmPrimitiveType type = entry.getKey(); … … 464 464 case RELATION: msg = trn("{0} relation", "{0} relations", numPrimitives, numPrimitives); break; 465 465 } 466 text = text.isEmpty() ? msg : text + ", " + msg; 467 } 468 setText(text); 466 if (text.length() > 0) { 467 text.append(", "); 468 } 469 text.append(msg); 470 } 471 setText(text.toString()); 469 472 } 470 473 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r6246 r6264 1228 1228 return; 1229 1229 String sep = ""; 1230 String s = "";1230 StringBuilder s = new StringBuilder(); 1231 1231 for (OsmPrimitive p : sel) { 1232 1232 String val = p.get(key); … … 1244 1244 t = "type:relation "; 1245 1245 } 1246 s += sep + "(" + t + "\"" +1247 org.openstreetmap.josm.actions.search.SearchAction.escapeStringForSearch(key) + "\"=\"" +1248 org.openstreetmap.josm.actions.search.SearchAction.escapeStringForSearch(val) + "\")";1246 s.append(sep).append("(").append(t).append("\"").append( 1247 org.openstreetmap.josm.actions.search.SearchAction.escapeStringForSearch(key)).append("\"=\"").append( 1248 org.openstreetmap.josm.actions.search.SearchAction.escapeStringForSearch(val)).append("\")"); 1249 1249 sep = " OR "; 1250 1250 } 1251 1251 1252 SearchSetting ss = new SearchSetting(s , SearchMode.replace, true, false, false);1252 SearchSetting ss = new SearchSetting(s.toString(), SearchMode.replace, true, false, false); 1253 1253 org.openstreetmap.josm.actions.search.SearchAction.searchWithoutHistory(ss); 1254 1254 } -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r6246 r6264 1031 1031 @Override 1032 1032 public String nameSupportedProjections() { 1033 String res = "";1034 for (String p : info.getServerProjections()) {1035 if (!res.isEmpty()) {1036 res += ", ";1037 } 1038 res += p;1033 StringBuilder res = new StringBuilder(); 1034 for (String p : info.getServerProjections()) { 1035 if (res.length() > 0) { 1036 res.append(", "); 1037 } 1038 res.append(p); 1039 1039 } 1040 1040 return tr("Supported projections are: {0}", res); -
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r6143 r6264 22 22 } 23 23 24 /** 25 * Constructs a new {@code WikiReader}. 26 */ 24 27 public WikiReader() { 25 28 this.baseurl = Main.pref.get("help.baseurl", Main.JOSM_WEBSITE); … … 86 89 87 90 private String readNormal(BufferedReader in) throws IOException { 88 String b = "";91 StringBuilder b = new StringBuilder(); 89 92 for (String line = in.readLine(); line != null; line = in.readLine()) { 90 93 if (!line.contains("[[TranslatedPages]]")) { 91 b += line.replaceAll(" />", ">") + "\n";94 b.append(line.replaceAll(" />", ">")).append("\n"); 92 95 } 93 96 } -
trunk/test/functional/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergerTest.java
r3034 r6264 23 23 n1.put("key" + i, "value" + i); 24 24 } 25 String note = "";25 StringBuilder note = new StringBuilder(); 26 26 for (int i=0; i < 50; i++) { 27 note += " A very long text ";27 note.append(" A very long text "); 28 28 } 29 n1.put("note", note );29 n1.put("note", note.toString()); 30 30 w1.addNode(new Node(2)); 31 31 w1.addNode(new Node(3)); -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r5556 r6264 48 48 public void projReferenceTest() { 49 49 Projection swiss = Projections.getProjectionByCode("EPSG:21781"); // Swiss grid 50 String errs = "";50 StringBuilder errs = new StringBuilder(); 51 51 for (ProjData pd : data) { 52 52 EastNorth en2 = swiss.latlon2eastNorth(pd.ll); 53 53 if (Math.abs(pd.en.east() - en2.east()) > EPSILON || Math.abs(pd.en.north() - en2.north()) > EPSILON) { 54 errs += String.format("%s should be: %s but is: %s\n", pd.name, pd.en, en2);55 } 56 } 57 assertTrue(errs , errs.length() == 0);54 errs.append(String.format("%s should be: %s but is: %s\n", pd.name, pd.en, en2)); 55 } 56 } 57 assertTrue(errs.toString(), errs.length() == 0); 58 58 } 59 59
Note:
See TracChangeset
for help on using the changeset viewer.