Changeset 14706 in josm for trunk


Ignore:
Timestamp:
2019-01-19T20:46:28+01:00 (5 years ago)
Author:
GerdP
Message:

fix more recent sonar issues

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

Legend:

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

    r14701 r14706  
    187187     * @param source source for symbol
    188188     */
    189     private void addInstallationLine(JPanel inst, String dir, String source) {
     189    private static void addInstallationLine(JPanel inst, String dir, String source) {
    190190        if (source == null)
    191191            return;
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r14701 r14706  
    279279        Preferences.main().getAllSettings().forEach((key, setting) -> {
    280280            if (key.startsWith("marker.show")
    281                     || key.equals("file-open.history")
    282                     || key.equals("download.overpass.query")
    283                     || key.equals("download.overpass.queries")
     281                    || "file-open.history".equals(key)
     282                    || "download.overpass.query".equals(key)
     283                    || "download.overpass.queries".equals(key)
    284284                    || key.contains("username")
    285285                    || key.contains("password")
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r14662 r14706  
    183183
    184184    private static void updateProperties(ExistingBothNew tags, Node existingNode, Iterable<Node> newNodes, Collection<Command> cmds) {
    185         if (ExistingBothNew.NEW.equals(tags)) {
     185        if (ExistingBothNew.NEW == tags) {
    186186            final Node newSelectedNode = new Node(existingNode);
    187187            newSelectedNode.removeAll();
    188188            cmds.add(new ChangeCommand(existingNode, newSelectedNode));
    189         } else if (ExistingBothNew.OLD.equals(tags)) {
     189        } else if (ExistingBothNew.OLD == tags) {
    190190            for (Node newNode : newNodes) {
    191191                newNode.removeAll();
     
    213213        List<Command> cmds = new LinkedList<>();
    214214        cmds.add(new AddCommand(selectedNode.getDataSet(), unglued));
    215         if (dialog != null && ExistingBothNew.NEW.equals(dialog.getTags().orElse(null))) {
     215        if (dialog != null && ExistingBothNew.NEW == dialog.getTags().orElse(null)) {
    216216            // unglued node gets the ID and history, thus replace way node with a fresh one
    217217            final Way way = selectedNode.getParentWays().get(0);
     
    388388     */
    389389    private static void updateMemberships(ExistingBothNew memberships, Node originalNode, List<Node> newNodes, Collection<Command> cmds) {
    390         if (memberships == null || ExistingBothNew.OLD.equals(memberships)) {
     390        if (memberships == null || ExistingBothNew.OLD == memberships) {
    391391            return;
    392392        }
     
    417417                            newRel.addMember(role.getValue() + 1, new RelationMember(role.getKey(), n));
    418418                        }
    419                         if (ExistingBothNew.NEW.equals(memberships)) {
     419                        if (ExistingBothNew.NEW == memberships) {
    420420                            // remove old member
    421421                            newRel.removeMember(role.getValue());
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r14705 r14706  
    190190     * Add presets that contain only numerical values to the ignore list
    191191     */
    192     private void analysePresets() {
     192    private static void analysePresets() {
    193193        for (String key : TaggingPresets.getPresetKeys()) {
    194194            if (isKeyIgnored(key))
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java

    r14634 r14706  
    171171    public boolean isKeyRequired() {
    172172        final MatchType type = MatchType.ofString(match);
    173         return MatchType.KEY_REQUIRED.equals(type) || MatchType.KEY_VALUE_REQUIRED.equals(type);
     173        return MatchType.KEY_REQUIRED == type || MatchType.KEY_VALUE_REQUIRED == type;
    174174    }
    175175
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r14665 r14706  
    6666                }
    6767            }
    68             if (code.equals("nb")) { /* OSM-Wiki has "no", but no "nb" */
     68            if ("nb".equals(code)) { /* OSM-Wiki has "no", but no "nb" */
    6969                return "No:";
    70             } else if (code.equals("de") || code.equals("es") || code.equals("fr")
    71                     || code.equals("it") || code.equals("nl") || code.equals("ru")
    72                     || code.equals("ja")) {
     70            } else if ("de".equals(code) || "es".equals(code) || "fr".equals(code)
     71                    || "it".equals(code) || "nl".equals(code) || "ru".equals(code)
     72                    || "ja".equals(code)) {
    7373                return code.toUpperCase(Locale.ENGLISH) + ":";
    7474            } else {
Note: See TracChangeset for help on using the changeset viewer.