Changeset 16643 in josm
- Timestamp:
- 2020-06-14T20:19:59+02:00 (4 years ago)
- Location:
- trunk
- Files:
-
- 72 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build.xml
r16632 r16643 302 302 <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 --> 303 303 <compilerarg value="-XDignore.symbol.file"/> 304 <compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:FutureReturnValueIgnored:OFF -Xep: StringSplitter:OFF -Xep:JdkObsolete:OFF -Xep:EqualsGetClass:OFF -Xep:UndefinedEquals:OFF -Xep:BadImport:OFF -Xep:AnnotateFormatMethod:OFF"/>304 <compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsGetClass:OFF -Xep:UndefinedEquals:OFF -Xep:BadImport:OFF -Xep:AnnotateFormatMethod:OFF"/> 305 305 <compilerarg line="-Xmaxwarns 1000"/> 306 306 <classpath> -
trunk/src/com/kitfox/svg/Text.java
r14346 r16643 268 268 { 269 269 //Get font 270 String[] families = fontFamily.split("," );270 String[] families = fontFamily.split(",", -1); 271 271 Font font = null; 272 272 for (int i = 0; i < families.length; ++i) -
trunk/src/com/kitfox/svg/util/FontSystem.java
r14331 r16643 78 78 public static FontSystem createFont(String fontFamily, int fontStyle, int fontWeight, int fontSize) 79 79 { 80 String[] families = fontFamily.split("," );80 String[] families = fontFamily.split(",", -1); 81 81 for (String fontName: families) 82 82 { -
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r16452 r16643 369 369 final Collection<String> extensionsPlusArchive = new LinkedHashSet<>(); 370 370 final Collection<String> extensionsForDescription = new LinkedHashSet<>(); 371 for (String e : extensions.split("," )) {371 for (String e : extensions.split(",", -1)) { 372 372 extensionsPlusArchive.add(e); 373 373 if (addArchiveExtension != AddArchiveExtension.NONE) { … … 420 420 */ 421 421 public boolean acceptName(String filename) { 422 return Utils.hasExtension(filename, extensions.split("," ));422 return Utils.hasExtension(filename, extensions.split(",", -1)); 423 423 } 424 424 -
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r16505 r16643 121 121 final List<String> cmd = new ArrayList<>(); 122 122 cmd.add("/usr/bin/osascript"); 123 for (String line : RESTART_APPLE_SCRIPT.split("\n" )) {123 for (String line : RESTART_APPLE_SCRIPT.split("\n", -1)) { 124 124 cmd.add("-e"); 125 125 cmd.add(line); … … 142 142 throw new IOException("Unable to retrieve sun.java.command property"); 143 143 } 144 String[] mainCommand = javaCommand.split(" " );144 String[] mainCommand = javaCommand.split(" ", -1); 145 145 if (javaCommand.endsWith(".jnlp") && jnlp == null) { 146 146 // see #11751 - jnlp on Linux -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r16438 r16643 86 86 87 87 } else if (GpxUrlPattern.TRACKPOINTS_BBOX.matches(url)) { 88 String[] table = url.split("\\?|=|&" );88 String[] table = url.split("\\?|=|&", -1); 89 89 for (int i = 0; i < table.length; i++) { 90 90 if ("bbox".equals(table[i]) && i < table.length-1) -
trunk/src/org/openstreetmap/josm/data/Bounds.java
r16553 r16643 251 251 public Bounds(String asString, String separator, ParseMethod parseMethod, boolean roundToOsmPrecision) { 252 252 CheckParameterUtil.ensureParameterNotNull(asString, "asString"); 253 String[] components = asString.split(separator );253 String[] components = asString.split(separator, -1); 254 254 if (components.length != 4) 255 255 throw new IllegalArgumentException( -
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r16553 r16643 451 451 String cacheControl = urlConn.getHeaderField("Cache-Control"); 452 452 if (cacheControl != null) { 453 for (String token: cacheControl.split("," )) {453 for (String token: cacheControl.split(",", -1)) { 454 454 try { 455 455 if (token.startsWith("max-age=")) { -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r16605 r16643 400 400 if (e.shapes != null) { 401 401 try { 402 for (String s : e.shapes.split(";" )) {402 for (String s : e.shapes.split(";", -1)) { 403 403 bounds.addShape(new Shape(s, ",")); 404 404 } … … 410 410 if (e.projections != null && !e.projections.isEmpty()) { 411 411 // split generates null element on empty string which gives one element Array[null] 412 setServerProjections(Arrays.asList(e.projections.split("," )));412 setServerProjections(Arrays.asList(e.projections.split(",", -1))); 413 413 } 414 414 attributionText = Utils.intern(e.attribution_text); … … 666 666 Matcher m = Pattern.compile(".*\\{PROJ\\(([^)}]+)\\)\\}.*").matcher(url.toUpperCase(Locale.ENGLISH)); 667 667 if (m.matches()) { 668 setServerProjections(Arrays.asList(m.group(1).split("," )));668 setServerProjections(Arrays.asList(m.group(1).split(",", -1))); 669 669 } 670 670 } -
trunk/src/org/openstreetmap/josm/data/imagery/Shape.java
r16436 r16643 29 29 public Shape(String asString, String separator) { 30 30 CheckParameterUtil.ensureParameterNotNull(asString, "asString"); 31 String[] components = asString.split(separator );31 String[] components = asString.split(separator, -1); 32 32 if (components.length % 2 != 0) 33 33 throw new IllegalArgumentException(MessageFormat.format("Even number of doubles expected in string, got {0}: {1}", -
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r16553 r16643 746 746 747 747 private static <T> T parseCoor(String coor, boolean switchXY, BiFunction<String, String, T> function) { 748 String[] parts = coor.split(" " );748 String[] parts = coor.split(" ", -1); 749 749 if (switchXY) { 750 750 return function.apply(parts[1], parts[0]); -
trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
r15735 r16643 698 698 Map<String, Collection<String>> originalSplitValues = new LinkedHashMap<>(); 699 699 for (String v : originalValues) { 700 List<String> vs = Arrays.asList(SPLIT_VALUES_PATTERN.split(v ));700 List<String> vs = Arrays.asList(SPLIT_VALUES_PATTERN.split(v, -1)); 701 701 originalSplitValues.put(v, vs); 702 702 values.addAll(vs); -
trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
r16581 r16643 190 190 // add leading/trailing space in order to get expected split (e.g. "a--" => {"a", ""}) 191 191 String rangeS = ' ' + tokenizer.readTextOrNumber() + ' '; 192 String[] rangeA = rangeS.split("/" );192 String[] rangeA = rangeS.split("/", -1); 193 193 if (rangeA.length == 1) { 194 194 return new KeyValue(keyword, rangeS.trim(), regexSearch, caseSensitive); -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r16626 r16643 358 358 359 359 Pattern keyPattern = Pattern.compile("\\+(?<key>[a-zA-Z0-9_]+)(=(?<value>.*))?"); 360 String[] parts = Utils.WHITE_SPACES_PATTERN.split(trimmedPref );360 String[] parts = Utils.WHITE_SPACES_PATTERN.split(trimmedPref, -1); 361 361 for (String part : parts) { 362 362 Matcher m = keyPattern.matcher(part); … … 511 511 */ 512 512 public Datum parseToWGS84(String paramList, Ellipsoid ellps) throws ProjectionConfigurationException { 513 String[] numStr = paramList.split("," );513 String[] numStr = paramList.split(",", -1); 514 514 515 515 if (numStr.length != 3 && numStr.length != 7) … … 621 621 */ 622 622 public static Bounds parseBounds(String boundsStr) throws ProjectionConfigurationException { 623 String[] numStr = boundsStr.split("," );623 String[] numStr = boundsStr.split(",", -1); 624 624 if (numStr.length != 4) 625 625 throw new ProjectionConfigurationException(tr("Unexpected number of arguments for parameter ''+bounds'' (must be 4)")); -
trunk/src/org/openstreetmap/josm/data/projection/ProjectionCLI.java
r15716 r16643 166 166 167 167 private EastNorth parseEastNorth(String s, ToDoubleFunction<String> parser) { 168 String[] en = s.split("[;, ]+" );168 String[] en = s.split("[;, ]+", -1); 169 169 if (en.length != 2) 170 170 throw new IllegalArgumentException(tr("Expected two coordinates, separated by white space, found {0} in ''{1}''", en.length, s)); -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r16447 r16643 371 371 372 372 ArrayList<String> ignoredElementList = new ArrayList<>(); 373 String[] osmobjects = elemId1Pattern.split(key );373 String[] osmobjects = elemId1Pattern.split(key, -1); 374 374 for (int i = 1; i < osmobjects.length; i++) { 375 375 String osmid = osmobjects[i]; -
trunk/src/org/openstreetmap/josm/data/validation/routines/InetAddressValidator.java
r13206 r16643 137 137 return false; 138 138 } 139 String[] octets = inet6Address.split(":" );139 String[] octets = inet6Address.split(":", -1); 140 140 if (containsCompressedZeroes) { 141 141 List<String> octetList = new ArrayList<>(Arrays.asList(octets)); -
trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
r16628 r16643 268 268 */ 269 269 static List<String> expandHouseNumber(String houseNumber) { 270 return Arrays.asList(houseNumber.split(",|;" ));270 return Arrays.asList(houseNumber.split(",|;", -1)); 271 271 } 272 272 -
trunk/src/org/openstreetmap/josm/data/validation/tests/ConditionalKeys.java
r16154 r16643 106 106 return false; 107 107 } 108 final String[] parts = key.replace(":conditional", "").split(":" );108 final String[] parts = key.replace(":conditional", "").split(":", -1); 109 109 return isKeyValid3Parts(parts) || isKeyValid1Part(parts) || isKeyValid2Parts(parts); 110 110 } … … 178 178 while (i + 1 <= m.groupCount() && m.group(i + 1) != null) { 179 179 final String restrictionValue = m.group(i); 180 final String[] conditions = m.group(i + 1).replace("(", "").replace(")", "").split("\\s+(AND|and)\\s+" );180 final String[] conditions = m.group(i + 1).replace("(", "").replace(")", "").split("\\s+(AND|and)\\s+", -1); 181 181 r.add(new ConditionalValue(restrictionValue, Arrays.asList(conditions))); 182 182 i += 3; … … 197 197 for (final ConditionalValue conditional : ConditionalValue.parse(value)) { 198 198 // validate restriction value 199 if (isTransportationMode(key.split(":" )[0]) && !isRestrictionValue(conditional.restrictionValue)) {199 if (isTransportationMode(key.split(":", -1)[0]) && !isRestrictionValue(conditional.restrictionValue)) { 200 200 return tr("{0} is not a valid restriction value", conditional.restrictionValue); 201 201 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/ConnectivityRelations.java
r16630 r16643 93 93 } 94 94 Map<Integer, Boolean> connections = new HashMap<>(); 95 String[] toLanes = TO_LANE_PATTERN.split(lane[1] );95 String[] toLanes = TO_LANE_PATTERN.split(lane[1], -1); 96 96 for (int j = 0; j < toLanes.length; j++) { 97 97 String toLane = toLanes[j].trim(); -
trunk/src/org/openstreetmap/josm/data/validation/tests/InternetTags.java
r16337 r16643 96 96 List<TestError> errors = new ArrayList<>(); 97 97 String values = v != null ? v : p.get(k); 98 for (String value : values.split(";" )) {98 for (String value : values.split(";", -1)) { 99 99 if (!validator.isValid(value)) { 100 100 Supplier<Command> fix = null; -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerAsserts.java
r16172 r16643 139 139 .map(e -> ((LiteralExpression) e).getLiteral()) 140 140 .filter(l -> l instanceof String) 141 .map(l -> ((String) l).split("," )[0])141 .map(l -> ((String) l).split(",", -1)[0]) 142 142 .findFirst(); 143 143 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java
r16198 r16643 102 102 Check if this is the case. */ 103 103 104 String[] splitNames = NAME_SPLIT_PATTERN.split(name );104 String[] splitNames = NAME_SPLIT_PATTERN.split(name, -1); 105 105 if (splitNames.length == 1) { 106 106 /* The name is not composed of multiple parts. Complain. */ -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r16623 r16643 1150 1150 private static void processOffline(ProgramArguments args) { 1151 1151 for (String offlineNames : args.get(Option.OFFLINE)) { 1152 for (String s : offlineNames.split("," )) {1152 for (String s : offlineNames.split(",", -1)) { 1153 1153 try { 1154 1154 NetworkManager.setOffline(OnlineResource.valueOf(s.toUpperCase(Locale.ENGLISH))); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtil.java
r16438 r16643 298 298 Set<String> results = instantiateSortedSet(); 299 299 for (String value: values) { 300 for (String part: value.split(Pattern.quote(separator) )) {300 for (String part: value.split(Pattern.quote(separator), -1)) { 301 301 results.add(part); 302 302 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r15716 r16643 362 362 */ 363 363 public static EastNorth parseEastNorth(String s) { 364 String[] en = s.split("[;, ]+" );364 String[] en = s.split("[;, ]+", -1); 365 365 if (en.length != 2) return null; 366 366 try { -
trunk/src/org/openstreetmap/josm/gui/io/ChangesetCommentModel.java
r13994 r16643 46 46 */ 47 47 public List<String> findHashTags() { 48 return Arrays.stream(comment.split("\\s" ))48 return Arrays.stream(comment.split("\\s", -1)) 49 49 .map(s -> Utils.strip(s, ",;")) 50 50 .filter(s -> s.matches("#[a-zA-Z][a-zA-Z_\\-0-9]+")) -
trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java
r16438 r16643 170 170 if (!opts.isEmpty()) { 171 171 return JOptionPane.showOptionDialog(MainApplication.getMainFrame(), text, "Question", 172 JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, opts.split(";" ), 0);172 JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, opts.split(";", -1), 0); 173 173 } else { 174 174 return JOptionPane.showOptionDialog(MainApplication.getMainFrame(), text, "Question", … … 298 298 final List<String> removeList = new ArrayList<>(); 299 299 final List<String> deleteList = new ArrayList<>(); 300 Collections.addAll(installList, install.toLowerCase(Locale.ENGLISH).split(";" ));301 Collections.addAll(removeList, uninstall.toLowerCase(Locale.ENGLISH).split(";" ));302 Collections.addAll(deleteList, delete.toLowerCase(Locale.ENGLISH).split(";" ));300 Collections.addAll(installList, install.toLowerCase(Locale.ENGLISH).split(";", -1)); 301 Collections.addAll(removeList, uninstall.toLowerCase(Locale.ENGLISH).split(";", -1)); 302 Collections.addAll(deleteList, delete.toLowerCase(Locale.ENGLISH).split(";", -1)); 303 303 installList.remove(""); 304 304 removeList.remove(""); -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r16628 r16643 1128 1128 StringBuilder line = new StringBuilder(); 1129 1129 StringBuilder ret = new StringBuilder(); 1130 for (String s: text.split(" " )) {1130 for (String s: text.split(" ", -1)) { 1131 1131 if (g.getFontMetrics().stringWidth(line.toString() + s) > tileSource.getTileSize()) { 1132 1132 ret.append(line).append('\n'); … … 1139 1139 } 1140 1140 int offset = 0; 1141 for (String s: textToDraw.split("\n" )) {1141 for (String s: textToDraw.split("\n", -1)) { 1142 1142 g.setColor(Color.black); 1143 1143 g.drawString(s, x + 1, y + offset + 1); … … 1632 1632 if (tileLoader instanceof TMSCachedTileLoader) { 1633 1633 int offset = 200; 1634 for (String part: ((TMSCachedTileLoader) tileLoader).getStats().split("\n" )) {1634 for (String part: ((TMSCachedTileLoader) tileLoader).getStats().split("\n", -1)) { 1635 1635 offset += 15; 1636 1636 myDrawString(g, tr("Cache stats: {0}", part), 50, offset); -
trunk/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java
r16548 r16643 392 392 String jvmId = reader.readLine(); 393 393 if (jvmId != null) { 394 String pid = jvmId.split("@" )[0];394 String pid = jvmId.split("@", -1)[0]; 395 395 skipFile = jvmPerfDataFileExists(pid); 396 396 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r16553 r16643 797 797 .orElse(k); 798 798 if (k.startsWith("extension")) { 799 String[] chain = k.split(":" );799 String[] chain = k.split(":", -1); 800 800 if (chain.length >= 3 && "segment".equals(chain[2])) { 801 801 segExts.addFlat(chain, v); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r16069 r16643 1017 1017 1018 1018 // use comma as separator 1019 String[] column = line.split("," );1019 String[] column = line.split(",", -1); 1020 1020 1021 1021 // empty or comment line -
trunk/src/org/openstreetmap/josm/gui/mappaint/RenderingCLI.java
r16321 r16643 286 286 break; 287 287 case ANCHOR: 288 String[] parts = arg.split("," );288 String[] parts = arg.split(",", -1); 289 289 if (parts.length != 2) 290 290 throw new OptionParseException( -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java
r16628 r16643 1159 1159 */ 1160 1160 public static boolean inside(Environment env, String codes) { // NO_UCD (unused code) 1161 return Arrays.stream(codes.toUpperCase(Locale.ENGLISH).split("," ))1161 return Arrays.stream(codes.toUpperCase(Locale.ENGLISH).split(",", -1)) 1162 1162 .anyMatch(code -> Territories.isIso3166Code(code.trim(), center(env))); 1163 1163 } -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r13207 r16643 198 198 199 199 for (String setCookie: setCookies) { 200 String[] kvPairs = setCookie.split(";" );200 String[] kvPairs = setCookie.split(";", -1); 201 201 if (kvPairs.length == 0) { 202 202 continue; … … 204 204 for (String kvPair : kvPairs) { 205 205 kvPair = kvPair.trim(); 206 String[] kv = kvPair.split("=" );206 String[] kv = kvPair.split("=", -1); 207 207 if (kv.length != 2) { 208 208 continue; -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r16438 r16643 511 511 512 512 private void activatePlugins(JTextArea textField, boolean deleteNotInList) { 513 String[] lines = textField.getText().split("\n" );513 String[] lines = textField.getText().split("\n", -1); 514 514 List<String> toActivate = new ArrayList<>(); 515 515 List<String> notFound = new ArrayList<>(); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java
r16179 r16643 87 87 return TYPE_CACHE.get(types); 88 88 Set<TaggingPresetType> result = EnumSet.noneOf(TaggingPresetType.class); 89 for (String type : Arrays.asList(types.split("," ))) {89 for (String type : Arrays.asList(types.split(",", -1))) { 90 90 try { 91 91 TaggingPresetType presetType = TaggingPresetType.fromString(type); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java
r16179 r16643 130 130 String locName = preset.getLocaleName(); 131 131 if (locName != null) { 132 Collections.addAll(collection, locName.toLowerCase(Locale.ENGLISH).split("\\s" ));132 Collections.addAll(collection, locName.toLowerCase(Locale.ENGLISH).split("\\s", -1)); 133 133 } 134 134 } … … 282 282 283 283 if (searchText.contains("/")) { 284 groupWords = searchText.substring(0, searchText.lastIndexOf('/')).split("[\\s/]" );285 nameWords = searchText.substring(searchText.indexOf('/') + 1).split("\\s" );284 groupWords = searchText.substring(0, searchText.lastIndexOf('/')).split("[\\s/]", -1); 285 nameWords = searchText.substring(searchText.indexOf('/') + 1).split("\\s", -1); 286 286 } else { 287 287 groupWords = null; 288 nameWords = searchText.split("\\s" );288 nameWords = searchText.split("\\s", -1); 289 289 } 290 290 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r16544 r16643 174 174 } else { 175 175 String s = o.toString(); 176 Set<String> parts = new TreeSet<>(Arrays.asList(s.split(String.valueOf(delimiter) )));176 Set<String> parts = new TreeSet<>(Arrays.asList(s.split(String.valueOf(delimiter), -1))); 177 177 ListModel<PresetListEntry> lm = getModel(); 178 178 int[] intParts = new int[lm.getSize()]; … … 440 440 441 441 if (values_from != null) { 442 String[] classMethod = values_from.split("#" );442 String[] classMethod = values_from.split("#", -1); 443 443 if (classMethod.length == 2) { 444 444 try { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
r16630 r16643 67 67 AutoCompletingTextField textField = new AutoCompletingTextField(); 68 68 if (alternative_autocomplete_keys != null) { 69 initAutoCompletionField(textField, (key + ',' + alternative_autocomplete_keys).split("," ));69 initAutoCompletionField(textField, (key + ',' + alternative_autocomplete_keys).split(",", -1)); 70 70 } else { 71 71 initAutoCompletionField(textField, key); … … 126 126 127 127 // first, one button for each auto_increment value 128 for (final String ai : auto_increment.split("," )) {128 for (final String ai : auto_increment.split(",", -1)) { 129 129 JToggleButton aibutton = new JToggleButton(ai); 130 130 aibutton.setToolTipText(tr("Select auto-increment of {0} for this field", ai)); -
trunk/src/org/openstreetmap/josm/gui/widgets/FilterField.java
r16438 r16643 87 87 expr = expr.replace("+", "\\+"); 88 88 // split search string on whitespace, do case-insensitive AND search 89 List<RowFilter<Object, Object>> andFilters = Arrays.stream(expr.split("\\s+" ))89 List<RowFilter<Object, Object>> andFilters = Arrays.stream(expr.split("\\s+", -1)) 90 90 .map(word -> RowFilter.regexFilter("(?i)" + word)) 91 91 .collect(Collectors.toList()); -
trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
r15716 r16643 480 480 481 481 protected Date[] parseTime(String value) throws ChangesetQueryUrlException { 482 String[] dates = value.split("," );482 String[] dates = value.split(",", -1); 483 483 if (dates.length == 0 || dates.length > 2) 484 484 throw new ChangesetQueryUrlException( … … 495 495 return Collections.<Long>emptySet(); 496 496 } else { 497 return Stream.of(value.split("," )).map(Long::valueOf).collect(Collectors.toSet());497 return Stream.of(value.split(",", -1)).map(Long::valueOf).collect(Collectors.toSet()); 498 498 } 499 499 } … … 560 560 protected Map<String, String> createMapFromQueryString(String query) { 561 561 Map<String, String> queryParams = new HashMap<>(); 562 String[] keyValuePairs = query.split("&" );562 String[] keyValuePairs = query.split("&", -1); 563 563 for (String keyValuePair: keyValuePairs) { 564 String[] kv = keyValuePair.split("=" );564 String[] kv = keyValuePair.split("=", -1); 565 565 queryParams.put(kv[0], kv.length > 1 ? kv[1] : ""); 566 566 } -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r16038 r16643 147 147 String schemaLocation = atts.getValue(GpxConstants.XML_URI_XSD, "schemaLocation"); 148 148 if (schemaLocation != null) { 149 String[] schemaLocations = schemaLocation.split(" " );149 String[] schemaLocations = schemaLocation.split(" ", -1); 150 150 for (int i = 0; i < schemaLocations.length - 1; i += 2) { 151 151 final String schemaURI = schemaLocations[i]; -
trunk/src/org/openstreetmap/josm/io/GpxWriter.java
r15736 r16643 197 197 // write the email address 198 198 if (attr.containsKey(META_AUTHOR_EMAIL)) { 199 String[] tmp = data.getString(META_AUTHOR_EMAIL).split("@" );199 String[] tmp = data.getString(META_AUTHOR_EMAIL).split("@", -1); 200 200 if (tmp.length == 2) { 201 201 inline("email", "id=\"" + encode(tmp[0]) + "\" domain=\"" + encode(tmp[1]) +'\"'); -
trunk/src/org/openstreetmap/josm/io/NameFinder.java
r16419 r16643 284 284 currentResult.lat = Double.parseDouble(atts.getValue("lat")); 285 285 currentResult.lon = Double.parseDouble(atts.getValue("lon")); 286 String[] bbox = atts.getValue("boundingbox").split("," );286 String[] bbox = atts.getValue("boundingbox").split(",", -1); 287 287 currentResult.bounds = new Bounds( 288 288 Double.parseDouble(bbox[0]), Double.parseDouble(bbox[2]), -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r13849 r16643 90 90 try { 91 91 String[] token = new String(Base64.getDecoder().decode(auth.substring(BASIC_AUTH.length())), 92 StandardCharsets.UTF_8).split(":" );92 StandardCharsets.UTF_8).split(":", -1); 93 93 if (token.length == 2) { 94 94 return token[0]; -
trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java
r16629 r16643 336 336 final String errorIndicator = "Error</strong>: "; 337 337 if (ex.getMessage() != null && ex.getMessage().contains(errorIndicator)) { 338 final String errorPlusRest = ex.getMessage().split(errorIndicator )[1];338 final String errorPlusRest = ex.getMessage().split(errorIndicator, -1)[1]; 339 339 if (errorPlusRest != null) { 340 ex.setErrorHeader(errorPlusRest.split("</" )[0].replaceAll(".*::request_read_and_idx::", ""));340 ex.setErrorHeader(errorPlusRest.split("</", -1)[0].replaceAll(".*::request_read_and_idx::", "")); 341 341 } 342 342 } -
trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java
r16436 r16643 313 313 // if there is no * or other meanities it will throw 314 314 // and result in a malformed packet. 315 String[] chkstrings = s.split("\\*" );315 String[] chkstrings = s.split("\\*", -1); 316 316 if (chkstrings.length > 1) { 317 317 byte[] chb = chkstrings[0].getBytes(StandardCharsets.UTF_8); … … 329 329 } 330 330 // now for the content 331 String[] e = chkstrings[0].split("," );331 String[] e = chkstrings[0].split(",", -1); 332 332 String accu; 333 333 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/FeaturesHandler.java
r16550 r16643 24 24 protected void handleRequest() throws RequestHandlerErrorException, RequestHandlerBadRequestException { 25 25 String q = args.get("q"); 26 Collection<String> handlers = q == null ? null : Arrays.asList(q.split("[,\\s]+" ));26 Collection<String> handlers = q == null ? null : Arrays.asList(q.split("[,\\s]+", -1)); 27 27 content = RequestProcessor.getHandlersInfoAsJSON(handlers).toString(); 28 28 contentType = "application/json"; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r16328 r16643 330 330 if (args != null && args.containsKey("select")) { 331 331 toSelect.clear(); 332 for (String item : args.get("select").split("," )) {332 for (String item : args.get("select").split(",", -1)) { 333 333 if (!item.isEmpty()) { 334 334 if (CURRENT_SELECTION.equalsIgnoreCase(item)) { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r16576 r16643 244 244 245 245 protected final String[] splitArg(String arg, Pattern splitter) { 246 return splitter.split(args != null ? args.get(arg) : "" );246 return splitter.split(args != null ? args.get(arg) : "", -1); 247 247 } 248 248 … … 259 259 return r; 260 260 } 261 for (String kv : uri.getRawQuery().split("&" )) {261 for (String kv : uri.getRawQuery().split("&", -1)) { 262 262 final String[] kvs = Utils.decodeUrl(kv).split("=", 2); 263 263 r.put(kvs[0], kvs.length > 1 ? kvs[1] : null); -
trunk/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java
r15496 r16643 86 86 } else if (!line.startsWith("%")) { 87 87 try { 88 String[] fields = line.split("[ ]+" );88 String[] fields = line.split("[ ]+", -1); 89 89 WayPoint currentwp = new WayPoint(new LatLon( 90 90 Double.parseDouble(fields[IDX_LAT]), -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r16553 r16643 487 487 String depStr = e.getAttribute("depends"); 488 488 if (!depStr.isEmpty()) { 489 for (String sd : depStr.split("," )) {489 for (String sd : depStr.split(",", -1)) { 490 490 Integer d = null; 491 491 try { -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r16488 r16643 1003 1003 String systemProp = Utils.getSystemProperty("josm.plugins"); 1004 1004 if (systemProp != null) { 1005 plugins.addAll(Arrays.asList(systemProp.split("," )));1005 plugins.addAll(Arrays.asList(systemProp.split(",", -1))); 1006 1006 Logging.debug("josm.plugins system property set to ''{0}''. Plugins list is now {1}", systemProp, plugins); 1007 1007 } -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r16182 r16643 307 307 String classPath = attr.getValue(Attributes.Name.CLASS_PATH); 308 308 if (classPath != null) { 309 for (String entry : classPath.split(" " )) {309 for (String entry : classPath.split(" ", -1)) { 310 310 File entryFile; 311 311 if (new File(entry).isAbsolute() || file == null) { … … 510 510 public boolean matches(String filter) { 511 511 if (filter == null) return true; 512 String[] words = filter.split("\\s+" );512 String[] words = filter.split("\\s+", -1); 513 513 for (String word: words) { 514 514 if (matches(word, name) … … 556 556 List<String> requiredPlugins = new ArrayList<>(); 557 557 if (pluginList != null) { 558 for (String s : pluginList.split(";" )) {558 for (String s : pluginList.split(";", -1)) { 559 559 String plugin = s.trim(); 560 560 if (!plugin.isEmpty()) { -
trunk/src/org/openstreetmap/josm/plugins/PluginListParser.java
r15588 r16643 77 77 } 78 78 addPluginInformation(ret, name, url, manifest.toString()); 79 String[] x = line.split(";" );79 String[] x = line.split(";", -1); 80 80 if (x.length != 2) 81 81 throw new IOException(tr("Illegal entry in plugin list.") + " " + line); -
trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
r15716 r16643 221 221 panel.add(new JLabel(firstMessage), GBC.eol().insets(0, 0, 0, 10)); 222 222 StringBuilder b = new StringBuilder(); 223 for (String part : msg.split("(?<=\\G.{200})" )) {223 for (String part : msg.split("(?<=\\G.{200})", -1)) { 224 224 b.append(part).append('\n'); 225 225 } -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r16630 r16643 107 107 if (m.matches()) { 108 108 OsmPrimitive n = new Node(Long.parseLong(m.group(1))); 109 for (String s : m.group(2).split("," )) {109 for (String s : m.group(2).split(",", -1)) { 110 110 refs.add(new Relation(Long.parseLong(s))); 111 111 } … … 115 115 if (m.matches()) { 116 116 OsmPrimitive n = new Node(Long.parseLong(m.group(1))); 117 for (String s : m.group(2).split("," )) {117 for (String s : m.group(2).split(",", -1)) { 118 118 refs.add(new Way(Long.parseLong(s))); 119 119 } … … 123 123 if (m.matches()) { 124 124 OsmPrimitive n = new Relation(Long.parseLong(m.group(1))); 125 for (String s : m.group(2).split("," )) {125 for (String s : m.group(2).split(",", -1)) { 126 126 refs.add(new Relation(Long.parseLong(s))); 127 127 } … … 131 131 if (m.matches()) { 132 132 OsmPrimitive n = new Way(Long.parseLong(m.group(1))); 133 for (String s : m.group(2).split("," )) {133 for (String s : m.group(2).split(",", -1)) { 134 134 refs.add(new Relation(Long.parseLong(s))); 135 135 } … … 140 140 if (m.matches()) { 141 141 OsmPrimitive n = OsmPrimitiveType.WAY.newInstance(Long.parseLong(m.group(1)), true); 142 for (String s : m.group(2).split("," )) {142 for (String s : m.group(2).split(",", -1)) { 143 143 refs.add(new Node(Long.parseLong(s))); 144 144 } … … 149 149 if (m.matches()) { 150 150 OsmPrimitive n = OsmPrimitiveType.RELATION.newInstance(Long.parseLong(m.group(1)), true); 151 for (String s : m.group(2).split("," )) {151 for (String s : m.group(2).split(",", -1)) { 152 152 refs.add(new Node(Long.parseLong(s))); 153 153 } … … 158 158 if (m.matches()) { 159 159 OsmPrimitive n = OsmPrimitiveType.RELATION.newInstance(Long.parseLong(m.group(1)), true); 160 for (String s : m.group(2).split("," )) {160 for (String s : m.group(2).split(",", -1)) { 161 161 refs.add(new Way(Long.parseLong(s))); 162 162 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r16486 r16643 1976 1976 String value = ((Element) item).getAttribute("value"); 1977 1977 if (!value.isEmpty()) { 1978 String[] s = value.split(" " );1978 String[] s = value.split(" ", -1); 1979 1979 if (s.length == 3) { 1980 1980 return parseRGB(s); -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r15665 r16643 58 58 return null; 59 59 } 60 String[] args = url.substring(i+1).split("&" );60 String[] args = url.substring(i+1).split("&", -1); 61 61 Map<String, String> map = new HashMap<>(); 62 62 for (String arg : args) { … … 69 69 try { 70 70 if (map.containsKey("bbox")) { 71 String[] bbox = map.get("bbox").split("," );71 String[] bbox = map.get("bbox").split(",", -1); 72 72 b = new Bounds( 73 73 Double.parseDouble(bbox[1]), Double.parseDouble(bbox[0]), … … 103 103 if (endIndex == -1) endIndex = url.length(); 104 104 String coordPart = url.substring(startIndex+(url.contains("#map=") ? "#map=".length() : "#".length()), endIndex); 105 String[] parts = coordPart.split("/" );105 String[] parts = coordPart.split("/", -1); 106 106 if (parts.length < 3) { 107 107 Logging.warn(tr("URL does not contain {0}/{1}/{2}", tr("zoom"), tr("latitude"), tr("longitude"))); -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r15543 r16643 315 315 while (result == null && (line = reader.readLine()) != null) { 316 316 if (line.contains("=")) { 317 String[] tokens = line.split("=" );317 String[] tokens = line.split("=", -1); 318 318 if (tokens.length >= 2) { 319 319 // Description, if available, contains exactly what we need -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r16630 r16643 50 50 */ 51 51 public static Map<String, String> readTagsByRegexp(String text, String splitRegex, String tagRegex, boolean unescapeTextInQuotes) { 52 String[] lines = text.split(splitRegex );52 String[] lines = text.split(splitRegex, -1); 53 53 Pattern p = Pattern.compile(tagRegex); 54 54 Map<String, String> tags = new LinkedHashMap<>(); -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r16624 r16643 1051 1051 return null; 1052 1052 } else { 1053 return String.join("\n", limit(Arrays.asList(s.split("\\n" )), maxLines, "..."));1053 return String.join("\n", limit(Arrays.asList(s.split("\\n", -1)), maxLines, "...")); 1054 1054 } 1055 1055 } … … 1707 1707 "java.baseline.version.url", 1708 1708 Config.getUrls().getJOSMWebsite() + "/remote/oracle-java-update-baseline.version"))) 1709 .connect().fetchContent().split("\n" );1709 .connect().fetchContent().split("\n", -1); 1710 1710 if (getJavaVersion() <= 8) { 1711 1711 for (String version : versions) { … … 1841 1841 // Workaround to https://bugs.openjdk.java.net/browse/JDK-4523159 1842 1842 String urlPath = jarUrl.getPath().replace("%20", " "); 1843 if (urlPath.startsWith("file:/") && urlPath.split("!" ).length > 2) {1843 if (urlPath.startsWith("file:/") && urlPath.split("!", -1).length > 2) { 1844 1844 // Locate jar file 1845 1845 int index = urlPath.lastIndexOf("!/"); -
trunk/test/functional/org/openstreetmap/josm/data/imagery/ImageryCompareTestIT.java
r15135 r16643 44 44 String comparison = HttpClient.create(new URL("https://josm.openstreetmap.de/wiki/ImageryCompare")).connect().fetchContent(); 45 45 String rubricLine = null; 46 for (String line : comparison.split("\n" )) {46 for (String line : comparison.split("\n", -1)) { 47 47 boolean black = line.startsWith(BLACK_PREFIX); 48 48 if (black) { -
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r16162 r16643 598 598 public static List<String> getIgnoredErrorMessages(Class<?> integrationTest) throws IOException { 599 599 return Arrays.stream(new WikiReader() 600 .read("https://josm.openstreetmap.de/wiki/IntegrationTestIgnores?format=txt") 601 .split("\\n")) 600 .read("https://josm.openstreetmap.de/wiki/IntegrationTestIgnores?format=txt").split("\\n", -1)) 602 601 .filter(s -> s.startsWith("|| " + integrationTest.getSimpleName() + " ||")) 603 602 .map(s -> s.substring(s.indexOf("{{{") + 3, s.indexOf("}}}"))) -
trunk/test/unit/org/openstreetmap/josm/data/osm/TagCollectionTest.java
r14518 r16643 689 689 TagCollection g = new TagCollection(Arrays.asList(new Tag("k", "b"), new Tag("k", "a"), new Tag("k", "b"), 690 690 new Tag("k", "c"), new Tag("k", "d"))); 691 assertEquals("a;b;c;d", Stream.of(g.getJoinedValues("k").split(";" )).sorted().collect(Collectors.joining(";")));691 assertEquals("a;b;c;d", Stream.of(g.getJoinedValues("k").split(";", -1)).sorted().collect(Collectors.joining(";"))); 692 692 } 693 693 -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
r16006 r16643 99 99 debug = "debug".equals(args[0]); 100 100 if (args[args.length - 1].startsWith("EPSG:")) { 101 forcedCodes = Arrays.asList(args[args.length - 1].split("," ));101 forcedCodes = Arrays.asList(args[args.length - 1].split(",", -1)); 102 102 } 103 103 } … … 137 137 result.add(curEntry); 138 138 } else if (curEntry != null) { 139 String[] f = line.trim().split("," );139 String[] f = line.trim().split(",", -1); 140 140 double lon = Double.parseDouble(f[0]); 141 141 double lat = Double.parseDouble(f[1]); … … 277 277 List<String> args = new ArrayList<>(); 278 278 args.add(CS2CS_EXE); 279 args.addAll(Arrays.asList("-f %.9f +proj=longlat +datum=WGS84 +to".split(" " )));279 args.addAll(Arrays.asList("-f %.9f +proj=longlat +datum=WGS84 +to".split(" ", -1))); 280 280 // proj.4 cannot read our ntf_r93_b.gsb file 281 281 // possibly because it is big endian. Use equivalent … … 286 286 def = def.replace("'", "\\'").replace("\"", "\\\""); 287 287 } 288 args.addAll(Arrays.asList(def.split(" " )));288 args.addAll(Arrays.asList(def.split(" ", -1))); 289 289 ProcessBuilder pb = new ProcessBuilder(args); 290 290 pb.environment().put("PROJ_LIB", new File(PROJ_LIB_DIR).getAbsolutePath()); -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r16445 r16643 125 125 126 126 private static Pair<Double, Double> readLine(String expectedName, String input) { 127 String[] fields = input.trim().split("[ ]+" );127 String[] fields = input.trim().split("[ ]+", -1); 128 128 if (fields.length != 3) throw new AssertionError(); 129 129 if (!fields[0].equals(expectedName)) throw new AssertionError(); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ValidatorTestUtils.java
r15071 r16643 51 51 Set<Integer> expectedCodes = new TreeSet<>(); 52 52 if (!"none".equals(codes)) { 53 for (String code : codes.split("," )) {53 for (String code : codes.split(",", -1)) { 54 54 expectedCodes.add(Integer.parseInt(code)); 55 55 } -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/RenderingCLIAreaTest.java
r16618 r16643 154 154 155 155 public RenderingCLIAreaTest(String args, Matcher<Double> scaleMatcher, Matcher<Bounds> boundsMatcher) { 156 this.args = args.split("\\s+" );156 this.args = args.split("\\s+", -1); 157 157 this.scaleMatcher = scaleMatcher; 158 158 this.boundsMatcher = boundsMatcher; -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java
r16438 r16643 248 248 // Check if we have received an error message 249 249 String error = helper.detectErrorMessage(new String(data, StandardCharsets.UTF_8)); 250 String errorMsg = url + zoomMarker(zoom) + (error != null ? error.split("\\n" )[0] : defaultMessage);250 String errorMsg = url + zoomMarker(zoom) + (error != null ? error.split("\\n", -1)[0] : defaultMessage); 251 251 addError(info, errorMsg); 252 252 return errorMsg; … … 344 344 345 345 private static boolean isZoomError(String error) { 346 String[] parts = error.split(ERROR_SEP );346 String[] parts = error.split(ERROR_SEP, -1); 347 347 String lastPart = parts.length > 0 ? parts[parts.length - 1].toLowerCase(Locale.ENGLISH) : ""; 348 348 return lastPart.contains("bbox") -
trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java
r14308 r16643 108 108 private static void testgetCharactersForKeyE00(String locale, Character... expected) { 109 109 if (locale.contains("_")) { 110 String[] l = locale.split("_" );110 String[] l = locale.split("_", -1); 111 111 testgetCharactersForKeyE00(new Locale(l[0], l[1]), expected); 112 112 } else {
Note:
See TracChangeset
for help on using the changeset viewer.