Changeset 14201 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2018-08-29T19:40:53+02:00 (6 years ago)
Author:
Don-vip
Message:

spotbugs - fix various issues found with Eclipse plugin

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

Legend:

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

    r14153 r14201  
    320320                }
    321321
     322                Pattern urlPattern = Pattern.compile(".*(https?://.*)");
    322323                for (File urlFile: urlFiles) {
    323324                    try (BufferedReader reader = Files.newBufferedReader(urlFile.toPath(), StandardCharsets.UTF_8)) {
    324325                        String line;
    325326                        while ((line = reader.readLine()) != null) {
    326                             Matcher m = Pattern.compile(".*(https?://.*)").matcher(line);
     327                            Matcher m = urlPattern.matcher(line);
    327328                            if (m.matches()) {
    328329                                String url = m.group(1);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r14128 r14201  
    425425     * Add a new map paint style.
    426426     * @param entry map paint style
    427      * @return loaded style source, or {@code null}
     427     * @return loaded style source
    428428     */
    429429    public static StyleSource addStyle(SourceEntry entry) {
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r14153 r14201  
    653653        Collection<String> parameters = new ArrayList<>();
    654654        NodeList paramNl = parametersEl.getElementsByTagName("param");
    655         for (int i = 0; i < paramNl.getLength(); i++) {
     655        int length = paramNl.getLength();
     656        for (int i = 0; i < length; i++) {
    656657            Element paramEl = (Element) paramNl.item(i);
    657658            parameters.add(paramEl.getTextContent());
Note: See TracChangeset for help on using the changeset viewer.