Ticket #22832: josm_22832_minor_fixes.patch

File josm_22832_minor_fixes.patch, 65.9 KB (added by gaben, 3 years ago)
  • src/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrector.java

    Subject: [PATCH] Minor fixes
    ---
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrector.java b/src/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrector.java
    a b  
    9898                String leftRight = m.group(2).toLowerCase(Locale.ENGLISH);
    9999
    100100                StringBuilder result = new StringBuilder();
    101                 result.append(text.substring(0, m.start(2)))
     101                result.append(text, 0, m.start(2))
    102102                      .append(leftRight.equals(a) ? b : a)
    103103                      .append(text.substring(m.end(2)));
    104104
  • src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java b/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
    a b  
    141141            }
    142142        }
    143143        text.format("Locale info: %s%n", Locale.getDefault().toString());
    144         text.format("Numbers with default locale: %s -> %d%n", Integer.toString(1_234_567_890), 1_234_567_890);
     144        text.format("Numbers with default locale: %s -> %d%n", 1_234_567_890, 1_234_567_890);
    145145
    146146        if (PlatformManager.isPlatformUnixoid()) {
    147147            PlatformHookUnixoid platform = (PlatformHookUnixoid) PlatformManager.getPlatform();
  • src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java b/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java
    a b  
    156156        // Remove broken ways
    157157        result.removeIf(way -> way.getNodesCount() <= 2);
    158158
    159         if (selectedWays.isEmpty())
    160             return result;
    161         else {
    162             // Return only selected ways
     159        // Remove selected ways
     160        if (!selectedWays.isEmpty()) {
    163161            result.removeIf(way -> !selectedWays.contains(way));
    164             return result;
    165         }
     162        }
     163        return result;
    166164    }
    167165
    168166    @Override
  • src/org/openstreetmap/josm/command/AddPrimitivesCommand.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java b/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
    a b  
    102102                if (preExistingData.stream().anyMatch(pd -> pd.getPrimitiveId().equals(osm.getPrimitiveId()))) {
    103103                    Optional<PrimitiveData> o = data.stream()
    104104                            .filter(pd -> pd.getPrimitiveId().equals(osm.getPrimitiveId())).findAny();
    105                     if (o.isPresent()) {
    106                         osm.load(o.get());
    107                     }
     105                    o.ifPresent(osm::load);
    108106                } else {
    109107                    ds.addPrimitive(osm);
    110108                }
  • src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java b/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
    a b  
    110110
    111111        try {
    112112            if (!cacheDir.exists() && !cacheDir.mkdirs()) {
    113                 Logging.warn("Cache directory " + cacheDir.toString() + " does not exists and could not create it");
     113                Logging.warn("Cache directory " + cacheDir + " does not exists and could not create it");
    114114            } else {
    115115                File cacheDirLockPath = new File(cacheDir, ".lock");
    116116                try {
  • src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java b/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java
    a b  
    478478        } else {
    479479            zoomSelector = EMPTY_STRING;
    480480        }
    481         final String commonData = zoomSelector + this.filter.toString() + "::" + this.id + "{" + this.paintProperties + "}";
     481        final String commonData = zoomSelector + this.filter + "::" + this.id + "{" + this.paintProperties + "}";
    482482
    483483        if (this.type == Type.CIRCLE || this.type == Type.SYMBOL) {
    484484            return "node" + commonData;
  • src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java b/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java
    a b  
    618618            }
    619619        }
    620620        if (nameTag == null) {
    621             sb.append(Long.toString(relation.getId())).append(", ");
     621            sb.append(relation.getId()).append(", ");
    622622        } else {
    623623            sb.append('\"').append(nameTag).append("\", ");
    624624        }
  • src/org/openstreetmap/josm/data/osm/Node.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/osm/Node.java b/src/org/openstreetmap/josm/data/osm/Node.java
    a b  
    202202    void setDataset(DataSet dataSet) {
    203203        super.setDataset(dataSet);
    204204        if (!isIncomplete() && isVisible() && !isLatLonKnown())
    205             throw new DataIntegrityProblemException("Complete node with null coordinates: " + toString());
     205            throw new DataIntegrityProblemException("Complete node with null coordinates: " + this);
    206206    }
    207207
    208208    @Override
  • src/org/openstreetmap/josm/data/osm/OsmDataManager.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/osm/OsmDataManager.java b/src/org/openstreetmap/josm/data/osm/OsmDataManager.java
    a b  
    7070    public void setActiveDataSet(DataSet ds) {
    7171        Optional<OsmDataLayer> layer = MainApplication.getLayerManager().getLayersOfType(OsmDataLayer.class).stream()
    7272                .filter(l -> l.data.equals(ds)).findFirst();
    73         if (layer.isPresent()) {
    74             MainApplication.getLayerManager().setActiveLayer(layer.get());
    75         }
     73        layer.ifPresent(osmDataLayer -> MainApplication.getLayerManager().setActiveLayer(osmDataLayer));
    7674    }
    7775
    7876    @Override
  • src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java b/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
    a b  
    195195     */
    196196    public void checkDataset() {
    197197        if (dataSet == null)
    198             throw new DataIntegrityProblemException("Primitive must be part of the dataset: " + toString());
     198            throw new DataIntegrityProblemException("Primitive must be part of the dataset: " + this);
    199199    }
    200200
    201201    /**
     
    203203     */
    204204    protected final void checkDatasetNotReadOnly() {
    205205        if (dataSet != null && dataSet.isLocked())
    206             throw new DataIntegrityProblemException("Primitive cannot be modified in read-only dataset: " + toString());
     206            throw new DataIntegrityProblemException("Primitive cannot be modified in read-only dataset: " + this);
    207207    }
    208208
    209209    protected boolean writeLock() {
     
    991991    }
    992992
    993993    /**
    994      * Equal, if the id (and class) is equal.
    995      *
    996      * An primitive is equal to its incomplete counter part.
     994     * Equal if the id (and class) are equal.
     995     * <p>
     996     * A primitive is equal to its incomplete counterpart.
    997997     */
    998998    @Override
    999999    public boolean equals(Object obj) {
     
    10091009
    10101010    /**
    10111011     * Return the id plus the class type encoded as hashcode or super's hashcode if id is 0.
    1012      *
    1013      * An primitive has the same hashcode as its incomplete counterpart.
     1012     * <p>
     1013     * A primitive has the same hashcode as its incomplete counterpart.
    10141014     */
    10151015    @Override
    10161016    public int hashCode() {
  • src/org/openstreetmap/josm/data/osm/Relation.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/osm/Relation.java b/src/org/openstreetmap/josm/data/osm/Relation.java
    a b  
    443443        }
    444444
    445445        BBox box = new BBox();
    446         addToBBox(box, new HashSet<PrimitiveId>());
     446        addToBBox(box, new HashSet<>());
    447447        if (getDataSet() == null) {
    448448            return box;
    449449        }
     
    493493            if (Config.getPref().getBoolean("debug.checkDeleteReferenced", true)) {
    494494                for (RelationMember rm: members) {
    495495                    if (rm.getMember().isDeleted())
    496                         throw new DataIntegrityProblemException("Deleted member referenced: " + toString(), null, this, rm.getMember());
     496                        throw new DataIntegrityProblemException("Deleted member referenced: " + this, null, this, rm.getMember());
    497497                }
    498498            }
    499499        }
     
    524524    @Override
    525525    public Collection<OsmPrimitive> getIncompleteMembers() {
    526526        return Arrays.stream(members)
    527                 .filter(rm -> rm.getMember().isIncomplete())
    528527                .map(RelationMember::getMember)
     528                .filter(AbstractPrimitive::isIncomplete)
    529529                .collect(Collectors.toSet());
    530530    }
    531531
  • src/org/openstreetmap/josm/data/osm/Way.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/osm/Way.java b/src/org/openstreetmap/josm/data/osm/Way.java
    a b  
    551551                    throw new DataIntegrityProblemException("Nodes in way must be in the same dataset",
    552552                            tr("Nodes in way must be in the same dataset"));
    553553                if (n.isDeleted())
    554                     throw new DataIntegrityProblemException("Deleted node referenced: " + toString(),
     554                    throw new DataIntegrityProblemException("Deleted node referenced: " + this,
    555555                            "<html>" + tr("Deleted node referenced by {0}",
    556556                                    DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(this)) + "</html>",
    557557                            this, n);
     
    559559            if (Config.getPref().getBoolean("debug.checkNullCoor", true)) {
    560560                for (Node n: nodes) {
    561561                    if (n.isVisible() && !n.isIncomplete() && !n.isLatLonKnown())
    562                         throw new DataIntegrityProblemException("Complete visible node with null coordinates: " + toString(),
     562                        throw new DataIntegrityProblemException("Complete visible node with null coordinates: " + this,
    563563                                "<html>" + tr("Complete node {0} with null coordinates in way {1}",
    564564                                        DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(n),
    565565                                        DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(this)) + "</html>",
  • src/org/openstreetmap/josm/data/projection/ProjectionCLI.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/projection/ProjectionCLI.java b/src/org/openstreetmap/josm/data/projection/ProjectionCLI.java
    a b  
    154154            EastNorth enOut = toProj.latlon2eastNorth(ll);
    155155            double cOut1 = argSwitchOutput ? enOut.north() : enOut.east();
    156156            double cOut2 = argSwitchOutput ? enOut.east() : enOut.north();
    157             System.out.println(Double.toString(cOut1) + " " + Double.toString(cOut2));
     157            System.out.println(cOut1 + " " + cOut2);
    158158            System.out.flush();
    159159        }
    160160    }
  • src/org/openstreetmap/josm/data/validation/tests/Lanes.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/validation/tests/Lanes.java b/src/org/openstreetmap/josm/data/validation/tests/Lanes.java
    a b  
    6363                            .primitives(p)
    6464                            .build());
    6565                }
    66             } catch (NumberFormatException ignore) {
    67                 Logging.debug(ignore.getMessage());
     66            } catch (NumberFormatException e) {
     67                Logging.debug(e.getMessage());
    6868            }
    6969        }
    7070    }
     
    7575        final String forward = Utils.firstNonNull(p.get("lanes:forward"), "0");
    7676        final String backward = Utils.firstNonNull(p.get("lanes:backward"), "0");
    7777        try {
    78         if (Integer.parseInt(lanes) < Integer.parseInt(forward) + Integer.parseInt(backward)) {
    79             errors.add(TestError.builder(this, Severity.WARNING, 3101)
    80                     .message(tr("Number of {0} greater than {1}", tr("{0}+{1}", "lanes:forward", "lanes:backward"), "lanes"))
    81                     .primitives(p)
    82                     .build());
    83         }
    84         } catch (NumberFormatException ignore) {
    85             Logging.debug(ignore.getMessage());
     78            if (Integer.parseInt(lanes) < Integer.parseInt(forward) + Integer.parseInt(backward)) {
     79                errors.add(TestError.builder(this, Severity.WARNING, 3101)
     80                        .message(tr("Number of {0} greater than {1}", tr("{0}+{1}", "lanes:forward", "lanes:backward"), "lanes"))
     81                        .primitives(p)
     82                        .build());
     83            }
     84        } catch (NumberFormatException e) {
     85            Logging.debug(e.getMessage());
    8686        }
    8787    }
    8888
  • src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java b/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
    a b  
    444444                cnt++;
    445445                // add frequently changing info to progress monitor so that it
    446446                // doesn't seem to hang when test takes longer than 0.5 seconds
    447                 if (cnt % 10000 == 0 && stopwatch.elapsed() >= 500) {
     447                if (cnt % 10_000 == 0 && stopwatch.elapsed() >= 500) {
    448448                    progressMonitor.setExtraText(tr(" {0}: {1} of {2} elements done", title, cnt, selection.size()));
    449449                }
    450450            }
     
    487487                    addIfNotSimilar(e, errors);
    488488            }
    489489        }
    490 
    491490    }
    492 
    493491}
  • src/org/openstreetmap/josm/data/validation/ValidationTask.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/validation/ValidationTask.java b/src/org/openstreetmap/josm/data/validation/ValidationTask.java
    a b  
    3636     *
    3737     * @param tests                     the tests to run
    3838     * @param validatedPrimitives       the collection of primitives to validate.
    39      * @param formerValidatedPrimitives the last collection of primitives being validates. May be null.
     39     * @param formerValidatedPrimitives the last collection of primitives being validated. May be null.
    4040     */
    4141    public ValidationTask(Collection<Test> tests,
    4242                          Collection<OsmPrimitive> validatedPrimitives,
     
    4848                             Collection<Test> tests,
    4949                             Collection<OsmPrimitive> validatedPrimitives,
    5050                             Collection<OsmPrimitive> formerValidatedPrimitives) {
    51         super(tr("Validating"), progressMonitor, false /*don't ignore exceptions */);
     51        super(tr("Validating"), progressMonitor, false);
    5252        this.validatedPrimitives = validatedPrimitives;
    5353        this.formerValidatedPrimitives = formerValidatedPrimitives;
    5454        this.tests = tests;
  • src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java b/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java
    a b  
    216216         */
    217217        protected void renderValue(Object value) {
    218218            setFont(UIManager.getFont("ComboBox.font"));
    219             if (String.class.isInstance(value)) {
    220                 setText(String.class.cast(value));
    221             } else if (MultiValueDecisionType.class.isInstance(value)) {
    222                 switch(MultiValueDecisionType.class.cast(value)) {
     219            if (value instanceof String) {
     220                setText((String) value);
     221            } else if (value instanceof MultiValueDecisionType) {
     222                switch((MultiValueDecisionType) value) {
    223223                case UNDECIDED:
    224224                    setText(tr("Choose a value"));
    225225                    setFont(UIManager.getFont("ComboBox.font").deriveFont(Font.ITALIC + Font.BOLD));
  • src/org/openstreetmap/josm/gui/correction/CorrectionTable.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/correction/CorrectionTable.java b/src/org/openstreetmap/josm/gui/correction/CorrectionTable.java
    a b  
    3838        super(correctionTableModel);
    3939
    4040        final int correctionsSize = correctionTableModel.getCorrections().size();
    41         final int lines = correctionsSize > MAX_VISIBLE_LINES ? MAX_VISIBLE_LINES : correctionsSize;
     41        final int lines = Math.min(correctionsSize, MAX_VISIBLE_LINES);
    4242        setPreferredScrollableViewportSize(new Dimension(400, lines * getRowHeight()));
    4343        getColumnModel().getColumn(correctionTableModel.getApplyColumn()).setPreferredWidth(40);
    4444        setRowSelectionAllowed(false);
  • src/org/openstreetmap/josm/gui/dialogs/changeset/query/UidInputFieldValidator.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UidInputFieldValidator.java b/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UidInputFieldValidator.java
    a b  
    6565        if (Utils.isBlank(value)) return 0;
    6666        try {
    6767            int uid = Integer.parseInt(value.trim());
    68             if (uid > 0)
    69                 return uid;
    70             return 0;
     68            return Math.max(uid, 0);
    7169        } catch (NumberFormatException e) {
    7270            return 0;
    7371        }
  • src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetsInActiveDataLayerListModel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetsInActiveDataLayerListModel.java b/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetsInActiveDataLayerListModel.java
    a b  
    8181        // just init the model content. Don't register as DataSetListener. The mode
    8282        // is already registered to receive DataChangedEvents from the current edit layer
    8383        DataSet ds = e.getSource().getActiveDataSet();
    84         if (ds != null) {
    85             initFromDataSet(ds);
    86         } else {
    87             initFromDataSet(null);
    88         }
     84        initFromDataSet(ds);
    8985    }
    9086}
  • src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java b/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java
    a b  
    2626import org.openstreetmap.josm.actions.AutoScaleAction.AutoScaleMode;
    2727import org.openstreetmap.josm.actions.HistoryInfoAction;
    2828import org.openstreetmap.josm.actions.ZoomToAction;
     29import org.openstreetmap.josm.data.osm.AbstractPrimitive;
    2930import org.openstreetmap.josm.data.osm.OsmPrimitive;
    3031import org.openstreetmap.josm.data.osm.Relation;
    3132import org.openstreetmap.josm.data.osm.RelationMember;
     
    130131        if (MainApplication.isDisplayingMapView()) {
    131132            Collection<RelationMember> sel = getMemberTableModel().getSelectedMembers();
    132133            final Set<OsmPrimitive> toHighlight = sel.stream()
    133                     .filter(r -> r.getMember().isUsable())
    134134                    .map(RelationMember::getMember)
     135                    .filter(AbstractPrimitive::isUsable)
    135136                    .collect(Collectors.toSet());
    136137            SwingUtilities.invokeLater(() -> {
    137138                if (MainApplication.isDisplayingMapView() && highlightHelper.highlightOnly(toHighlight)) {
  • src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java b/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
    a b  
    551551    public Set<OsmPrimitive> getChildPrimitives(Collection<? extends OsmPrimitive> referenceSet) {
    552552        if (referenceSet == null) return null;
    553553        return members.stream()
    554                 .filter(m -> referenceSet.contains(m.getMember()))
    555554                .map(RelationMember::getMember)
     555                .filter(referenceSet::contains)
    556556                .collect(Collectors.toSet());
    557557    }
    558558
  • src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java b/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
    a b  
    128128                Set<String> tests = new HashSet<>();
    129129                visitTestErrors(node, err -> tests.add(getTesterDetails(err)), null);
    130130                String source = (tests.size() == 1) ? tr("Test: {0}", tests.iterator().next()) : tr("Different tests");
    131                 res = node.toString() + "<br>" + source;
     131                res = node + "<br>" + source;
    132132            }
    133133        }
    134134        return res == null ? null : "<html>" + res + "</html>";
  • src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java b/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
    a b  
    192192        tfLatLon.setText(CoordinateFormatManager.getDefaultFormat().latToString(llc) + ' ' +
    193193                         CoordinateFormatManager.getDefaultFormat().lonToString(llc));
    194194        EastNorth en = ProjectionRegistry.getProjection().latlon2eastNorth(llc);
    195         tfEastNorth.setText(Double.toString(en.east()) + ' ' + Double.toString(en.north()));
     195        tfEastNorth.setText(Double.toString(en.east()) + ' ' + en.north());
    196196        // Both latLonCoordinates and eastNorthCoordinates may have been reset to null if ll is out of the world
    197197        latLonCoordinates = llc;
    198198        eastNorthCoordinates = en;
  • src/org/openstreetmap/josm/gui/download/BookmarkSelection.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java b/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
    a b  
    143143        gc.fill = GridBagConstraints.BOTH;
    144144        gc.weightx = 1.0;
    145145        gc.weighty = 1.0;
    146         gc.gridx = 1;
    147146        dlg.add(new JScrollPane(bookmarks), gc);
    148147
    149148        this.parent = gui;
  • src/org/openstreetmap/josm/gui/history/HistoryBrowser.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java b/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java
    a b  
    55
    66import java.awt.BorderLayout;
    77import java.awt.Dimension;
    8 import java.util.Arrays;
     8import java.util.stream.Stream;
    99
    1010import javax.swing.JPanel;
    1111import javax.swing.JScrollPane;
     
    161161            model.unlinkAsListener();
    162162            model = null;
    163163        }
    164         Arrays.asList(tagInfoViewer, nodeListViewer, relationMemberListViewer, coordinateInfoViewer).stream()
     164        Stream.of(tagInfoViewer, nodeListViewer, relationMemberListViewer, coordinateInfoViewer)
    165165                .filter(Destroyable.class::isInstance).forEach(Destroyable::destroy);
    166166        tagInfoViewer = null;
    167167        nodeListViewer = null;
  • src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java b/src/org/openstreetmap/josm/gui/io/importexport/GpxExporter.java
    a b  
    7878
    7979    @Override
    8080    public boolean acceptFile(File pathname, Layer layer) {
    81         return isSupportedLayer(layer) ? super.acceptFile(pathname, layer) : false;
     81        return isSupportedLayer(layer) && super.acceptFile(pathname, layer);
    8282    }
    8383
    8484    @Override
  • src/org/openstreetmap/josm/gui/io/importexport/GpxLikeImporter.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/io/importexport/GpxLikeImporter.java b/src/org/openstreetmap/josm/gui/io/importexport/GpxLikeImporter.java
    a b  
    7474        msg.append("</html>");
    7575        if (success) {
    7676            SwingUtilities.invokeLater(() -> new Notification(
    77                     "<h3>" + tr("Import success:") + "</h3>" + msg.toString())
     77                    "<h3>" + tr("Import success:") + "</h3>" + msg)
    7878                    .setIcon(JOptionPane.INFORMATION_MESSAGE)
    7979                    .show());
    8080        } else {
  • src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java b/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java
    a b  
    5353    private JosmComboBox<Changeset> cbOpenChangesets;
    5454    private JosmComboBoxModel<Changeset> model;
    5555    private JCheckBox cbCloseAfterUpload;
    56     private JButton btnClose;
    5756
    5857    /**
    5958     * Constructs a new {@code ChangesetManagementPanel}.
     
    126125
    127126        gc.gridx++;
    128127        CloseChangesetAction closeChangesetAction = new CloseChangesetAction();
    129         btnClose = new JButton(closeChangesetAction);
     128        JButton btnClose = new JButton(closeChangesetAction);
    130129        btnClose.setPreferredSize(prefSize);
    131130        btnClose.setMinimumSize(prefSize);
    132131        add(btnClose, gc);
     
    277276    @Override
    278277    public void changesetCacheUpdated(ChangesetCacheEvent event) {
    279278        // This listener might have been called by a background task.
    280         SwingUtilities.invokeLater(() -> refreshCombo());
     279        SwingUtilities.invokeLater(this::refreshCombo);
    281280    }
    282281}
  • src/org/openstreetmap/josm/gui/io/CustomConfigurator.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java b/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java
    a b  
    130130     * @param unzip - if true file wil be unzipped and deleted after download
    131131     */
    132132    public static void processDownloadOperation(String address, String path, String parentDir, boolean mkdir, boolean unzip) {
    133         String dir = parentDir;
    134133        if (path.contains("..") || path.startsWith("/") || path.contains(":")) {
    135134            return; // some basic protection
    136135        }
    137         File fOut = new File(dir, path);
     136        File fOut = new File(parentDir, path);
    138137        DownloadFileTask downloadFileTask = new DownloadFileTask(MainApplication.getMainFrame(), address, fOut, mkdir, unzip);
    139138
    140139        MainApplication.worker.submit(downloadFileTask);
  • src/org/openstreetmap/josm/gui/io/UploadDialogModel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/io/UploadDialogModel.java b/src/org/openstreetmap/josm/gui/io/UploadDialogModel.java
    a b  
    7575     * @return the hashtags separated by ";" or null
    7676     */
    7777    String findHashTags(String comment) {
    78         String hashtags = String.join(";",
    79             Arrays.stream(comment.split("\\s", -1))
    80                 .map(s -> Utils.strip(s, ",;"))
    81                 .filter(s -> s.matches("#[a-zA-Z0-9][-_a-zA-Z0-9]+"))
    82                 .collect(Collectors.toList()));
     78        String hashtags = Arrays.stream(comment.split("\\s", -1))
     79            .map(s -> Utils.strip(s, ",;"))
     80            .filter(s -> s.matches("#[a-zA-Z0-9][-_a-zA-Z0-9]+"))
     81            .collect(Collectors.joining(";"));
    8382        return hashtags.isEmpty() ? null : hashtags;
    8483    }
    8584
     
    155154     */
    156155    public void putAll(Map<String, String> map) {
    157156        commitPendingEdit();
    158         map.forEach((key, value) -> doPut(key, value));
     157        map.forEach(this::doPut);
    159158        setDirty(true);
    160159        fireTableDataChanged();
    161160    }
  • src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java b/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
    a b  
    99import java.net.URL;
    1010import java.util.ArrayList;
    1111import java.util.Arrays;
    12 import java.util.Collection;
    1312import java.util.Comparator;
     13import java.util.List;
    1414import java.util.stream.Collectors;
    1515
    1616import javax.swing.AbstractAction;
     
    125125        URL url = Utils.fileToURL(audioFile);
    126126        boolean hasTracks = !Utils.isEmpty(layer.data.tracks);
    127127        boolean hasWaypoints = !Utils.isEmpty(layer.data.waypoints);
    128         Collection<WayPoint> waypoints = new ArrayList<>();
     128        List<WayPoint> waypoints = new ArrayList<>();
    129129        boolean timedMarkersOmitted = false;
    130130        boolean untimedMarkersOmitted = false;
    131131        double snapDistance = Config.getPref().getDouble("marker.audiofromuntimedwaypoints.distance", 1.0e-3);
     
    272272        }
    273273
    274274        // we must have got at least one waypoint now
    275         ((ArrayList<WayPoint>) waypoints).sort(Comparator.naturalOrder());
     275        waypoints.sort(Comparator.naturalOrder());
    276276
    277277        firstTime = -1.0; // this time of the first waypoint, not first trackpoint
    278278        for (WayPoint w : waypoints) {
  • src/org/openstreetmap/josm/gui/layer/imagery/ColorfulFilter.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/layer/imagery/ColorfulFilter.java b/src/org/openstreetmap/josm/gui/layer/imagery/ColorfulFilter.java
    a b  
    212212        int val = (int) (colorfulness * color + (1 - colorfulness) * luminosity);
    213213        if (val < 0) {
    214214            return 0;
    215         } else if (val > 0xff) {
    216             return 0xff;
    217         } else {
    218             return val;
    219         }
     215        } else return Math.min(val, 0xff);
    220216    }
    221217
    222218    private byte mix(int color, double luminosity) {
  • src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java b/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
    a b  
    778778    private void zoomChanged(boolean invalidate) {
    779779        Logging.debug("zoomChanged(): {0}", currentZoomLevel);
    780780        if (tileLoader instanceof TMSCachedTileLoader) {
    781             ((TMSCachedTileLoader) tileLoader).cancelOutstandingTasks();
     781            tileLoader.cancelOutstandingTasks();
    782782        }
    783783        if (invalidate) {
    784784            invalidate();
     
    11481148            StringBuilder line = new StringBuilder();
    11491149            StringBuilder ret = new StringBuilder();
    11501150            for (String s: text.split(" ", -1)) {
    1151                 if (g.getFontMetrics().stringWidth(line.toString() + s) > tileSource.getTileSize()) {
     1151                if (g.getFontMetrics().stringWidth(line + s) > tileSource.getTileSize()) {
    11521152                    ret.append(line).append('\n');
    11531153                    line.setLength(0);
    11541154                }
  • src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj b/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
    a b  
    710710Condition simple_key_condition(Context context) :
    711711{
    712712    boolean not = false;
    713     KeyMatchType matchType = null;;
     713    KeyMatchType matchType = null;
    714714    String key;
    715715}
    716716{
     
    731731    String val;
    732732    float f;
    733733    int i;
    734     KeyMatchType matchType = null;;
     734    KeyMatchType matchType = null;
    735735    Op op;
    736736    boolean considerValAsKey = false;
    737737}
  • src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java b/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
    a b  
    1919import java.util.regex.Matcher;
    2020import java.util.regex.Pattern;
    2121
     22import oauth.signpost.OAuth;
     23import oauth.signpost.OAuthConsumer;
     24import oauth.signpost.OAuthProvider;
     25import oauth.signpost.exception.OAuthException;
    2226import org.openstreetmap.josm.data.oauth.OAuthParameters;
    2327import org.openstreetmap.josm.data.oauth.OAuthToken;
    2428import org.openstreetmap.josm.data.oauth.OsmPrivileges;
     
    3034import org.openstreetmap.josm.tools.Logging;
    3135import org.openstreetmap.josm.tools.Utils;
    3236
    33 import oauth.signpost.OAuth;
    34 import oauth.signpost.OAuthConsumer;
    35 import oauth.signpost.OAuthProvider;
    36 import oauth.signpost.exception.OAuthException;
    37 
    3837/**
    3938 * An OAuth 1.0 authorization client.
    4039 * @since 2746
     
    198197
    199198        for (String setCookie: setCookies) {
    200199            String[] kvPairs = setCookie.split(";", -1);
    201             if (kvPairs.length == 0) {
    202                 continue;
    203             }
    204200            for (String kvPair : kvPairs) {
    205201                kvPair = kvPair.trim();
    206202                String[] kv = kvPair.split("=", -1);
  • src/org/openstreetmap/josm/gui/preferences/advanced/AbstractTableListEditor.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractTableListEditor.java b/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractTableListEditor.java
    a b  
    107107        public void valueChanged(ListSelectionEvent e) {
    108108            TableCellEditor editor = table.getCellEditor();
    109109            if (editor != null) {
    110                 ((DefaultCellEditor) editor).stopCellEditing();
     110                editor.stopCellEditing();
    111111            }
    112112            if (entryList.getSelectedIndices().length != 1) {
    113113                entryIdx = null;
  • src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java b/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
    a b  
    9090    public String getCurrentCode() {
    9191        int zone = index + 1;
    9292        int code = 32600 + zone + (hemisphere == Hemisphere.South ? 100 : 0);
    93         return "EPSG:" + Integer.toString(code);
     93        return "EPSG:" + code;
    9494    }
    9595
    9696    @Override
  • src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java b/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
    a b  
    12491249            sc = ((JosmAction) action.getAction()).getShortcut();
    12501250            if (sc.getAssignedKey() == KeyEvent.CHAR_UNDEFINED) {
    12511251                sc = null;
    1252         }
     1252            }
    12531253        }
    12541254
    12551255        long paramCode = 0;
  • src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java b/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
    a b  
    1010import java.util.ArrayList;
    1111import java.util.Arrays;
    1212import java.util.Collection;
    13 import java.util.Collections;
    1413import java.util.List;
    1514import java.util.Map;
    1615import java.util.TreeMap;
     
    311310        }
    312311
    313312        if (values_sort && TaggingPresets.SORT_MENU.get()) {
    314             Collections.sort(presetListEntries, (a, b) -> AlphanumComparator.getInstance().compare(a.getDisplayValue(), b.getDisplayValue()));
     313            presetListEntries.sort((a, b) -> AlphanumComparator.getInstance().compare(a.getDisplayValue(), b.getDisplayValue()));
    315314        }
    316315    }
    317316
  • src/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntry.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntry.java b/src/org/openstreetmap/josm/gui/tagging/presets/items/PresetListEntry.java
    a b  
    8282     */
    8383    public String getListDisplay(int width) {
    8484        String displayValue = getDisplayValue();
    85         Integer count = getCount();
     85        int count = getCount();
    8686
    8787        if (count > 0 && cms.usage.getSelectedCount() > 1) {
    8888            displayValue = tr("{0} ({1})", displayValue, count);
  • src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java b/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
    a b  
    278278                        try {
    279279                            result.attachImageIcon(this, true);
    280280                        } catch (IllegalArgumentException e) {
    281                             Logging.warn(toString() + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName);
     281                            Logging.warn(this + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName);
    282282                            Logging.warn(e);
    283283                        } finally {
    284284                            iconFuture.complete(null);
    285285                        }
    286286                    });
    287287                } else {
    288                     Logging.warn(toString() + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName);
     288                    Logging.warn(this + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName);
    289289                    iconFuture.complete(null);
    290290                }
    291291            });
  • src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java b/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
    a b  
    530530     */
    531531    public List<String> getKeys() {
    532532        return tags.stream()
    533                 .filter(tag -> !Utils.isStripEmpty(tag.getName()))
    534533                .map(TagModel::getName)
     534                .filter(name -> !Utils.isStripEmpty(name))
    535535                .collect(Collectors.toList());
    536536    }
    537537
  • src/org/openstreetmap/josm/gui/MapStatus.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/MapStatus.java b/src/org/openstreetmap/josm/gui/MapStatus.java
    a b  
    645645            osm.visitKeys((primitive, key, value) -> text.append("<br>").append(key).append('=').append(value));
    646646
    647647            final JLabel l = new JLabel(
    648                     "<html>" + text.toString() + "</html>",
     648                    "<html>" + text + "</html>",
    649649                    ImageProvider.get(osm.getDisplayType()),
    650650                    JLabel.HORIZONTAL
    651651                    ) {
  • src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java b/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
    a b  
    202202         */
    203203        if (GLOBAL_CONFIRMATION.get()) {
    204204            // Ensure dialog box does not exceed main window size
    205             Integer maxWidth = (int) Math.max(200, MainApplication.getMainFrame().getWidth()*0.6);
     205            int maxWidth = (int) Math.max(200, MainApplication.getMainFrame().getWidth()*0.6);
    206206            String message = "<html><div>" + getPermissionMessage() +
    207207                    "<br/>" + tr("Do you want to allow this?") + "</div></html>";
    208208            JLabel label = new JLabel(message);
     
    356356    protected DownloadParams getDownloadParams() {
    357357        DownloadParams result = new DownloadParams();
    358358        if (args != null) {
    359             result = result
    360                 .withNewLayer(isLoadInNewLayer())
    361                 .withLayerName(args.get("layer_name"))
    362                 .withLocked(get("layer_locked"))
    363                 .withDownloadPolicy(get("download_policy", DownloadPolicy::of, () -> DownloadPolicy.NORMAL))
    364                 .withUploadPolicy(get("upload_policy", UploadPolicy::of, () -> UploadPolicy.NORMAL));
     359            result
     360                    .withNewLayer(isLoadInNewLayer())
     361                    .withLayerName(args.get("layer_name"))
     362                    .withLocked(get("layer_locked"))
     363                    .withDownloadPolicy(get("download_policy", DownloadPolicy::of, () -> DownloadPolicy.NORMAL))
     364                    .withUploadPolicy(get("upload_policy", UploadPolicy::of, () -> UploadPolicy.NORMAL));
    365365        }
    366366        return result;
    367367    }
  • src/org/openstreetmap/josm/io/ChangesetQuery.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/ChangesetQuery.java b/src/org/openstreetmap/josm/io/ChangesetQuery.java
    a b  
    264264     * Restricts the result to changesets which have been closed after the date given by <code>d</code>.
    265265     * <code>d</code> d is a date relative to the current time zone.
    266266     *
    267      * @param d the date . Must not be null.
     267     * @param d the date. Must not be null.
    268268     * @return the restricted changeset query
    269269     * @throws IllegalArgumentException if d is null
    270270     */
     
    368368            if (sb.length() > 0) {
    369369                sb.append('&');
    370370            }
    371             sb.append("open=").append(Boolean.toString(open));
     371            sb.append("open=").append(open);
    372372        } else if (closed != null) {
    373373            if (sb.length() > 0) {
    374374                sb.append('&');
    375375            }
    376             sb.append("closed=").append(Boolean.toString(closed));
     376            sb.append("closed=").append(closed);
    377377        } else if (changesetIds != null) {
    378378            // since 2013-12-05, see https://github.com/openstreetmap/openstreetmap-website/commit/1d1f194d598e54a5d6fb4f38fb569d4138af0dc8
    379379            if (sb.length() > 0) {
     
    569569         * <code>query</code> is the query part of a API url for querying changesets,
    570570         * see <a href="http://wiki.openstreetmap.org/wiki/API_v0.6#Query:_GET_.2Fapi.2F0.6.2Fchangesets">OSM API</a>.
    571571         *
    572          * Example for an query string:<br>
     572         * Example for a query string:<br>
    573573         * <pre>
    574574         *    uid=1234&amp;open=true
    575575         * </pre>
  • src/org/openstreetmap/josm/plugins/PluginHandler.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/plugins/PluginHandler.java b/src/org/openstreetmap/josm/plugins/PluginHandler.java
    a b  
    465465        } else {
    466466            long tim = System.currentTimeMillis();
    467467            long last = Config.getPref().getLong("pluginmanager.lastupdate", 0);
    468             Integer maxTime = Config.getPref().getInt("pluginmanager.time-based-update.interval", DEFAULT_TIME_BASED_UPDATE_INTERVAL);
     468            int maxTime = Config.getPref().getInt("pluginmanager.time-based-update.interval", DEFAULT_TIME_BASED_UPDATE_INTERVAL);
    469469            long d = TimeUnit.MILLISECONDS.toDays(tim - last);
    470470            if ((last <= 0) || (maxTime <= 0)) {
    471471                Config.getPref().put("pluginmanager.lastupdate", Long.toString(tim));
     
    10201020        }
    10211021        try {
    10221022            monitor.beginTask(tr("Determining plugins to load..."));
    1023             Set<String> plugins = new HashSet<>(Config.getPref().getList("plugins", new LinkedList<String>()));
     1023            Set<String> plugins = new HashSet<>(Config.getPref().getList("plugins", new LinkedList<>()));
    10241024            Logging.debug("Plugins list initialized to {0}", plugins);
    10251025            String systemProp = Utils.getSystemProperty("josm.plugins");
    10261026            if (systemProp != null) {
  • src/org/openstreetmap/josm/tools/ColorScale.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/tools/ColorScale.java b/src/org/openstreetmap/josm/tools/ColorScale.java
    a b  
    249249        FontMetrics fm = g.getFontMetrics();
    250250        fh = fm.getHeight()/2;
    251251        if (colorBarTitles != null && colorBarTitles.length > 0) {
    252              fw = Arrays.asList(colorBarTitles).stream().mapToInt(title -> fm.stringWidth(title)).max().orElse(50);
     252             fw = Arrays.stream(colorBarTitles).mapToInt(fm::stringWidth).max().orElse(50);
    253253        } else {
    254254            fw = fm.stringWidth(
    255255                    String.valueOf(Math.max((int) Math.abs(max * valueScale), (int) Math.abs(min * valueScale))))
  • src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java b/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
    a b  
    135135            return Double.parseDouble(map.get(key));
    136136        if (map.containsKey('m'+key))
    137137            return Double.parseDouble(map.get('m'+key));
    138         throw new IllegalArgumentException(map.toString() + " does not contain " + key);
     138        throw new IllegalArgumentException(map + " does not contain " + key);
    139139    }
    140140
    141141    private static final char[] SHORTLINK_CHARS = {
  • src/org/openstreetmap/josm/tools/Shortcut.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/tools/Shortcut.java b/src/org/openstreetmap/josm/tools/Shortcut.java
    a b  
    521521    // and now the workhorse. same parameters as above, just one more
    522522    private static Shortcut registerShortcut(String shortText, String longText, int requestedKey, int requestedGroup, Integer modifier) {
    523523        doInit();
    524         Integer defaultModifier = findModifier(requestedGroup, modifier);
     524        int defaultModifier = findModifier(requestedGroup, modifier);
    525525        final Optional<Shortcut> existing = findShortcutByKeyOrShortText(requestedKey, defaultModifier, shortText);
    526526        if (existing.isPresent() && shortText.equals(existing.get().getShortText())) {
    527527            // a re-register? maybe a sc already read from the preferences?
  • src/org/openstreetmap/josm/tools/Utils.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/tools/Utils.java b/src/org/openstreetmap/josm/tools/Utils.java
    a b  
    16421642            throw new IllegalArgumentException(MessageFormat.format("Parameter min ({0}) cannot be greater than max ({1})", min, max));
    16431643        } else if (val < min) {
    16441644            return min;
    1645         } else if (val > max) {
    1646             return max;
    1647         } else {
    1648             return val;
    1649         }
     1645        } else return Math.min(val, max);
    16501646    }
    16511647
    16521648    /**
     
    16631659            throw new IllegalArgumentException(MessageFormat.format("Parameter min ({0}) cannot be greater than max ({1})", min, max));
    16641660        } else if (val < min) {
    16651661            return min;
    1666         } else if (val > max) {
    1667             return max;
    1668         } else {
    1669             return val;
    1670         }
     1662        } else return Math.min(val, max);
    16711663    }
    16721664
    16731665    /**
     
    17611753        int bPos = version.indexOf('b');
    17621754        int pPos = version.indexOf('+');
    17631755        try {
    1764             return Integer.parseInt(version.substring(bPos > -1 ? bPos + 1 : pPos + 1, version.length()));
     1756            return Integer.parseInt(version.substring(bPos > -1 ? bPos + 1 : pPos + 1));
    17651757        } catch (NumberFormatException e) {
    17661758            Logging.trace(e);
    17671759            return 0;
     
    18271819
    18281820    /**
    18291821     * Determines if a class can be found for the given name.
    1830      * @param className class nmae to find
     1822     * @param className class name to find
    18311823     * @return {@code true} if the class can be found, {@code false} otherwise
    18321824     * @since 17692
    18331825     */
  • test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java b/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java
    a b  
    66import static org.junit.jupiter.api.Assertions.assertNotEquals;
    77import static org.junit.jupiter.api.Assertions.assertTrue;
    88
    9 import org.junit.jupiter.api.extension.RegisterExtension;
     9import java.util.Collections;
     10import java.util.HashSet;
     11
     12import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1013import org.junit.jupiter.api.Test;
     14import org.junit.jupiter.api.extension.RegisterExtension;
    1115import org.openstreetmap.josm.data.coor.LatLon;
    1216import org.openstreetmap.josm.testutils.JOSMTestRules;
    1317
    14 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    15 
    16 import java.util.Collections;
    17 import java.util.HashSet;
    18 
    1918/**
    2019 * Some unit test cases for basic tag management on {@link OsmPrimitive}. Uses
    2120 * {@link Node} for the tests, {@link OsmPrimitive} is abstract.
     
    192191    private void testGetKey(OsmPrimitive p, String key, String value) {
    193192        assertEquals(value != null, p.hasKey(key));
    194193        assertEquals(value != null, p.getKeys().containsKey(key));
    195         assertEquals(value != null, p.getKeys().keySet().contains(key));
    196194        assertEquals(value, p.get(key));
    197         assertEquals(value, p.getKeys().get(key));
    198195    }
    199 
    200196}
  • test/unit/org/openstreetmap/josm/io/GpxReaderTest.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java b/test/unit/org/openstreetmap/josm/io/GpxReaderTest.java
    a b  
    66import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.io.ByteArrayInputStream;
    9 import java.io.File;
    109import java.io.FileInputStream;
    1110import java.io.IOException;
    1211import java.nio.charset.StandardCharsets;
     
    1413import java.util.HashMap;
    1514import java.util.Map;
    1615
     16import org.junit.jupiter.api.Test;
    1717import org.openstreetmap.josm.TestUtils;
    1818import org.openstreetmap.josm.data.Bounds;
    1919import org.openstreetmap.josm.data.coor.LatLon;
    2020import org.openstreetmap.josm.data.gpx.GpxData;
    2121import org.openstreetmap.josm.data.gpx.WayPoint;
    2222import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    23 
    24 import org.junit.jupiter.api.Test;
    2523import org.xml.sax.SAXException;
    2624
    2725/**
     
    3836     */
    3937    public static GpxData parseGpxData(String filename) throws IOException, SAXException {
    4038        final GpxData result;
    41         try (FileInputStream in = new FileInputStream(new File(filename))) {
     39        try (FileInputStream in = new FileInputStream(filename)) {
    4240            GpxReader reader = new GpxReader(in);
    4341            assertTrue(reader.parse(false));
    4442            result = reader.getGpxData();
  • test/unit/org/openstreetmap/josm/testutils/mockers/EDTAssertionMocker.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/test/unit/org/openstreetmap/josm/testutils/mockers/EDTAssertionMocker.java b/test/unit/org/openstreetmap/josm/testutils/mockers/EDTAssertionMocker.java
    a b  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.testutils.mockers;
    33
    4 import org.openstreetmap.josm.gui.util.GuiHelper;
    5 
    64import mockit.Invocation;
    75import mockit.Mock;
    86import mockit.MockUp;
     7import org.openstreetmap.josm.gui.util.GuiHelper;
    98
    109/**
    1110 * MockUp that, when applied, should cause calls to the EDT which would normally swallow generated
     
    1615    static void handleEDTException(final Invocation invocation, final Throwable t) throws Throwable {
    1716        final Throwable cause = t.getCause();
    1817        if (cause instanceof AssertionError) {
    19             throw (AssertionError) cause;
     18            throw cause;
    2019        }
    2120
    2221        invocation.proceed(t);