Changeset 6087 in josm
- Timestamp:
- 2013-07-26T17:28:24+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
r5962 r6087 238 238 @Override 239 239 protected void buttonAction(int buttonIndex, ActionEvent evt) { 240 if (buttonIndex == 0 && tBookmarkName.getText() != null && ! "".equals(tBookmarkName.getText()) &&240 if (buttonIndex == 0 && tBookmarkName.getText() != null && !tBookmarkName.getText().isEmpty() && 241 241 OffsetBookmark.getBookmarkByName(layer, tBookmarkName.getText()) != null) { 242 242 if (!confirmOverwriteBookmark()) return; … … 252 252 if (getValue() != 1) { 253 253 layer.setOffset(oldDx, oldDy); 254 } else if (tBookmarkName.getText() != null && ! "".equals(tBookmarkName.getText())) {254 } else if (tBookmarkName.getText() != null && !tBookmarkName.getText().isEmpty()) { 255 255 OffsetBookmark.bookmarkOffset(tBookmarkName.getText(), layer); 256 256 } -
trunk/src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java
r6069 r6087 126 126 // If the contents match, they will be inserted into the text field and the corresponding 127 127 // service will be pre-selected. 128 if(!clip. equals("") && tfWmsUrl.getText().equals("")128 if(!clip.isEmpty() && tfWmsUrl.getText().isEmpty() 129 129 && (s.urlRegEx.matcher(clip).find() || s.idValidator.matcher(clip).matches())) { 130 130 serviceBtn.setSelected(true); … … 133 133 s.btn = serviceBtn; 134 134 group.add(serviceBtn); 135 if(!s.url. equals("")) {135 if(!s.url.isEmpty()) { 136 136 panel.add(serviceBtn, GBC.std()); 137 137 panel.add(new UrlLabel(s.url, tr("Visit Homepage")), GBC.eol().anchor(GridBagConstraints.EAST)); … … 142 142 143 143 // Fallback in case no match was found 144 if(tfWmsUrl.getText(). equals("") && firstBtn != null) {144 if(tfWmsUrl.getText().isEmpty() && firstBtn != null) { 145 145 firstBtn.setSelected(true); 146 146 } … … 175 175 // We've reached the custom WMS URL service 176 176 // Just set the URL and hope everything works out 177 if(s.wmsUrl. equals("")) {177 if(s.wmsUrl.isEmpty()) { 178 178 addWMSLayer(s.name + " (" + text + ")", text); 179 179 break outer; -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r5909 r6087 680 680 @Override public boolean match(OsmPrimitive osm) { 681 681 if (!osm.hasKeys() && osm.getUser() == null) 682 return search. equals("");682 return search.isEmpty(); 683 683 684 684 for (String key: osm.keySet()) { -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r6084 r6087 441 441 putDefault(key, def); 442 442 final String prop = properties.get(key); 443 if (prop == null || prop. equals(""))443 if (prop == null || prop.isEmpty()) 444 444 return def; 445 445 return prop; … … 774 774 putDefault("color."+colKey, ColorHelper.color2html(def)); 775 775 String colStr = specName != null ? get("color."+specName) : ""; 776 if(colStr. equals("")) {776 if(colStr.isEmpty()) { 777 777 colStr = get("color."+colKey); 778 778 } 779 return colStr. equals("") ? def : ColorHelper.html2color(colStr);779 return colStr.isEmpty() ? def : ColorHelper.html2color(colStr); 780 780 } 781 781 782 782 synchronized public Color getDefaultColor(String colKey) { 783 783 String colStr = defaults.get("color."+colKey); 784 return colStr == null || "".equals(colStr) ? null : ColorHelper.html2color(colStr);784 return colStr == null || colStr.isEmpty() ? null : ColorHelper.html2color(colStr); 785 785 } 786 786 -
trunk/src/org/openstreetmap/josm/data/Version.java
r5956 r6087 79 79 Pattern p = Pattern.compile("^([^:]+):(.*)$"); 80 80 for (String line: content.split("\n")) { 81 if (line == null || line.trim(). equals("")) {81 if (line == null || line.trim().isEmpty()) { 82 82 continue; 83 83 } -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
r5729 r6087 127 127 // some additional checks to respect extended URLs in preferences (legacy workaround) 128 128 private boolean isSimilar(String a, String b) { 129 return Utils.equal(a, b) || (a != null && b != null && ! "".equals(a) && !"".equals(b) && (a.contains(b) || b.contains(a)));129 return Utils.equal(a, b) || (a != null && b != null && !a.isEmpty() && !b.isEmpty() && (a.contains(b) || b.contains(a))); 130 130 } 131 131 -
trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
r6084 r6087 602 602 throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values.")); 603 603 for (Tag tag: tags) { 604 if (tag.getValue() == null || tag.getValue(). equals("")) {604 if (tag.getValue() == null || tag.getValue().isEmpty()) { 605 605 primitive.remove(tag.getKey()); 606 606 } else { -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r6070 r6087 573 573 */ 574 574 private boolean toggleCheckState(String togglePref) { 575 toggleable = togglePref != null && !togglePref. equals("");575 toggleable = togglePref != null && !togglePref.isEmpty(); 576 576 577 577 toggleValue = Main.pref.getInteger("message."+togglePref+".value", -1); -
trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
r6084 r6087 102 102 public void setPartiallyIdentified(String userName) throws IllegalArgumentException { 103 103 CheckParameterUtil.ensureParameterNotNull(userName, "userName"); 104 if (userName.trim(). equals(""))104 if (userName.trim().isEmpty()) 105 105 throw new IllegalArgumentException(MessageFormat.format("Expected non-empty value for parameter ''{0}'', got ''{1}''", "userName", userName)); 106 106 this.userName = userName; … … 120 120 public void setFullyIdentified(String username, UserInfo userinfo) throws IllegalArgumentException { 121 121 CheckParameterUtil.ensureParameterNotNull(username, "username"); 122 if (username.trim(). equals(""))122 if (username.trim().isEmpty()) 123 123 throw new IllegalArgumentException(tr("Expected non-empty value for parameter ''{0}'', got ''{1}''", "userName", userName)); 124 124 CheckParameterUtil.ensureParameterNotNull(userinfo, "userinfo"); … … 192 192 String userName = CredentialsManager.getInstance().getUsername(); 193 193 if (isAnonymous()) { 194 if (userName != null && ! userName.trim().equals("")) {194 if (userName != null && !userName.trim().isEmpty()) { 195 195 setPartiallyIdentified(userName); 196 196 } … … 256 256 if (!(evt.getNewValue() instanceof StringSetting)) return; 257 257 String newValue = ((StringSetting) evt.getNewValue()).getValue(); 258 if (newValue == null || newValue.trim(). equals("")) {258 if (newValue == null || newValue.trim().isEmpty()) { 259 259 setAnonymous(); 260 260 } else if (isFullyIdentified()) { -
trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
r6084 r6087 604 604 String value = getComponent().getText().trim(); 605 605 try { 606 if (value. equals("")) {606 if (value.isEmpty()) { 607 607 tileIndex = 0; 608 608 } else { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java
r6084 r6087 462 462 case RELATION: msg = trn("{0} relation", "{0} relations", numPrimitives, numPrimitives); break; 463 463 } 464 text = text. equals("") ? msg : text + ", " + msg;464 text = text.isEmpty() ? msg : text + ", " + msg; 465 465 } 466 466 setText(text); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java
r6084 r6087 174 174 if (!cbTagRelations.isSelected()) 175 175 return null; 176 if (tfKey.getText().trim(). equals(""))176 if (tfKey.getText().trim().isEmpty()) 177 177 return null; 178 if (tfValue.getText().trim(). equals(""))178 if (tfValue.getText().trim().isEmpty()) 179 179 return null; 180 180 if (primitives == null || primitives.isEmpty()) -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java
r6084 r6087 48 48 protected void renderUploadComment(Changeset cs) { 49 49 String comment = cs.get("comment"); 50 if (comment == null || comment.trim(). equals("")) {50 if (comment == null || comment.trim().isEmpty()) { 51 51 setText(trc("changeset.upload-comment", "empty")); 52 52 setFont(UIManager.getFont("Table.font").deriveFont(Font.ITALIC)); … … 69 69 protected void renderUser(Changeset cs) { 70 70 User user = cs.getUser(); 71 if (user == null || user.getName().trim(). equals("")) {71 if (user == null || user.getName().trim().isEmpty()) { 72 72 setFont(UIManager.getFont("Table.font").deriveFont(Font.ITALIC)); 73 73 setText(tr("anonymous")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
r6084 r6087 184 184 protected void validate() { 185 185 String value = tfUrl.getText(); 186 if (value.trim(). equals("")) {186 if (value.trim().isEmpty()) { 187 187 feedbackNone(); 188 188 return; -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r6085 r6087 1049 1049 ); 1050 1050 1051 if (type != null && !type. equals("")) {1051 if (type != null && !type.isEmpty()) { 1052 1052 uris.add(new URI(String.format("%s%sRelation:%s", base, lang, type))); 1053 1053 uris.add(new URI(String.format("%sRelation:%s", base, type))); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r6084 r6087 340 340 // is not Java 1.5 341 341 //value = java.text.Normalizer.normalize(value, java.text.Normalizer.Form.NFC); 342 if (value. equals("")) {342 if (value.isEmpty()) { 343 343 value = null; // delete the key 344 344 } 345 345 String newkey = keys.getEditor().getItem().toString().trim(); 346 346 //newkey = java.text.Normalizer.normalize(newkey, java.text.Normalizer.Form.NFC); 347 if (newkey. equals("")) {347 if (newkey.isEmpty()) { 348 348 newkey = key; 349 349 value = null; // delete the key instead -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r6070 r6087 1573 1573 1574 1574 protected boolean isEmptyRole() { 1575 return tfRole.getText() == null || tfRole.getText().trim(). equals("");1575 return tfRole.getText() == null || tfRole.getText().trim().isEmpty(); 1576 1576 } 1577 1577 -
trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
r6084 r6087 202 202 ); 203 203 b.setArea(currentArea); 204 if (b.getName() != null && !b.getName(). equals("")) {204 if (b.getName() != null && !b.getName().isEmpty()) { 205 205 ((DefaultListModel)bookmarks.getModel()).addElement(b); 206 206 bookmarks.save(); -
trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
r5886 r6087 230 230 tfUserName.setText(username); 231 231 tfPassword.setText(password); 232 cbSaveCredentials.setSelected(!username. equals("") && ! password.equals(""));232 cbSaveCredentials.setSelected(!username.isEmpty() && !password.isEmpty()); 233 233 } 234 234 -
trunk/src/org/openstreetmap/josm/gui/io/FilenameCellEditor.java
r6084 r6087 115 115 @Override 116 116 public boolean stopCellEditing() { 117 if (tfFileName.getText() == null || tfFileName.getText().trim(). equals("")) {117 if (tfFileName.getText() == null || tfFileName.getText().trim().isEmpty()) { 118 118 value = null; 119 119 } else { -
trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
r6084 r6087 226 226 @Override 227 227 public boolean stopCellEditing() { 228 if (tfFilename.getText() == null || tfFilename.getText().trim(). equals("")) {228 if (tfFilename.getText() == null || tfFilename.getText().trim().isEmpty()) { 229 229 value = null; 230 230 } else { -
trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java
r6084 r6087 56 56 return; 57 57 58 if (comment. equals("")) {58 if (comment.isEmpty()) { 59 59 pnlTagEditor.getModel().delete("comment"); 60 60 return; -
trunk/src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java
r6084 r6087 183 183 @Override 184 184 public boolean isValid() { 185 return ! getComponent().getText().trim().equals("");185 return !getComponent().getText().trim().isEmpty(); 186 186 } 187 187 … … 203 203 @Override 204 204 public boolean isValid() { 205 return ! getComponent().getText().trim().equals("");205 return !getComponent().getText().trim().isEmpty(); 206 206 } 207 207 -
trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r6084 r6087 441 441 public void filter() { 442 442 String expr = tfFilter.getText().trim(); 443 if (expr. equals("")) {443 if (expr.isEmpty()) { 444 444 expr = null; 445 445 } -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r6084 r6087 1083 1083 @Override 1084 1084 public int compare(String o1, String o2) { 1085 if (o1. equals("") && o2.equals(""))1085 if (o1.isEmpty() && o2.isEmpty()) 1086 1086 return 0; 1087 if (o1. equals("")) return 1;1088 if (o2. equals("")) return -1;1087 if (o1.isEmpty()) return 1; 1088 if (o2.isEmpty()) return -1; 1089 1089 return o1.compareTo(o2); 1090 1090 } … … 1241 1241 1242 1242 while ((line = reader.readLine()) != null && !canceled) { 1243 if (line.trim(). equals("")) {1243 if (line.trim().isEmpty()) { 1244 1244 continue; // skip empty lines 1245 1245 } -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java
r6084 r6087 45 45 protected String formatPluginRemoteVersion(PluginInformation pi) { 46 46 StringBuilder sb = new StringBuilder(); 47 if (pi.version == null || pi.version.trim(). equals("")) {47 if (pi.version == null || pi.version.trim().isEmpty()) { 48 48 sb.append(tr("unknown")); 49 49 } else { … … 58 58 protected String formatPluginLocalVersion(PluginInformation pi) { 59 59 if (pi == null) return tr("unknown"); 60 if (pi.localversion == null || pi.localversion.trim(). equals(""))60 if (pi.localversion == null || pi.localversion.trim().isEmpty()) 61 61 return tr("unknown"); 62 62 return pi.localversion; -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
r6084 r6087 198 198 protected void updateEnabledState() { 199 199 boolean enabled = 200 !tfOsmServerUrl.getText().trim(). equals("")200 !tfOsmServerUrl.getText().trim().isEmpty() 201 201 && !tfOsmServerUrl.getText().trim().equals(lastTestedUrl); 202 202 if (enabled) { … … 236 236 @Override 237 237 public boolean isValid() { 238 if (getComponent().getText().trim(). equals(""))238 if (getComponent().getText().trim().isEmpty()) 239 239 return false; 240 240 … … 249 249 @Override 250 250 public void validate() { 251 if (getComponent().getText().trim(). equals("")) {251 if (getComponent().getText().trim().isEmpty()) { 252 252 feedbackInvalid(tr("OSM API URL must not be empty. Please enter the OSM API URL.")); 253 253 return; -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r6064 r6087 149 149 case 1: 150 150 String v = (String)value; 151 if (tag.getValueCount() > 1 && ! v.equals("")) {151 if (tag.getValueCount() > 1 && !v.isEmpty()) { 152 152 updateTagValue(tag, v); 153 153 } else if (tag.getValueCount() <= 1) { … … 430 430 // tag name holds an empty key. Don't apply it to the selection. 431 431 // 432 if (tag.getName().trim(). equals("") || tag.getValue().trim().equals("")) {432 if (tag.getName().trim().isEmpty() || tag.getValue().trim().isEmpty()) { 433 433 continue; 434 434 } … … 476 476 // tag name holds an empty key. Don't apply it to the selection. 477 477 // 478 if (tag.getName().trim(). equals(""))478 if (tag.getName().trim().isEmpty()) 479 479 return null; 480 480 … … 517 517 ArrayList<String> keys = new ArrayList<String>(); 518 518 for (TagModel tag: tags) { 519 if (!tag.getName().trim(). equals("")) {519 if (!tag.getName().trim().isEmpty()) { 520 520 keys.add(tag.getName()); 521 521 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r6074 r6087 97 97 return "<b>"+DIFFERENT.replaceAll("<", "<").replaceAll(">", ">")+"</b>"; 98 98 99 if (value. equals(""))99 if (value.isEmpty()) 100 100 return " "; 101 101 … … 117 117 118 118 private Integer parseInteger(String str) { 119 if (str == null || "".equals(str))119 if (str == null || str.isEmpty()) 120 120 return null; 121 121 try { -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
r6084 r6087 150 150 @Override 151 151 public void keyReleased(KeyEvent e) { 152 if (getText(). equals("")) {152 if (getText().isEmpty()) { 153 153 applyFilter(""); 154 154 } -
trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
r5366 r6087 302 302 public static class ChangesetQueryUrlParser { 303 303 protected int parseUid(String value) throws ChangesetQueryUrlException { 304 if (value == null || value.trim(). equals(""))304 if (value == null || value.trim().isEmpty()) 305 305 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "uid",value)); 306 306 int id; … … 316 316 317 317 protected boolean parseOpen(String value) throws ChangesetQueryUrlException { 318 if (value == null || value.trim(). equals(""))318 if (value == null || value.trim().isEmpty()) 319 319 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", "open",value)); 320 320 if (value.equals("true")) … … 327 327 328 328 protected boolean parseBoolean(String value, String parameter) throws ChangesetQueryUrlException { 329 if (value == null || value.trim(). equals(""))329 if (value == null || value.trim().isEmpty()) 330 330 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter,value)); 331 331 if (value.equals("true")) … … 338 338 339 339 protected Date parseDate(String value, String parameter) throws ChangesetQueryUrlException { 340 if (value == null || value.trim(). equals(""))340 if (value == null || value.trim().isEmpty()) 341 341 throw new ChangesetQueryUrlException(tr("Unexpected value for ''{0}'' in changeset query url, got {1}", parameter,value)); 342 342 if (value.endsWith("Z")) { … … 436 436 return new ChangesetQuery(); 437 437 query = query.trim(); 438 if (query. equals(""))438 if (query.isEmpty()) 439 439 return new ChangesetQuery(); 440 440 Map<String,String> queryParams = createMapFromQueryString(query); -
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r5266 r6087 108 108 String host = Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_HOST, null); 109 109 int port = parseProxyPortValue(ProxyPreferencesPanel.PROXY_HTTP_PORT, Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_PORT, null)); 110 if (host != null && ! host.trim().equals("") && port > 0) {110 if (host != null && !host.trim().isEmpty() && port > 0) { 111 111 httpProxySocketAddress = new InetSocketAddress(host,port); 112 112 } else { … … 120 120 host = Main.pref.get(ProxyPreferencesPanel.PROXY_SOCKS_HOST, null); 121 121 port = parseProxyPortValue(ProxyPreferencesPanel.PROXY_SOCKS_PORT, Main.pref.get(ProxyPreferencesPanel.PROXY_SOCKS_PORT, null)); 122 if (host != null && ! host.trim().equals("") && port > 0) {122 if (host != null && !host.trim().isEmpty() && port > 0) { 123 123 socksProxySocketAddress = new InetSocketAddress(host,port); 124 124 } else { -
trunk/src/org/openstreetmap/josm/io/NmeaReader.java
r5874 r6087 235 235 private boolean ParseNMEASentence(String s, NMEAParserState ps) { 236 236 try { 237 if (s. equals(""))237 if (s.isEmpty()) 238 238 throw new NullPointerException(); 239 239 … … 304 304 // Ignore heights that are not in meters for now 305 305 accu=e[GPGGA.HEIGHT.position]; 306 if(!accu. equals("")) {306 if(!accu.isEmpty()) { 307 307 Double.parseDouble(accu); 308 308 // if it throws it's malformed; this should only happen if the 309 309 // device sends nonstandard data. 310 if(!accu. equals("")) {310 if(!accu.isEmpty()) { // FIX ? same check 311 311 currentwp.attr.put("ele", accu); 312 312 } … … 316 316 accu=e[GPGGA.SATELLITE_COUNT.position]; 317 317 int sat = 0; 318 if(!accu. equals("")) {318 if(!accu.isEmpty()) { 319 319 sat = Integer.parseInt(accu); 320 320 currentwp.attr.put("sat", accu); … … 322 322 // h-dilution 323 323 accu=e[GPGGA.HDOP.position]; 324 if(!accu. equals("")) {324 if(!accu.isEmpty()) { 325 325 currentwp.attr.put("hdop", Float.parseFloat(accu)); 326 326 } 327 327 // fix 328 328 accu=e[GPGGA.QUALITY.position]; 329 if(!accu. equals("")) {329 if(!accu.isEmpty()) { 330 330 int fixtype = Integer.parseInt(accu); 331 331 switch(fixtype) { … … 353 353 // other values than (T)rue are ignored 354 354 accu = e[GPVTG.COURSE.position]; 355 if(!accu. equals("")) {355 if(!accu.isEmpty()) { 356 356 Double.parseDouble(accu); 357 357 currentwp.attr.put("course", accu); … … 362 362 if(accu.startsWith("K")) { 363 363 accu = e[GPVTG.SPEED_KMH.position]; 364 if(!accu. equals("")) {364 if(!accu.isEmpty()) { 365 365 double speed = Double.parseDouble(accu); 366 366 speed /= 3.6; // speed in m/s … … 371 371 // vdop 372 372 accu=e[GPGSA.VDOP.position]; 373 if(!accu. equals("")) {373 if(!accu.isEmpty()) { 374 374 currentwp.attr.put("vdop", Float.parseFloat(accu)); 375 375 } 376 376 // hdop 377 377 accu=e[GPGSA.HDOP.position]; 378 if(!accu. equals("")) {378 if(!accu.isEmpty()) { 379 379 currentwp.attr.put("hdop", Float.parseFloat(accu)); 380 380 } 381 381 // pdop 382 382 accu=e[GPGSA.PDOP.position]; 383 if(!accu. equals("")) {383 if(!accu.isEmpty()) { 384 384 currentwp.attr.put("pdop", Float.parseFloat(accu)); 385 385 } … … 412 412 // speed 413 413 accu = e[GPRMC.SPEED.position]; 414 if(!accu. equals("") && !currentwp.attr.containsKey("speed")) {414 if(!accu.isEmpty() && !currentwp.attr.containsKey("speed")) { 415 415 double speed = Double.parseDouble(accu); 416 416 speed *= 0.514444444; // to m/s … … 419 419 // course 420 420 accu = e[GPRMC.COURSE.position]; 421 if(!accu. equals("") && !currentwp.attr.containsKey("course")) {421 if(!accu.isEmpty() && !currentwp.attr.containsKey("course")) { 422 422 Double.parseDouble(accu); 423 423 currentwp.attr.put("course", accu); … … 464 464 // return a zero latlon instead of null so it is logged as zero coordinate 465 465 // instead of malformed sentence 466 if(widthNorth. equals("")&&lengthEast.equals("")) return new LatLon(0.0,0.0);466 if(widthNorth.isEmpty() && lengthEast.isEmpty()) return new LatLon(0.0,0.0); 467 467 468 468 // The format is xxDDLL.LLLL -
trunk/src/org/openstreetmap/josm/io/OsmApiException.java
r6070 r6087 170 170 sb.append(tr(errorHeader)); 171 171 sb.append(tr("(Code={0})", responseCode)); 172 } else if (errorBody != null && !errorBody.trim(). equals("")) {172 } else if (errorBody != null && !errorBody.trim().isEmpty()) { 173 173 errorBody = errorBody.trim(); 174 174 sb.append(tr(errorBody)); -
trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java
r6070 r6087 45 45 * (noSuccessWithLastResponse == true). 46 46 */ 47 } else if (noSuccessWithLastResponse || username. equals("") || password.equals("")) {47 } else if (noSuccessWithLastResponse || username.isEmpty() || password.isEmpty()) { 48 48 GuiHelper.runInEDTAndWait(new Runnable() { 49 49 @Override -
trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java
r5926 r6087 47 47 this.info = layer.getInfo(); 48 48 this.baseURL = info.getUrl(); 49 if(layer.getInfo().getCookies() != null && !layer.getInfo().getCookies(). equals("")) {49 if(layer.getInfo().getCookies() != null && !layer.getInfo().getCookies().isEmpty()) { 50 50 props.put("Cookie", layer.getInfo().getCookies()); 51 51 } -
trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionImporter.java
r5684 r6087 33 33 XPathExpression fileExp = xpath.compile("file/text()"); 34 34 String fileStr = (String) fileExp.evaluate(elem, XPathConstants.STRING); 35 if (fileStr == null || fileStr. equals("")) {35 if (fileStr == null || fileStr.isEmpty()) { 36 36 throw new IllegalDataException(tr("File name expected for layer no. {0}", support.getLayerIndex())); 37 37 } -
trunk/src/org/openstreetmap/josm/io/session/MarkerSessionImporter.java
r6070 r6087 37 37 XPathExpression fileExp = xpath.compile("file/text()"); 38 38 String fileStr = (String) fileExp.evaluate(elem, XPathConstants.STRING); 39 if (fileStr == null || fileStr. equals("")) {39 if (fileStr == null || fileStr.isEmpty()) { 40 40 throw new IllegalDataException(tr("File name expected for layer no. {0}", support.getLayerIndex())); 41 41 } -
trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionImporter.java
r4815 r6087 34 34 XPathExpression fileExp = xpath.compile("file/text()"); 35 35 String fileStr = (String) fileExp.evaluate(elem, XPathConstants.STRING); 36 if (fileStr == null || fileStr. equals("")) {36 if (fileStr == null || fileStr.isEmpty()) { 37 37 throw new IllegalDataException(tr("File name expected for layer no. {0}", support.getLayerIndex())); 38 38 } -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r6084 r6087 1183 1183 PluginInformation pi = pp.getPluginInformation(); 1184 1184 pl.remove(pi.name); 1185 pl.add(pi.name + " (" + (pi.localversion != null && !pi.localversion. equals("")1185 pl.add(pi.name + " (" + (pi.localversion != null && !pi.localversion.isEmpty() 1186 1186 ? pi.localversion : "unknown") + ")"); 1187 1187 } … … 1198 1198 final PluginInformation info = p.getPluginInformation(); 1199 1199 String name = info.name 1200 + (info.version != null && !info.version. equals("") ? " Version: " + info.version : "");1200 + (info.version != null && !info.version.isEmpty() ? " Version: " + info.version : ""); 1201 1201 pluginTab.add(new JLabel(name), GBC.std()); 1202 1202 pluginTab.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL)); -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r6070 r6087 429 429 public static String explainGeneric(Exception e) { 430 430 String msg = e.getMessage(); 431 if (msg == null || msg.trim(). equals("")) {431 if (msg == null || msg.trim().isEmpty()) { 432 432 msg = e.toString(); 433 433 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r6084 r6087 403 403 if (subdir == null) { 404 404 subdir = ""; 405 } else if (!subdir. equals("")) {405 } else if (!subdir.isEmpty()) { 406 406 subdir += "/"; 407 407 } -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r6070 r6087 163 163 protected void initFromPreferences(String preferenceKey) throws WindowGeometryException { 164 164 String value = Main.pref.get(preferenceKey); 165 if (value == null || value. equals(""))165 if (value == null || value.isEmpty()) 166 166 throw new WindowGeometryException(tr("Preference with key ''{0}'' does not exist. Cannot restore window geometry from preferences.", preferenceKey)); 167 167 topLeft = new Point();
Note:
See TracChangeset
for help on using the changeset viewer.