Changeset 15293 in josm


Ignore:
Timestamp:
2019-08-08T01:24:18+02:00 (5 years ago)
Author:
Don-vip
Message:

sonar

Location:
trunk/src/org/openstreetmap/josm
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java

    r14743 r15293  
    204204                if (m.find()) {
    205205                    String id = m.group(1);
    206                     String newURL = s.wmsUrl.replaceAll("__s__", id);
     206                    String newURL = s.wmsUrl.replace("__s__", id);
    207207                    String title = s.name + " (" + id + ')';
    208208                    addWMSLayer(title, newURL);
     
    211211                // If not, look if it's a valid ID for the selected service
    212212                if (s.idValidator.matcher(text).matches()) {
    213                     String newURL = s.wmsUrl.replaceAll("__s__", text);
     213                    String newURL = s.wmsUrl.replace("__s__", text);
    214214                    String title = s.name + " (" + text + ')';
    215215                    addWMSLayer(title, newURL);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/ConditionalKeys.java

    r15071 r15293  
    106106            return false;
    107107        }
    108         final String[] parts = key.replaceAll(":conditional", "").split(":");
     108        final String[] parts = key.replace(":conditional", "").split(":");
    109109        return isKeyValid3Parts(parts) || isKeyValid1Part(parts) || isKeyValid2Parts(parts);
    110110    }
  • trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java

    r13849 r15293  
    9797            new AutoFilterRule("layer", 16),
    9898            new AutoFilterRule("maxspeed", 16)
    99                 .setValueFormatter(s -> s.replaceAll(" mph", "")),
     99                .setValueFormatter(s -> s.replace(" mph", "")),
    100100            new AutoFilterRule("voltage", 5)
    101101                .setValueFormatter(s -> s.replaceAll("000$", "k") + 'V')
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java

    r15289 r15293  
    706706                // Add settings not in groups
    707707                final List<StyleSetting> allStylesInGroups = style.settingGroups.values().stream()
    708                         .flatMap(l -> l.stream()).collect(Collectors.toList());
     708                        .flatMap(List<StyleSetting>::stream).collect(Collectors.toList());
    709709                for (StyleSetting s : style.settings.stream()
    710710                        .filter(s -> !allStylesInGroups.contains(s)).collect(Collectors.toList())) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/BooleanStyleSettingGui.java

    r15292 r15293  
    4848        }
    4949
    50         public void doClickWithoutRepaint(int pressTime) {
     50        void doClickWithoutRepaint(int pressTime) {
    5151            noRepaint = true;
    5252            doClick(pressTime);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSetting.java

    r15289 r15293  
    5454
    5555        @Override
     56        public int hashCode() {
     57            return Objects.hash(label, parentStyle);
     58        }
     59
     60        @Override
     61        public boolean equals(Object obj) {
     62            if (this == obj)
     63                return true;
     64            if (obj == null || getClass() != obj.getClass())
     65                return false;
     66            LabeledStyleSetting other = (LabeledStyleSetting) obj;
     67            return Objects.equals(label, other.label) && Objects.equals(parentStyle, other.parentStyle);
     68        }
     69
     70        @Override
    5671        public int compareTo(LabeledStyleSetting o) {
    5772            return label.compareTo(o.label);
     
    6479     */
    6580    class StyleSettingGroup extends LabeledStyleSetting {
     81        /** group identifier */
    6682        public final String key;
     83        /** group icon (optional) */
    6784        public final Icon icon;
    6885
     
    7390        }
    7491
     92        /**
     93         * Creates a new {@code StyleSettingGroup}.
     94         * @param c cascade
     95         * @param parentStyle parent style source
     96         * @param key group identifier
     97         * @return newly created {@code StyleSettingGroup}
     98         */
    7599        public static StyleSettingGroup create(Cascade c, StyleSource parentStyle, String key) {
    76100            String label = c.get("label", null, String.class);
     
    98122        }
    99123
     124        /**
     125         * Creates a new {@code BooleanStyleSetting}.
     126         * @param c cascade
     127         * @param parentStyle parent style source
     128         * @param key setting identifier
     129         * @return newly created {@code BooleanStyleSetting}
     130         */
    100131        public static BooleanStyleSetting create(Cascade c, StyleSource parentStyle, String key) {
    101132            String label = c.get("label", null, String.class);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java

    r14143 r15293  
    102102
    103103    protected static String fixPresetString(String s) {
    104         return s == null ? s : s.replaceAll("'", "''");
     104        return s == null ? s : s.replace("'", "''");
    105105    }
    106106
  • trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItemUI.java

    r15288 r15293  
    6666    }
    6767
     68    /**
     69     * Creates a new {@code StayOpenCheckBoxMenuItemUI}.
     70     * @param c not used
     71     * @return newly created {@code StayOpenCheckBoxMenuItemUI}
     72     */
    6873    public static ComponentUI createUI(JComponent c) {
    6974        return new StayOpenCheckBoxMenuItemUI();
  • trunk/src/org/openstreetmap/josm/io/CachedFile.java

    r14535 r15293  
    422422        }
    423423        prefKey.append(url.toString().replaceAll("%<(.*)>", ""));
    424         return prefKey.toString().replaceAll("=", "_");
     424        return prefKey.toString().replace("=", "_");
    425425    }
    426426
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r14177 r15293  
    229229                if (line != null && !line.isEmpty()) {
    230230                    line = line.replaceAll("\"+", "");
    231                     line = line.replaceAll("NAME=", ""); // strange code for some Gentoo's
     231                    line = line.replace("NAME=", ""); // strange code for some Gentoo's
    232232                    if (line.startsWith("Linux ")) // e.g. Linux Mint
    233233                        return line;
  • trunk/src/org/openstreetmap/josm/tools/TextUtils.java

    r13978 r15293  
    1919     */
    2020    public static String wrapLongUrl(String url) {
    21         return url.replaceAll("/", "/\u200b").replaceAll("&", "&\u200b");
     21        return url.replace("/", "/\u200b").replace("&", "&\u200b");
    2222    }
    2323}
  • trunk/src/org/openstreetmap/josm/tools/WikiReader.java

    r14119 r15293  
    107107        for (String line = in.readLine(); line != null; line = in.readLine()) {
    108108            if (!line.contains("[[TranslatedPages]]")) {
    109                 b.append(line.replaceAll(" />", ">")).append('\n');
     109                b.append(line.replace(" />", ">")).append('\n');
    110110            }
    111111        }
     
    140140                // will render a thick  border around images inside an <a> element
    141141                // remove width information to avoid distorded images (fix #11262)
    142                 b.append(line.replaceAll("<img ", "<img border=\"0\" ")
     142                b.append(line.replace("<img ", "<img border=\"0\" ")
    143143                         .replaceAll("width=\"(\\d+)\"", "")
    144144                         .replaceAll("<span class=\"icon\">.</span>", "")
    145                          .replaceAll("href=\"/", "href=\"" + baseurl + '/')
    146                          .replaceAll(" />", ">"))
     145                         .replace("href=\"/", "href=\"" + baseurl + '/')
     146                         .replace(" />", ">"))
    147147                         .append('\n');
    148148            } else if (transl && line.contains("</div>")) {
Note: See TracChangeset for help on using the changeset viewer.