Ignore:
Timestamp:
2023-08-09T15:30:01+02:00 (3 years ago)
Author:
taylor.smock
Message:

Fix #22832: Code cleanup and some simplification, documentation fixes (patch by gaben)

There should not be any functional changes in this patch; it is intended to do
the following:

  • Simplify and cleanup code (example: Arrays.asList(item) -> Collections.singletonList(item))
  • Fix typos in documentation (which also corrects the documentation to match what actually happens, in some cases)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.java

    r18723 r18801  
    7070 * Compare and analyse the differences of the editor layer index and the JOSM imagery list.
    7171 * The goal is to keep both lists in sync.
    72  *
    73  * The editor layer index project (https://github.com/osmlab/editor-layer-index)
    74  * provides also a version in the JOSM format, but the GEOJSON is the original source
    75  * format, so we read that.
    76  *
    77  * How to run:
    78  * -----------
    79  *
    80  * Main JOSM binary needs to be in classpath, e.g.
    81  *
    82  * $ java -cp ../dist/josm-custom.jar SyncEditorLayerIndex
    83  *
    84  * Add option "-h" to show the available command line flags.
     72 * <p>
     73 * The <a href="https://github.com/osmlab/editor-layer-index">editor layer index</a> project
     74 * provides also a version in the JOSM format, but the GEOJSON is the original source format, so we read that.
     75 * <p>
     76 * For running, the main JOSM binary needs to be in classpath, e.g.
     77 * <p>
     78 * {@code $ java -cp ../dist/josm-custom.jar SyncEditorLayerIndex}
     79 * <p>
     80 * Add option {@code -h} to show the available command line flags.
    8581 */
    8682@SuppressWarnings("unchecked")
     
    294290    void myprintln(String s) {
    295291        String color;
     292        final String escaped = s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
    296293        if ((color = isSkipString(s)) != null) {
    297294            skip.remove(s);
    298295            if (optionXhtmlBody || optionXhtml) {
    299296                s = "<pre style=\"margin:3px;color:"+color+"\">"
    300                         + s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;")+"</pre>";
     297                        + escaped +"</pre>";
    301298            }
    302299            if (!optionNoSkip) {
     
    310307                                (s.startsWith("!") ? "orange" :
    311308                                    (s.startsWith("~") ? "red" : "brown"))));
    312             s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;")+"</pre>";
     309            s = "<pre style=\"margin:3px;color:"+color+"\">"+ escaped +"</pre>";
    313310        }
    314311        if ((s.startsWith("+ ") || s.startsWith("+++ ELI") || s.startsWith("#")) && optionNoEli) {
Note: See TracChangeset for help on using the changeset viewer.