Ticket #23111: 23111.patch

File 23111.patch, 4.3 KB (added by taylor.smock, 3 years ago)

Core changes

  • src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java

    Subject: [PATCH] 23111
    ---
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java b/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java
    a b  
    9595        return errorMessages;
    9696    }
    9797
    98     @Override
    99     public String acceptsDocumentationSummary() {
    100         StringBuilder buff = new StringBuilder(128)
    101             .append("<tr><td>")
    102             .append(getTitle())
    103             .append(":</td><td>");
    104         String[] patterns = getPatterns();
    105         if (patterns.length > 0) {
    106             buff.append("<ul>");
    107             for (String pattern: patterns) {
    108                 buff.append("<li>")
    109                     .append(XmlWriter.encode(pattern))
    110                     .append("</li>");
    111             }
    112             buff.append("</ul>");
    113         }
    114         buff.append("</td></tr>");
    115         return buff.toString();
    116     }
    11798
    11899    /**
    119100     * Determines if the given URL is accepted by {@link #getPatterns}.
  • src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java b/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java
    a b  
    1010import org.openstreetmap.josm.data.Bounds;
    1111import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    1212import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     13import org.openstreetmap.josm.io.XmlWriter;
    1314import org.openstreetmap.josm.tools.ExceptionUtil;
    1415
    1516/**
     
    1920
    2021    /**
    2122     * Asynchronously launches the download task for a given bounding box.
    22      *
     23     * <p>
    2324     * Set <code>progressMonitor</code> to null, if the task should create, open, and close a progress monitor.
    2425     * Set progressMonitor to {@link NullProgressMonitor#INSTANCE} if progress information is to
    2526     * be discarded.
    26      *
     27     * <p>
    2728     * You can wait for the asynchronous download task to finish by synchronizing on the returned
    2829     * {@link Future}, but make sure not to freeze up JOSM. Example:
    2930     * <pre>
     
    5960
    6061    /**
    6162     * Asynchronously launches the download task for a given bounding URL.
    62      *
     63     * <p>
    6364     * Set progressMonitor to null, if the task should create, open, and close a progress monitor.
    6465     * Set progressMonitor to {@link NullProgressMonitor#INSTANCE} if progress information is to
    6566     * be discarded.
     
    9293     * @return The HTML documentation
    9394     * @since 6031
    9495     */
    95     String acceptsDocumentationSummary();
     96    default String acceptsDocumentationSummary() {
     97        StringBuilder buff = new StringBuilder(128)
     98                .append("<tr><td>")
     99                .append(getTitle())
     100                .append(":</td><td>");
     101        String[] patterns = getPatterns();
     102        if (patterns.length > 0) {
     103            buff.append("<ul>");
     104            for (String pattern: patterns) {
     105                buff.append("<li>")
     106                        .append(XmlWriter.encode(pattern))
     107                        .append("</li>");
     108            }
     109            buff.append("</ul>");
     110        }
     111        buff.append("</td></tr>");
     112        return buff.toString();
     113    }
    96114
    97115    /**
    98116     * Returns human-readable description of the task
     
    130148            } else if (o instanceof Exception) {
    131149                return ExceptionUtil.explainException((Exception) o).replace("<html>", "").replace("</html>", "");
    132150            } else {
    133                 return (String) null;
     151                return null;
    134152            }
    135153        }).filter(Objects::nonNull).collect(Collectors.toList());
    136154    }