Changeset 8461 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2015-06-03T14:05:30+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r8449 r8461 178 178 public static int askForOption(String text, String opts) { 179 179 Integer answer; 180 if ( opts.length()>0) {180 if (!opts.isEmpty()) { 181 181 String[] options = opts.split(";"); 182 182 answer = JOptionPane.showOptionDialog(Main.parent, text, "Question", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, 0); … … 189 189 public static String askForText(String text) { 190 190 String s = JOptionPane.showInputDialog(Main.parent, text, tr("Enter text"), JOptionPane.QUESTION_MESSAGE); 191 if (s!=null && (s=s.trim()).length()>0) {191 if (s!=null && !(s=s.trim()).isEmpty()) { 192 192 return s; 193 193 } else { … … 558 558 PreferencesUtils.showPrefs(tmpPref); 559 559 560 if ( id.length()>0) {560 if (!id.isEmpty()) { 561 561 try { 562 562 String fragmentVar = "API.fragments['"+id+"']"; … … 621 621 String text = evalVars(elem.getAttribute("text")); 622 622 String locText = evalVars(elem.getAttribute(LanguageInfo.getJOSMLocaleCode()+".text")); 623 if (locText!=null && locText.length()>0) text=locText;623 if (locText!=null && !locText.isEmpty()) text=locText; 624 624 625 625 String type = evalVars(elem.getAttribute("type")); … … 630 630 String text = evalVars(elem.getAttribute("text")); 631 631 String locText = evalVars(elem.getAttribute(LanguageInfo.getJOSMLocaleCode()+".text")); 632 if ( locText.length()>0) text=locText;632 if (!locText.isEmpty()) text=locText; 633 633 String var = elem.getAttribute("var"); 634 634 if (var.isEmpty()) var="result"; … … 640 640 String opts = evalVars(elem.getAttribute("options")); 641 641 String locOpts = evalVars(elem.getAttribute(LanguageInfo.getJOSMLocaleCode()+".options")); 642 if ( locOpts.length()>0) opts=locOpts;642 if (!locOpts.isEmpty()) opts=locOpts; 643 643 setVar(var, String.valueOf(askForOption(text, opts))); 644 644 } -
trunk/src/org/openstreetmap/josm/data/validation/routines/InetAddressValidator.java
r7937 r8461 74 74 for (int i = 0; i <= 3; i++) { 75 75 String ipSegment = groups[i]; 76 if (ipSegment == null || ipSegment. length() <= 0) {76 if (ipSegment == null || ipSegment.isEmpty()) { 77 77 return false; 78 78 } -
trunk/src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java
r7937 r8461 405 405 406 406 String extra = authorityMatcher.group(PARSE_AUTHORITY_EXTRA); 407 if (extra != null && extra.trim().length() > 0){407 if (extra != null && !extra.trim().isEmpty()){ 408 408 return false; 409 409 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r8401 r8461 301 301 })); 302 302 303 if ( key.length() > 0) {303 if (!key.isEmpty()) { 304 304 String s = marktr("Role {0} unknown in templates {1}"); 305 305 -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r8444 r8461 177 177 boolean isFirstLine = true; 178 178 String line; 179 while ((line = reader.readLine()) != null && (tagcheckerfile || line.length() != 0)) {179 while ((line = reader.readLine()) != null && (tagcheckerfile || !line.isEmpty())) { 180 180 if (line.startsWith("#")) { 181 181 if (line.startsWith("# JOSM TagChecker")) { … … 218 218 } 219 219 } else if (tagcheckerfile) { 220 if ( line.length() > 0) {220 if (!line.isEmpty()) { 221 221 CheckerData d = new CheckerData(); 222 222 String err = d.getData(line); … … 247 247 } 248 248 249 if ( errorSources.length() > 0)249 if (!errorSources.isEmpty()) 250 250 throw new IOException(tr("Could not access data file(s):\n{0}", errorSources)); 251 251 } … … 382 382 withErrors.put(p, "HTML"); 383 383 } 384 if (checkValues && key != null && value != null && value.length() > 0&& presetsValueData != null) {384 if (checkValues && key != null && value != null && !value.isEmpty() && presetsValueData != null) { 385 385 final Set<String> values = presetsValueData.get(key); 386 386 final boolean keyInPresets = values != null; … … 440 440 } 441 441 } 442 if (checkFixmes && key != null && value != null && value.length() > 0) {442 if (checkFixmes && key != null && value != null && !value.isEmpty()) { 443 443 if ((value.toLowerCase(Locale.ENGLISH).contains("fixme") 444 444 || value.contains("check and delete")
Note:
See TracChangeset
for help on using the changeset viewer.