- Timestamp:
- 2021-04-14T21:29:47+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r16866 r17787 87 87 88 88 } else if (GpxUrlPattern.TRACKPOINTS_BBOX.matches(url)) { 89 String[] table = url.split(" \\?|=|&", -1);89 String[] table = url.split("[?=&]", -1); 90 90 for (int i = 0; i < table.length; i++) { 91 91 if ("bbox".equals(table[i]) && i < table.length-1) -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java
r16630 r17787 23 23 public class DownloadSessionTask extends AbstractDownloadTask<Object> { 24 24 25 private static final String PATTERN_SESSION = "https?://.*/.*\\.jo( s|z)";25 private static final String PATTERN_SESSION = "https?://.*/.*\\.jo([sz])"; 26 26 27 27 private Loader loader; -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r17670 r17787 442 442 443 443 try (PreferencesWriter writer = new PreferencesWriter( 444 new PrintWriter( new File(prefFile + "_tmp"), StandardCharsets.UTF_8.name()), false, defaults)) {444 new PrintWriter(prefFile + "_tmp", StandardCharsets.UTF_8.name()), false, defaults)) { 445 445 writer.write(settings); 446 446 } catch (SecurityException e) { -
trunk/src/org/openstreetmap/josm/data/coor/conversion/LatLonParser.java
r13602 r17787 43 43 + "('|"+MIN+"|min)|" // (4) 44 44 + "(\"|"+SEC+"|sec)|" // (5) 45 + "( ,|;)|"// (6)45 + "([,;])|" // (6) 46 46 + "([NSEW"+N_TR+S_TR+E_TR+W_TR+"])|"// (7) 47 47 + "\\s+|" -
trunk/src/org/openstreetmap/josm/data/osm/Storage.java
r16630 r17787 232 232 modCount++; 233 233 size = 0; 234 for (int i = 0; i < data.length; i++) { 235 data[i] = null; 236 } 234 Arrays.fill(data, null); 237 235 } 238 236 -
trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
r17786 r17787 732 732 String v1 = Normalizer.normalize(caseSensitive ? mv : mv.toLowerCase(Locale.ENGLISH), Normalizer.Form.NFC); 733 733 String v2 = Normalizer.normalize(caseSensitive ? value : value.toLowerCase(Locale.ENGLISH), Normalizer.Form.NFC); 734 return v1. indexOf(v2) != -1;734 return v1.contains(v2); 735 735 } 736 736 } … … 1072 1072 value = Normalizer.normalize(value, Normalizer.Form.NFC); 1073 1073 1074 if (key. indexOf(search) != -1 || value.indexOf(search) != -1)1074 if (key.contains(search) || value.contains(search)) 1075 1075 return true; 1076 1076 } -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r17349 r17787 364 364 public static JTree buildJTreeList() { 365 365 DefaultMutableTreeNode root = new DefaultMutableTreeNode(tr("Ignore list")); 366 final Pattern elemId1Pattern = Pattern.compile(":( r|w|n)_");366 final Pattern elemId1Pattern = Pattern.compile(":([rwn])_"); 367 367 final Pattern elemId2Pattern = Pattern.compile("^[0-9]+$"); 368 368 for (Entry<String, String> e: ignoredErrors.entrySet()) { … … 464 464 String item = child.getUserObject().toString(); 465 465 String entry = null; 466 if (item.matches("^\\[( r|w|n)_.*")) {466 if (item.matches("^\\[([rwn])_.*")) { 467 467 // list of elements (produced with list.toString() method) 468 468 entry = key + ":" + item.substring(1, item.lastIndexOf(']')).replace(", ", ":"); 469 } else if (item.matches("^( r|w|n)_.*")) {469 } else if (item.matches("^([rwn])_.*")) { 470 470 // single element 471 471 entry = key + ":" + item; -
trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
r16829 r17787 269 269 */ 270 270 static List<String> expandHouseNumber(String houseNumber) { 271 return Arrays.asList(houseNumber.split(" ,|;", -1));271 return Arrays.asList(houseNumber.split("[,;]", -1)); 272 272 } 273 273 -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/HeadersTable.java
r16953 r17787 5 5 6 6 import java.awt.GridBagLayout; 7 import java.util.Comparator;8 7 import java.util.List; 9 8 import java.util.Map; … … 107 106 108 107 private static List<String[]> getHeadersAsVector(Map<String, String> headers) { 109 return headers.entrySet().stream().sorted( Comparator.comparing(Map.Entry::getKey))108 return headers.entrySet().stream().sorted(Map.Entry.comparingByKey()) 110 109 .map(e -> new String[] {e.getKey(), e.getValue()}).collect(Collectors.toList()); 111 110 } -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r17768 r17787 107 107 } 108 108 } 109 KeyboardUtils.getExtendedKeyCodes(InputContext.getInstance().getLocale()) .entrySet()110 .forEach(e -> list.put(e.getKey(), e.getValue().toString()));109 KeyboardUtils.getExtendedKeyCodes(InputContext.getInstance().getLocale()) 110 .forEach((key, value) -> list.put(key, value.toString())); 111 111 list.put(Integer.valueOf(-1), ""); 112 112 return list; -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java
r17651 r17787 89 89 return TYPE_CACHE.get(types); 90 90 Set<TaggingPresetType> result = EnumSet.noneOf(TaggingPresetType.class); 91 for (String type : Arrays.asList(types.split(",", -1))) {91 for (String type : types.split(",", -1)) { 92 92 try { 93 93 TaggingPresetType presetType = TaggingPresetType.fromString(type); -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r16841 r17787 353 353 ZipEntry entry = entries.nextElement(); 354 354 // choose any file with correct extension. When more than one file, prefer the one which matches namepart 355 if (entry.getName().endsWith('.' + extension) && (resentry == null || entry.getName(). indexOf(namepart) >= 0)) {355 if (entry.getName().endsWith('.' + extension) && (resentry == null || entry.getName().contains(namepart))) { 356 356 resentry = entry; 357 357 } -
trunk/src/org/openstreetmap/josm/io/GpxWriter.java
r17725 r17787 12 12 import java.util.ArrayList; 13 13 import java.util.Collection; 14 import java.util.Comparator;15 14 import java.util.Date; 16 15 import java.util.List; … … 98 97 data.getLayerPrefs().entrySet() 99 98 .stream() 100 .sorted( Comparator.comparing(Map.Entry::getKey))99 .sorted(Map.Entry.comparingByKey()) 101 100 .forEach(entry -> { 102 101 GpxExtension e = layerExts.add("josm", "entry"); -
trunk/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java
r12620 r17787 4 4 import java.io.IOException; 5 5 import java.io.Reader; 6 import java.util.Arrays; 6 7 7 8 import org.openstreetmap.josm.tools.Logging; … … 28 29 static { 29 30 INVALID_CHARS = new boolean[0x20]; 30 for (int i = 0; i < INVALID_CHARS.length; ++i) { 31 INVALID_CHARS[i] = true; 32 } 31 Arrays.fill(INVALID_CHARS, true); 33 32 INVALID_CHARS[0x9] = false; // tab 34 33 INVALID_CHARS[0xA] = false; // LF -
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r17760 r17787 319 319 } 320 320 321 protected static final Comparator<Entry<String, String>> byKeyComparator = Comparator.comparing(Entry::getKey);321 protected static final Comparator<Entry<String, String>> byKeyComparator = Entry.comparingByKey(); 322 322 323 323 protected void addTags(Tagged osm, String tagname, boolean tagOpen) { -
trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java
r17333 r17787 271 271 } 272 272 if (javaDur) { 273 d = Duration.parse(javaPer ? 'P' + duration.substring(idx , duration.length()) : duration);273 d = Duration.parse(javaPer ? 'P' + duration.substring(idx) : duration); 274 274 } else if (!javaPer) { 275 275 d = Duration.parse(duration); -
trunk/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java
r17786 r17787 78 78 Collection<WayPoint> waypoints = new ArrayList<>(); 79 79 try (BufferedReader rd = new BufferedReader(new InputStreamReader(source, StandardCharsets.UTF_8))) { 80 String line = null;80 String line; 81 81 do { 82 82 line = rd.readLine(); -
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r16873 r17787 66 66 } 67 67 } 68 if ("nb".equals(code)) { /* OSM-Wiki has "no", but no "nb" */ 69 return "No:"; 70 } else if ("sr@latin".equals(code)) { /* OSM-Wiki has "Sr-latn" and not Sr-latin */ 71 return "Sr-latn:"; 72 } else if ("de".equals(code) || "es".equals(code) || "fr".equals(code) 73 || "it".equals(code) || "nl".equals(code) || "ru".equals(code) 74 || "ja".equals(code)) { 75 return code.toUpperCase(Locale.ENGLISH) + ":"; 76 } else { 77 return code.substring(0, 1).toUpperCase(Locale.ENGLISH) + code.substring(1) + ":"; 68 switch (code) { 69 case "nb": /* OSM-Wiki has "no", but no "nb" */ 70 return "No:"; 71 case "sr@latin": /* OSM-Wiki has "Sr-latn" and not Sr-latin */ 72 return "Sr-latn:"; 73 case "de": 74 case "es": 75 case "fr": 76 case "it": 77 case "nl": 78 case "ru": 79 case "ja": 80 return code.toUpperCase(Locale.ENGLISH) + ":"; 81 default: 82 return code.substring(0, 1).toUpperCase(Locale.ENGLISH) + code.substring(1) + ":"; 78 83 } 79 84 } … … 160 165 public static String getJavaLocaleCode(String localeName) { 161 166 if (localeName == null) return "en"; 162 if ("ca@valencia".equals(localeName)) { 163 localeName = "ca__valencia"; 164 } else if ("sr@latin".equals(localeName)) { 165 localeName = "sr__latin"; 166 } else if ("he".equals(localeName)) { 167 localeName = "iw_IL"; 168 } else if ("id".equals(localeName)) { 169 localeName = "in"; 167 switch (localeName) { 168 case "ca@valencia": 169 return "ca__valencia"; 170 case "sr@latin": 171 return "sr__latin"; 172 case "he": 173 return "iw_IL"; 174 case "id": 175 return "in"; 170 176 } 171 177 return localeName;
Note:
See TracChangeset
for help on using the changeset viewer.