Ignore:
Timestamp:
2020-06-14T20:19:59+02:00 (4 years ago)
Author:
simon04
Message:

see #19334 - https://errorprone.info/bugpattern/StringSplitter

Location:
trunk/src/org/openstreetmap/josm/gui/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetCommentModel.java

    r13994 r16643  
    4646     */
    4747    public List<String> findHashTags() {
    48         return Arrays.stream(comment.split("\\s"))
     48        return Arrays.stream(comment.split("\\s", -1))
    4949                .map(s -> Utils.strip(s, ",;"))
    5050                .filter(s -> s.matches("#[a-zA-Z][a-zA-Z_\\-0-9]+"))
  • trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java

    r16438 r16643  
    170170        if (!opts.isEmpty()) {
    171171            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);
    173173        } else {
    174174            return JOptionPane.showOptionDialog(MainApplication.getMainFrame(), text, "Question",
     
    298298        final List<String> removeList = new ArrayList<>();
    299299        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));
    303303        installList.remove("");
    304304        removeList.remove("");
Note: See TracChangeset for help on using the changeset viewer.