Changeset 14214 in josm


Ignore:
Timestamp:
2018-09-01T15:29:15+02:00 (3 months ago)
Author:
Don-vip
Message:

sonarqube - squid:S4551 - Enum values should be compared with "=="

Location:
trunk/src
Files:
64 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/javax/json/JsonValueImpl.java

    r13231 r14214  
    8383        }
    8484        if (obj instanceof JsonValue) {
    85             return getValueType().equals(((JsonValue) obj).getValueType());
     85            return getValueType() == ((JsonValue) obj).getValueType();
    8686        }
    8787        return false;
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r14153 r14214  
    172172    protected static ImageryInfo getWMSLayerInfo(ImageryInfo info) throws IOException, WMSGetCapabilitiesException {
    173173        try {
    174             CheckParameterUtil.ensureThat(ImageryType.WMS_ENDPOINT.equals(info.getImageryType()), "wms_endpoint imagery type expected");
     174            CheckParameterUtil.ensureThat(ImageryType.WMS_ENDPOINT == info.getImageryType(), "wms_endpoint imagery type expected");
    175175            final WMSImagery wms = new WMSImagery(info.getUrl(), info.getCustomHttpHeaders());
    176176
  • trunk/src/org/openstreetmap/josm/actions/UpdateModifiedAction.java

    r14121 r14214  
    4848    protected void updateEnabledState() {
    4949        DataSet ds = getLayerManager().getEditDataSet();
    50         setEnabled(ds != null && !DownloadPolicy.BLOCKED.equals(ds.getDownloadPolicy())
     50        setEnabled(ds != null && DownloadPolicy.BLOCKED != ds.getDownloadPolicy()
    5151                && !NetworkManager.isOffline(OnlineResource.OSM_API));
    5252    }
  • trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java

    r14153 r14214  
    124124        } else {
    125125            DataSet ds = selection.iterator().next().getDataSet();
    126             setEnabled(!ds.isLocked() && !DownloadPolicy.BLOCKED.equals(ds.getDownloadPolicy())
     126            setEnabled(!ds.isLocked() && DownloadPolicy.BLOCKED != ds.getDownloadPolicy()
    127127                    && !NetworkManager.isOffline(OnlineResource.OSM_API));
    128128        }
  • trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java

    r14121 r14214  
    5858        OsmData<?, ?, ?, ?> ds = relations.iterator().next().getDataSet();
    5959        return !NetworkManager.isOffline(OnlineResource.OSM_API)
    60             && ds != null && !ds.isLocked() && !DownloadPolicy.BLOCKED.equals(ds.getDownloadPolicy());
     60            && ds != null && !ds.isLocked() && DownloadPolicy.BLOCKED != ds.getDownloadPolicy();
    6161    }
    6262}
  • trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java

    r12726 r14214  
    5454        super.executeCommand();
    5555
    56         if (decision.equals(MergeDecisionType.KEEP_MINE)) {
     56        if (decision == MergeDecisionType.KEEP_MINE) {
    5757            // do nothing
    58         } else if (decision.equals(MergeDecisionType.KEEP_THEIR)) {
     58        } else if (decision == MergeDecisionType.KEEP_THEIR) {
    5959            Node my = (Node) conflict.getMy();
    6060            Node their = (Node) conflict.getTheir();
  • trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java

    r12726 r14214  
    5454        super.executeCommand();
    5555
    56         if (decision.equals(MergeDecisionType.KEEP_MINE)) {
     56        if (decision == MergeDecisionType.KEEP_MINE) {
    5757            if (conflict.getMy().isDeleted() || conflict.isMyDeleted()) {
    5858                // because my was involved in a conflict it my still be referred
     
    6060                deleteMy();
    6161            }
    62         } else if (decision.equals(MergeDecisionType.KEEP_THEIR)) {
     62        } else if (decision == MergeDecisionType.KEEP_THEIR) {
    6363            if (conflict.getTheir().isDeleted()) {
    6464                deleteMy();
  • trunk/src/org/openstreetmap/josm/command/conflict/TagConflictResolveCommand.java

    r12726 r14214  
    3636        int n = 0;
    3737        for (TagMergeItem item: mergeItems) {
    38             if (!item.getMergeDecision().equals(MergeDecisionType.UNDECIDED)) {
     38            if (item.getMergeDecision() != MergeDecisionType.UNDECIDED) {
    3939                n++;
    4040            }
     
    9090        //
    9191        for (TagMergeItem item: mergeItems) {
    92             if (!item.getMergeDecision().equals(MergeDecisionType.UNDECIDED)) {
     92            if (item.getMergeDecision() != MergeDecisionType.UNDECIDED) {
    9393                item.applyToMyPrimitive(conflict.getMy());
    9494            }
  • trunk/src/org/openstreetmap/josm/data/imagery/DefaultLayer.java

    r13733 r14214  
    3434        this.layerName = layerName == null ? "" : layerName;
    3535        this.style = style == null ? "" : style;
    36         if (!imageryType.equals(ImageryType.WMTS) && !(tileMatrixSet == null || "".equals(tileMatrixSet))) {
     36        if (imageryType != ImageryType.WMTS && !(tileMatrixSet == null || "".equals(tileMatrixSet))) {
    3737            throw new IllegalArgumentException(tr("{0} imagery has tileMatrixSet defined to: {1}", imageryType, tileMatrixSet));
    3838        }
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r13890 r14214  
    15891589     */
    15901590    public String getSourceName() {
    1591         if (ImageryType.BING.equals(getImageryType())) {
     1591        if (ImageryType.BING == getImageryType()) {
    15921592            return "Bing";
    15931593        } else {
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r14119 r14214  
    337337
    338338    private static boolean isSimilar(ImageryInfo iiA, ImageryInfo iiB) {
    339         if (iiA == null)
     339        if (iiA == null || iiA.getImageryType() != iiB.getImageryType())
    340340            return false;
    341         if (!iiA.getImageryType().equals(iiB.getImageryType()))
    342             return false;
    343         if (iiA.getId() != null && iiB.getId() != null) return iiA.getId().equals(iiB.getId());
     341        if (iiA.getId() != null && iiB.getId() != null)
     342            return iiA.getId().equals(iiB.getId());
    344343        return isSimilar(iiA.getUrl(), iiB.getUrl());
    345344    }
  • trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java

    r13886 r14214  
    164164            listeners = inProgress.remove(getCacheKey());
    165165        }
    166         boolean status = result.equals(LoadResult.SUCCESS);
     166        boolean status = result == LoadResult.SUCCESS;
    167167
    168168        try {
  • trunk/src/org/openstreetmap/josm/data/imagery/WMSEndpointTileSource.java

    r13872 r14214  
    4141    public WMSEndpointTileSource(ImageryInfo info, Projection tileProjection) {
    4242        super(info, tileProjection);
    43         CheckParameterUtil.ensure(info, "imageryType", x -> ImageryType.WMS_ENDPOINT.equals(x.getImageryType()));
     43        CheckParameterUtil.ensure(info, "imageryType", x -> ImageryType.WMS_ENDPOINT == x.getImageryType());
    4444        try {
    4545            wmsi = new WMSImagery(info.getUrl(), info.getCustomHttpHeaders());
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java

    r11878 r14214  
    9797    public boolean isCreated(PrimitiveId id) {
    9898        if (!contains(id)) return false;
    99         return ChangesetModificationType.CREATED.equals(getModificationType(id));
     99        return ChangesetModificationType.CREATED == getModificationType(id);
    100100    }
    101101
     
    110110    public boolean isUpdated(PrimitiveId id) {
    111111        if (!contains(id)) return false;
    112         return ChangesetModificationType.UPDATED.equals(getModificationType(id));
     112        return ChangesetModificationType.UPDATED == getModificationType(id);
    113113    }
    114114
     
    123123    public boolean isDeleted(PrimitiveId id) {
    124124        if (!contains(id)) return false;
    125         return ChangesetModificationType.DELETED.equals(getModificationType(id));
     125        return ChangesetModificationType.DELETED == getModificationType(id);
    126126    }
    127127
     
    136136        CheckParameterUtil.ensureParameterNotNull(cmt, "cmt");
    137137        return modificationTypes.entrySet().stream()
    138                 .filter(entry -> entry.getValue().equals(cmt))
     138                .filter(entry -> entry.getValue() == cmt)
    139139                .map(entry -> primitives.get(entry.getKey()))
    140140                .collect(Collectors.toSet());
  • trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java

    r14129 r14214  
    11781178        @Override
    11791179        public boolean match(OsmPrimitive osm) {
    1180             return type.equals(osm.getType());
     1180            return type == osm.getType();
    11811181        }
    11821182
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r14128 r14214  
    22package org.openstreetmap.josm.data.validation.tests;
    33
     4import static org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.FixCommand.evaluateObject;
    45import static org.openstreetmap.josm.tools.I18n.tr;
    56
     
    686687        for (Set<TagCheck> schecks : checksCol) {
    687688            for (TagCheck check : schecks) {
    688                 boolean ignoreError = Severity.OTHER.equals(check.getSeverity()) && !includeOtherSeverity;
     689                boolean ignoreError = Severity.OTHER == check.getSeverity() && !includeOtherSeverity;
    689690                // Do not run "information" level checks if not wanted, unless they also set a MapCSS class
    690691                if (ignoreError && check.setClassExpressions.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java

    r13153 r14214  
    157157        // see ticket #9598 - only report if at least 3 segments are shared, except for overlapping ways, i.e warnings (see #9820)
    158158        for (TestError error : preliminaryErrors) {
    159             if (error.getSeverity().equals(Severity.WARNING) || error.getHighlighted().size() / error.getPrimitives().size() >= 3) {
     159            if (error.getSeverity() == Severity.WARNING || error.getHighlighted().size() / error.getPrimitives().size() >= 3) {
    160160                boolean ignore = false;
    161161                for (String ignoredKey : IGNORED_KEYS.get()) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java

    r13637 r14214  
    226226                    }
    227227                }
    228             } else if (OsmPrimitiveType.RELATION.equals(member.getType()) && !member.getMember().isUsable()
     228            } else if (OsmPrimitiveType.RELATION == member.getType() && !member.getMember().isUsable()
    229229                    && r.types.contains(TaggingPresetType.MULTIPOLYGON)) {
    230230                // if relation is incomplete we cannot verify if it's a multipolygon - so we just skip it
     
    245245
    246246            // Do not raise an error for incomplete ways for which we expect them to be closed, as we cannot know
    247             boolean ignored = member.getMember().isIncomplete() && OsmPrimitiveType.WAY.equals(member.getType())
     247            boolean ignored = member.getMember().isIncomplete() && OsmPrimitiveType.WAY == member.getType()
    248248                    && !types.contains(TaggingPresetType.WAY) && types.contains(TaggingPresetType.CLOSEDWAY);
    249249            if (!ignored) {
  • trunk/src/org/openstreetmap/josm/gui/MapMover.java

    r14138 r14214  
    180180            boolean macMovement = e.getModifiersEx() == macMouseMask;
    181181            boolean allowedMode = !map.mapModeSelect.equals(map.mapMode)
    182                               || SelectAction.Mode.SELECT.equals(map.mapModeSelect.getMode());
     182                              || SelectAction.Mode.SELECT == map.mapModeSelect.getMode();
    183183            allowMovement |= macMovement && allowedMode;
    184184        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMerger.java

    r13130 r14214  
    933933    public void decideRemaining(MergeDecisionType decision) {
    934934        if (!model.isFrozen()) {
    935             model.copyAll(MergeDecisionType.KEEP_MINE.equals(decision) ? ListRole.MY_ENTRIES : ListRole.THEIR_ENTRIES);
     935            model.copyAll(MergeDecisionType.KEEP_MINE == decision ? ListRole.MY_ENTRIES : ListRole.THEIR_ENTRIES);
    936936            model.setFrozen(true);
    937937        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java

    r12279 r14214  
    5555    public boolean isParticipatingIn(ListRole role) {
    5656        for (ListRole r: participatingRoles) {
    57             if (r.equals(role)) return true;
     57            if (r == role) return true;
    5858        }
    5959        return false;
     
    7979        if (!isParticipatingIn(role))
    8080            throw new IllegalStateException(tr("Role {0} is not participating in compare pair {1}.", role.toString(), this.toString()));
    81         if (participatingRoles[0].equals(role))
     81        if (participatingRoles[0] == role)
    8282            return participatingRoles[1];
    8383        else
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java

    r10378 r14214  
    8686     */
    8787    public boolean isDecidedCoord() {
    88         return !coordMergeDecision.equals(UNDECIDED);
     88        return coordMergeDecision != UNDECIDED;
    8989    }
    9090
     
    9696     */
    9797    public boolean isDecidedDeletedState() {
    98         return !deletedMergeDecision.equals(UNDECIDED);
     98        return deletedMergeDecision != UNDECIDED;
    9999    }
    100100
     
    107107     */
    108108    public boolean isCoordMergeDecision(MergeDecisionType decision) {
    109         return coordMergeDecision.equals(decision);
     109        return coordMergeDecision == decision;
    110110    }
    111111
     
    118118     */
    119119    public boolean isDeletedStateDecision(MergeDecisionType decision) {
    120         return deletedMergeDecision.equals(decision);
     120        return deletedMergeDecision == decision;
    121121    }
    122122
     
    310310        boolean ret = true;
    311311        if (hasCoordConflict()) {
    312             ret = ret && !coordMergeDecision.equals(UNDECIDED);
     312            ret = ret && coordMergeDecision != UNDECIDED;
    313313        }
    314314        if (hasDeletedStateConflict()) {
    315             ret = ret && !deletedMergeDecision.equals(UNDECIDED);
     315            ret = ret && deletedMergeDecision != UNDECIDED;
    316316        }
    317317        return ret;
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/MergedTableCellRenderer.java

    r12661 r14214  
    1818            return;
    1919        }
    20         if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision())) {
     20        if (MergeDecisionType.KEEP_MINE == item.getMergeDecision()) {
    2121            setBackground(ConflictColors.BGCOLOR_COMBINED.get());
    22         } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) {
     22        } else if (MergeDecisionType.KEEP_THEIR == item.getMergeDecision()) {
    2323            setBackground(ConflictColors.BGCOLOR_COMBINED.get());
    24         } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) {
     24        } else if (MergeDecisionType.UNDECIDED == item.getMergeDecision()) {
    2525            setBackground(ConflictColors.BGCOLOR_UNDECIDED.get());
    2626        }
     
    3030    protected void renderKey(TagMergeItem item, boolean isSelected) {
    3131        setBackgroundColor(item, isSelected);
    32         if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision()) && item.getMyTagValue() == null) {
     32        if (MergeDecisionType.KEEP_MINE == item.getMergeDecision() && item.getMyTagValue() == null) {
    3333            setText(tr("<undefined>"));
    3434            setToolTipText(tr("The merged dataset will not include a tag with key {0}", item.getKey()));
    35         } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision()) && item.getTheirTagValue() == null) {
     35        } else if (MergeDecisionType.KEEP_THEIR == item.getMergeDecision() && item.getTheirTagValue() == null) {
    3636            setText(tr("<undefined>"));
    3737            setToolTipText(tr("The merged dataset will not include a tag with key {0}", item.getKey()));
    38         } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) {
     38        } else if (MergeDecisionType.UNDECIDED == item.getMergeDecision()) {
    3939            setText("");
    4040        } else {
     
    4747    protected void renderValue(TagMergeItem item, boolean isSelected) {
    4848        setBackgroundColor(item, isSelected);
    49         if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision()) && item.getMyTagValue() == null) {
     49        if (MergeDecisionType.KEEP_MINE == item.getMergeDecision() && item.getMyTagValue() == null) {
    5050            setText(tr("<undefined>"));
    5151            setToolTipText(tr("The merged dataset will not include a tag with key {0}", item.getKey()));
    52         } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision()) && item.getTheirTagValue() == null) {
     52        } else if (MergeDecisionType.KEEP_THEIR == item.getMergeDecision() && item.getTheirTagValue() == null) {
    5353            setText(tr("<undefined>"));
    5454            setToolTipText(tr("The merged dataset will not include a tag with key {0}", item.getKey()));
    55         } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) {
     55        } else if (MergeDecisionType.UNDECIDED == item.getMergeDecision()) {
    5656            setText("");
    5757        } else {
    58             if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision())) {
     58            if (MergeDecisionType.KEEP_MINE == item.getMergeDecision()) {
    5959                setText(item.getMyTagValue());
    6060                setToolTipText(item.getMyTagValue());
    61             } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) {
     61            } else if (MergeDecisionType.KEEP_THEIR == item.getMergeDecision()) {
    6262                setText(item.getTheirTagValue());
    6363                setToolTipText(item.getTheirTagValue());
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/MineTableCellRenderer.java

    r12661 r14214  
    1919            return;
    2020        }
    21         if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision())) {
     21        if (MergeDecisionType.KEEP_MINE == item.getMergeDecision()) {
    2222            setBackground(ConflictColors.BGCOLOR_KEEP.get());
    23         } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) {
     23        } else if (MergeDecisionType.KEEP_THEIR == item.getMergeDecision()) {
    2424            setBackground(ConflictColors.BGCOLOR_DROP.get());
    25         } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) {
     25        } else if (MergeDecisionType.UNDECIDED == item.getMergeDecision()) {
    2626            setBackground(ConflictColors.BGCOLOR_UNDECIDED.get());
    2727        }
     
    2929
    3030    protected void setTextColor(TagMergeItem item) {
    31         if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision())) {
     31        if (MergeDecisionType.KEEP_MINE == item.getMergeDecision()) {
    3232            setForeground(ConflictColors.FGCOLOR_KEEP.get());
    33         } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) {
     33        } else if (MergeDecisionType.KEEP_THEIR == item.getMergeDecision()) {
    3434            setForeground(ConflictColors.FGCOLOR_DROP.get());
    35         } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) {
     35        } else if (MergeDecisionType.UNDECIDED == item.getMergeDecision()) {
    3636            setForeground(ConflictColors.FGCOLOR_UNDECIDED.get());
    3737        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModel.java

    r9440 r14214  
    8787        int newValue = 0;
    8888        for (TagMergeItem item: tagMergeItems) {
    89             if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) {
     89            if (MergeDecisionType.UNDECIDED == item.getMergeDecision()) {
    9090                newValue++;
    9191            }
     
    9494        numUndecidedTags = newValue;
    9595        fireNumUndecidedTagsChanged(oldValue, numUndecidedTags);
    96 
    9796    }
    9897
     
    196195    public boolean isResolvedCompletely() {
    197196        for (TagMergeItem item: tagMergeItems) {
    198             if (item.getMergeDecision().equals(MergeDecisionType.UNDECIDED))
     197            if (item.getMergeDecision() == MergeDecisionType.UNDECIDED)
    199198                return false;
    200199        }
     
    204203    public void decideRemaining(MergeDecisionType decision) {
    205204        for (TagMergeItem item: tagMergeItems) {
    206             if (item.getMergeDecision().equals(MergeDecisionType.UNDECIDED))
     205            if (item.getMergeDecision() == MergeDecisionType.UNDECIDED)
    207206                item.decide(decision);
    208207        }
     
    212211        int n = 0;
    213212        for (TagMergeItem item: tagMergeItems) {
    214             if (!item.getMergeDecision().equals(MergeDecisionType.UNDECIDED)) {
     213            if (item.getMergeDecision() != MergeDecisionType.UNDECIDED) {
    215214                n++;
    216215            }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TheirTableCellRenderer.java

    r12661 r14214  
    1919            return;
    2020        }
    21         if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision())) {
     21        if (MergeDecisionType.KEEP_MINE == item.getMergeDecision()) {
    2222            setBackground(ConflictColors.BGCOLOR_DROP.get());
    23         } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) {
     23        } else if (MergeDecisionType.KEEP_THEIR == item.getMergeDecision()) {
    2424            setBackground(ConflictColors.BGCOLOR_KEEP.get());
    25         } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) {
     25        } else if (MergeDecisionType.UNDECIDED == item.getMergeDecision()) {
    2626            setBackground(ConflictColors.BGCOLOR_UNDECIDED.get());
    2727        }
     
    2929
    3030    protected void setTextColor(TagMergeItem item) {
    31         if (MergeDecisionType.KEEP_MINE.equals(item.getMergeDecision())) {
     31        if (MergeDecisionType.KEEP_MINE == item.getMergeDecision()) {
    3232            setForeground(ConflictColors.FGCOLOR_DROP.get());
    33         } else if (MergeDecisionType.KEEP_THEIR.equals(item.getMergeDecision())) {
     33        } else if (MergeDecisionType.KEEP_THEIR == item.getMergeDecision()) {
    3434            setForeground(ConflictColors.FGCOLOR_KEEP.get());
    35         } else if (MergeDecisionType.UNDECIDED.equals(item.getMergeDecision())) {
     35        } else if (MergeDecisionType.UNDECIDED == item.getMergeDecision()) {
    3636            setForeground(ConflictColors.FGCOLOR_UNDECIDED.get());
    3737        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueResolutionDecision.java

    r13761 r14214  
    216216     */
    217217    public boolean isDecided() {
    218         return !type.equals(MultiValueDecisionType.UNDECIDED);
     218        return type != MultiValueDecisionType.UNDECIDED;
    219219    }
    220220
     
    240240            throw new IllegalStateException(tr("Not decided yet"));
    241241        String key = tags.getKeys().iterator().next();
    242         if (type.equals(MultiValueDecisionType.KEEP_NONE)) {
     242        if (type == MultiValueDecisionType.KEEP_NONE) {
    243243            primitive.remove(key);
    244244        } else {
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java

    r13478 r14214  
    300300            if (mode == null) {
    301301                setEnabled(false);
    302             } else if (mode.equals(Mode.RESOLVING_ONE_TAGCOLLECTION_ONLY)) {
     302            } else if (mode == Mode.RESOLVING_ONE_TAGCOLLECTION_ONLY) {
    303303                setEnabled(model.isResolvedCompletely());
    304304            } else {
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecision.java

    r12660 r14214  
    6666
    6767    public boolean isDecided() {
    68         return !UNDECIDED.equals(decision);
     68        return UNDECIDED != decision;
    6969    }
    7070
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionRenderer.java

    r12660 r14214  
    7777        }
    7878        RelationMemberConflictDecisionType.prepareLabel(decision, this);
    79         if (RelationMemberConflictDecisionType.UNDECIDED.equals(decision)) {
     79        if (RelationMemberConflictDecisionType.UNDECIDED == decision) {
    8080            setFont(getFont().deriveFont(Font.ITALIC));
    8181        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableModel.java

    r11878 r14214  
    9595    protected void sort() {
    9696        data.sort((c1, c2) -> {
    97                 if (c1.getModificationType().equals(c2.getModificationType())) {
     97                if (c1.getModificationType() == c2.getModificationType()) {
    9898                    long id1 = c1.getPrimitive().getId();
    9999                    long id2 = c2.getPrimitive().getId();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java

    r12939 r14214  
    224224        rbQueries.get(q).setSelected(true);
    225225        boolean mineOnly = Config.getPref().getBoolean("changeset-query.basic.my-changesets-only", false);
    226         mineOnly = mineOnly || q.equals(BasicQuery.MY_OPEN_CHANGESETS);
     226        mineOnly = mineOnly || q == BasicQuery.MY_OPEN_CHANGESETS;
    227227        cbMyChangesetsOnly.setSelected(mineOnly);
    228228    }
     
    280280            BasicQuery q = getSelectedQuery();
    281281            if (q == null) return;
    282             if (q.equals(BasicQuery.MY_OPEN_CHANGESETS)) {
     282            if (q == BasicQuery.MY_OPEN_CHANGESETS) {
    283283                cbMyChangesetsOnly.setSelected(true);
    284284                cbMyChangesetsOnly.setEnabled(false);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java

    r14143 r14214  
    237237            Way way = (Way) getMemberTableModel().getReferredPrimitive(getSelectedRows()[0]);
    238238            if (!connectionType.linkPrev) {
    239                 getLayer().data.setSelected(WayConnectionType.Direction.FORWARD.equals(connectionType.direction)
     239                getLayer().data.setSelected(WayConnectionType.Direction.FORWARD == connectionType.direction
    240240                        ? way.firstNode() : way.lastNode());
    241241                AutoScaleAction.autoScale("selection");
    242242            } else if (!connectionType.linkNext) {
    243                 getLayer().data.setSelected(WayConnectionType.Direction.FORWARD.equals(connectionType.direction)
     243                getLayer().data.setSelected(WayConnectionType.Direction.FORWARD == connectionType.direction
    244244                        ? way.lastNode() : way.firstNode());
    245245                AutoScaleAction.autoScale("selection");
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserModel.java

    r13559 r14214  
    109109        return relation != null && !relation.isNew()
    110110                && !relation.getDataSet().isLocked()
    111                 && !DownloadPolicy.BLOCKED.equals(relation.getDataSet().getDownloadPolicy());
     111                && DownloadPolicy.BLOCKED != relation.getDataSet().getDownloadPolicy();
    112112    }
    113113
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorAction.java

    r14121 r14214  
    9494        DataSet ds = editorAccess.getEditor().getRelation().getDataSet();
    9595        return !NetworkManager.isOffline(OnlineResource.OSM_API) && ds != null && !ds.isLocked()
    96                 && !DownloadPolicy.BLOCKED.equals(ds.getDownloadPolicy());
     96                && DownloadPolicy.BLOCKED != ds.getDownloadPolicy();
    9797    }
    9898
  • trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java

    r13852 r14214  
    295295        LatLonViewer(HistoryBrowserModel model, PointInTimeType role) {
    296296            this.updater = new Updater(model, role);
    297             this.modifiedColor = PointInTimeType.CURRENT_POINT_IN_TIME.equals(role)
     297            this.modifiedColor = PointInTimeType.CURRENT_POINT_IN_TIME == role
    298298                    ? TwoColumnDiff.Item.DiffItemType.INSERTED.getColor()
    299299                    : TwoColumnDiff.Item.DiffItemType.DELETED.getColor();
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java

    r10611 r14214  
    120120        tpViewers.setTitleAt(0, tr("Tags"));
    121121
    122         if (history.getEarliest().getType().equals(OsmPrimitiveType.NODE)) {
     122        if (history.getEarliest().getType() == OsmPrimitiveType.NODE) {
    123123            tpViewers.add(coordinateInfoViewer);
    124124            tpViewers.setTitleAt(1, tr("Coordinates"));
    125         } else if (history.getEarliest().getType().equals(OsmPrimitiveType.WAY)) {
     125        } else if (history.getEarliest().getType() == OsmPrimitiveType.WAY) {
    126126            tpViewers.add(nodeListViewer);
    127127            tpViewers.setTitleAt(1, tr("Nodes"));
    128         } else if (history.getEarliest().getType().equals(OsmPrimitiveType.RELATION)) {
     128        } else if (history.getEarliest().getType() == OsmPrimitiveType.RELATION) {
    129129            tpViewers.add(relationMemberListViewer);
    130130            tpViewers.setTitleAt(1, tr("Members"));
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java

    r14143 r14214  
    245245    public TagTableModel getTagTableModel(PointInTimeType pointInTimeType) {
    246246        CheckParameterUtil.ensureParameterNotNull(pointInTimeType, "pointInTimeType");
    247         if (pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME))
     247        if (pointInTimeType == PointInTimeType.CURRENT_POINT_IN_TIME)
    248248            return currentTagTableModel;
    249249        else // REFERENCE_POINT_IN_TIME
     
    260260    public DiffTableModel getNodeListTableModel(PointInTimeType pointInTimeType) {
    261261        CheckParameterUtil.ensureParameterNotNull(pointInTimeType, "pointInTimeType");
    262         if (pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME))
     262        if (pointInTimeType == PointInTimeType.CURRENT_POINT_IN_TIME)
    263263            return currentNodeListTableModel;
    264264        else // REFERENCE_POINT_IN_TIME
     
    275275    public DiffTableModel getRelationMemberTableModel(PointInTimeType pointInTimeType) {
    276276        CheckParameterUtil.ensureParameterNotNull(pointInTimeType, "pointInTimeType");
    277         if (pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME))
     277        if (pointInTimeType == PointInTimeType.CURRENT_POINT_IN_TIME)
    278278            return currentRelationMemberTableModel;
    279279        else // REFERENCE_POINT_IN_TIME
     
    367367    public HistoryOsmPrimitive getPointInTime(PointInTimeType type) {
    368368        CheckParameterUtil.ensureParameterNotNull(type, "type");
    369         if (type.equals(PointInTimeType.CURRENT_POINT_IN_TIME))
     369        if (type == PointInTimeType.CURRENT_POINT_IN_TIME)
    370370            return current;
    371         else if (type.equals(PointInTimeType.REFERENCE_POINT_IN_TIME))
     371        else if (type == PointInTimeType.REFERENCE_POINT_IN_TIME)
    372372            return reference;
    373373
  • trunk/src/org/openstreetmap/josm/gui/history/PointInTimeType.java

    r6827 r14214  
    1919     */
    2020    public PointInTimeType opposite() {
    21         if (this.equals(REFERENCE_POINT_IN_TIME))
     21        if (this == REFERENCE_POINT_IN_TIME)
    2222            return CURRENT_POINT_IN_TIME;
    2323        else
  • trunk/src/org/openstreetmap/josm/gui/history/TagTableModel.java

    r11647 r14214  
    129129     */
    130130    public boolean isCurrentPointInTime() {
    131         return pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME);
     131        return pointInTimeType == PointInTimeType.CURRENT_POINT_IN_TIME;
    132132    }
    133133
     
    137137     */
    138138    public boolean isReferencePointInTime() {
    139         return pointInTimeType.equals(PointInTimeType.REFERENCE_POINT_IN_TIME);
     139        return pointInTimeType == PointInTimeType.REFERENCE_POINT_IN_TIME;
    140140    }
    141141
  • trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java

    r14153 r14214  
    8989        GuiHelper.runInEDTAndWait(() -> {
    9090            CredentialDialog dialog;
    91             if (requestorType.equals(RequestorType.PROXY))
     91            if (requestorType == RequestorType.PROXY)
    9292                dialog = getHttpProxyCredentialDialog(
    9393                        username, password, host, agent.getSaveUsernameAndPasswordCheckboxText());
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersModel.java

    r12452 r14214  
    213213    public boolean hasUnsavedData() {
    214214        for (SaveLayerInfo info: layerInfo) {
    215             if (info.isDoUploadToServer() && !UploadOrSaveState.OK.equals(info.getUploadState()))
     215            if (info.isDoUploadToServer() && UploadOrSaveState.OK != info.getUploadState())
    216216                return true;
    217             if (info.isDoSaveToFile() && !UploadOrSaveState.OK.equals(info.getSaveState()))
     217            if (info.isDoSaveToFile() && UploadOrSaveState.OK != info.getSaveState())
    218218                return true;
    219219        }
     
    224224        int ret = 0;
    225225        for (SaveLayerInfo info: layerInfo) {
    226             if (UploadOrSaveState.CANCELED.equals(info.getSaveState())
    227                     || UploadOrSaveState.CANCELED.equals(info.getUploadState())) {
     226            if (UploadOrSaveState.CANCELED == info.getSaveState()
     227                    || UploadOrSaveState.CANCELED == info.getUploadState()) {
    228228                ret++;
    229229            }
     
    235235        int ret = 0;
    236236        for (SaveLayerInfo info: layerInfo) {
    237             if (UploadOrSaveState.FAILED.equals(info.getSaveState())
    238                     || UploadOrSaveState.FAILED.equals(info.getUploadState())) {
     237            if (UploadOrSaveState.FAILED == info.getSaveState()
     238                    || UploadOrSaveState.FAILED == info.getUploadState()) {
    239239                ret++;
    240240            }
  • trunk/src/org/openstreetmap/josm/gui/io/UploadAndSaveProgressRenderer.java

    r12452 r14214  
    8686    public void propertyChange(PropertyChangeEvent evt) {
    8787        if (evt.getPropertyName().equals(SaveLayersModel.MODE_PROP)) {
    88             setVisible(Mode.UPLOADING_AND_SAVING.equals(evt.getNewValue()));
     88            setVisible(Mode.UPLOADING_AND_SAVING == evt.getNewValue());
    8989        }
    9090        getParent().validate();
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r14153 r14214  
    559559
    560560            UploadStrategySpecification strategy = dialog.getUploadStrategySpecification();
    561             if (strategy.getStrategy().equals(UploadStrategy.CHUNKED_DATASET_STRATEGY)
     561            if (strategy.getStrategy() == UploadStrategy.CHUNKED_DATASET_STRATEGY
    562562                    && strategy.getChunkSize() == UploadStrategySpecification.UNSPECIFIED_CHUNK_SIZE) {
    563563                warnIllegalChunkSize();
  • trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java

    r13654 r14214  
    7373    protected OsmPrimitive getPrimitive(OsmPrimitiveType type, long id) {
    7474        for (OsmPrimitive p: toUpload) {
    75             if (OsmPrimitiveType.from(p).equals(type) && p.getId() == id)
     75            if (OsmPrimitiveType.from(p) == type && p.getId() == id)
    7676                return p;
    7777        }
  • trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java

    r14153 r14214  
    161161            return false;
    162162        }
    163         if (strategy.getPolicy() == null || strategy.getPolicy().equals(MaxChangesetSizeExceededPolicy.ABORT)) {
     163        if (strategy.getPolicy() == null || strategy.getPolicy() == MaxChangesetSizeExceededPolicy.ABORT) {
    164164            strategy.setPolicy(askMaxChangesetSizeExceedsPolicy());
    165165        }
     
    355355            if (lastException instanceof ChangesetClosedException) {
    356356                ChangesetClosedException e = (ChangesetClosedException) lastException;
    357                 if (e.getSource().equals(ChangesetClosedException.Source.UPDATE_CHANGESET)) {
     357                if (e.getSource() == ChangesetClosedException.Source.UPDATE_CHANGESET) {
    358358                    handleFailedUpload(lastException);
    359359                    return;
     
    362362                    /* do nothing if unknown policy */
    363363                    return;
    364                 if (e.getSource().equals(ChangesetClosedException.Source.UPLOAD_DATA)) {
     364                if (e.getSource() == ChangesetClosedException.Source.UPLOAD_DATA) {
    365365                    switch(strategy.getPolicy()) {
    366366                    case ABORT:
  • trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java

    r12846 r14214  
    256256        rbStrategy.get(strategy.getStrategy()).setSelected(true);
    257257        tfChunkSize.setEnabled(strategy.getStrategy() == UploadStrategy.CHUNKED_DATASET_STRATEGY);
    258         if (strategy.getStrategy().equals(UploadStrategy.CHUNKED_DATASET_STRATEGY)) {
     258        if (strategy.getStrategy() == UploadStrategy.CHUNKED_DATASET_STRATEGY) {
    259259            if (strategy.getChunkSize() != UploadStrategySpecification.UNSPECIFIED_CHUNK_SIZE) {
    260260                tfChunkSize.setText(Integer.toString(strategy.getChunkSize()));
  • trunk/src/org/openstreetmap/josm/gui/mappaint/Environment.java

    r13810 r14214  
    230230     */
    231231    public boolean isLinkContext() {
    232         return Context.LINK.equals(context);
     232        return Context.LINK == context;
    233233    }
    234234
     
    256256     */
    257257    public String getRole() {
    258         if (getContext().equals(Context.PRIMITIVE))
     258        if (getContext() == Context.PRIMITIVE)
    259259            return null;
    260260
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java

    r14007 r14214  
    6464                }
    6565            }
    66             if (!considerValAsKey && op.equals(Op.EQ))
     66            if (!considerValAsKey && op == Op.EQ)
    6767                return new SimpleKeyValueCondition(k, v);
    6868            return new KeyValueCondition(k, v, op, considerValAsKey);
     
    362362        @Override
    363363        public boolean applies(Environment env) {
    364             if (Op.REGEX.equals(op)) {
     364            if (Op.REGEX == op) {
    365365                return matches(env);
    366             } else if (Op.NREGEX.equals(op)) {
     366            } else if (Op.NREGEX == op) {
    367367                return !matches(env);
    368368            } else {
     
    527527            this.negateResult = negateResult;
    528528            this.matchType = matchType == null ? KeyMatchType.EQ : matchType;
    529             this.containsPattern = KeyMatchType.REGEX.equals(matchType)
     529            this.containsPattern = KeyMatchType.REGEX == matchType
    530530                    ? Pattern.compile(label).asPredicate()
    531531                    : null;
     
    565565        public Tag asTag(OsmPrimitive p) {
    566566            String key = label;
    567             if (KeyMatchType.REGEX.equals(matchType)) {
     567            if (KeyMatchType.REGEX == matchType) {
    568568                key = p.keySet().stream().filter(containsPattern).findAny().orElse(key);
    569569            }
     
    801801         */
    802802        public static PseudoClassCondition createPseudoClassCondition(String id, boolean not, Context context) {
    803             CheckParameterUtil.ensureThat(!"sameTags".equals(id) || Context.LINK.equals(context), "sameTags only supported in LINK context");
     803            CheckParameterUtil.ensureThat(!"sameTags".equals(id) || Context.LINK == context, "sameTags only supported in LINK context");
    804804            if ("open_end".equals(id)) {
    805805                return new OpenEndPseudoClassCondition(not);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r13936 r14214  
    317317                return false;
    318318
    319             if (ChildOrParentSelectorType.ELEMENT_OF.equals(type)) {
     319            if (ChildOrParentSelectorType.ELEMENT_OF == type) {
    320320
    321321                if (e.osm instanceof INode || e.osm.getDataSet() == null) {
     
    364364                return e.child != null;
    365365
    366             } else if (ChildOrParentSelectorType.CROSSING.equals(type) && e.osm instanceof IWay) {
     366            } else if (ChildOrParentSelectorType.CROSSING == type && e.osm instanceof IWay) {
    367367                e.parent = e.osm;
    368368                final CrossingFinder crossingFinder = new CrossingFinder(e);
     
    372372                }
    373373                return e.child != null;
    374             } else if (ChildOrParentSelectorType.SIBLING.equals(type)) {
     374            } else if (ChildOrParentSelectorType.SIBLING == type) {
    375375                if (e.osm instanceof INode) {
    376376                    for (IPrimitive ref : e.osm.getReferrers(true)) {
     
    392392                    }
    393393                }
    394             } else if (ChildOrParentSelectorType.CHILD.equals(type)
     394            } else if (ChildOrParentSelectorType.CHILD == type
    395395                    && link.conds != null && !link.conds.isEmpty()
    396396                    && link.conds.get(0) instanceof OpenEndPseudoClassCondition) {
     
    399399                    return e.parent != null;
    400400                }
    401             } else if (ChildOrParentSelectorType.CHILD.equals(type)) {
     401            } else if (ChildOrParentSelectorType.CHILD == type) {
    402402                MatchingReferrerFinder collector = new MatchingReferrerFinder(e);
    403403                e.osm.visitReferrers(collector);
    404404                if (e.parent != null)
    405405                    return true;
    406             } else if (ChildOrParentSelectorType.PARENT.equals(type)) {
     406            } else if (ChildOrParentSelectorType.PARENT == type) {
    407407                if (e.osm instanceof IWay) {
    408408                    List<? extends INode> wayNodes = ((IWay<?>) e.osm).getNodes();
     
    451451        @Override
    452452        public String toString() {
    453             return left.toString() + ' ' + (ChildOrParentSelectorType.PARENT.equals(type) ? '<' : '>') + link + ' ' + right;
     453            return left.toString() + ' ' + (ChildOrParentSelectorType.PARENT == type ? '<' : '>') + link + ' ' + right;
    454454        }
    455455    }
     
    619619            if ("*".equals(base)) {
    620620                return true;
    621             } else if (OsmPrimitiveType.NODE.equals(type)) {
     621            } else if (OsmPrimitiveType.NODE == type) {
    622622                return "node".equals(base);
    623             } else if (OsmPrimitiveType.WAY.equals(type)) {
     623            } else if (OsmPrimitiveType.WAY == type) {
    624624                return "way".equals(base) || "area".equals(base);
    625             } else if (OsmPrimitiveType.RELATION.equals(type)) {
     625            } else if (OsmPrimitiveType.RELATION == type) {
    626626                return "area".equals(base) || "relation".equals(base) || "canvas".equals(base);
    627627            }
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r14153 r14214  
    143143
    144144        this.sourceType = sourceType;
    145         this.canEnable = sourceType.equals(SourceType.MAP_PAINT_STYLE) || sourceType.equals(SourceType.TAGCHECKER_RULE);
     145        this.canEnable = sourceType == SourceType.MAP_PAINT_STYLE || sourceType == SourceType.TAGCHECKER_RULE;
    146146
    147147        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
     
    211211        MoveUpDownAction moveUp = null;
    212212        MoveUpDownAction moveDown = null;
    213         if (sourceType.equals(SourceType.MAP_PAINT_STYLE)) {
     213        if (sourceType == SourceType.MAP_PAINT_STYLE) {
    214214            moveUp = new MoveUpDownAction(false);
    215215            moveDown = new MoveUpDownAction(true);
     
    288288        sideButtonTB.add(removeActiveSourcesAction);
    289289        sideButtonTB.addSeparator(new Dimension(12, 30));
    290         if (sourceType.equals(SourceType.MAP_PAINT_STYLE)) {
     290        if (sourceType == SourceType.MAP_PAINT_STYLE) {
    291291            sideButtonTB.add(moveUp);
    292292            sideButtonTB.add(moveDown);
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java

    r13063 r14214  
    272272        tfProxySocksPort.setText(Config.getPref().get(DefaultProxySelector.PROXY_SOCKS_PORT, ""));
    273273
    274         if (pp.equals(ProxyPolicy.USE_SYSTEM_SETTINGS) && !DefaultProxySelector.willJvmRetrieveSystemProxies()) {
     274        if (pp == ProxyPolicy.USE_SYSTEM_SETTINGS && !DefaultProxySelector.willJvmRetrieveSystemProxies()) {
    275275            Logging.warn(tr("JOSM is configured to use proxies from the system setting, but the JVM is not configured to retrieve them. " +
    276276                         "Resetting preferences to ''No proxy''"));
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Check.java

    r13206 r14214  
    7474
    7575        final List<QuadStateCheckBox.State> allowedStates = new ArrayList<>(4);
    76         if (QuadStateCheckBox.State.PARTIAL.equals(initialState))
     76        if (QuadStateCheckBox.State.PARTIAL == initialState)
    7777            allowedStates.add(QuadStateCheckBox.State.PARTIAL);
    7878        allowedStates.add(QuadStateCheckBox.State.SELECTED);
  • trunk/src/org/openstreetmap/josm/io/AbstractParser.java

    r13762 r14214  
    129129        Date timestamp = DateUtils.fromString(v);
    130130        HistoryOsmPrimitive primitive = null;
    131         if (type.equals(OsmPrimitiveType.NODE)) {
     131        if (type == OsmPrimitiveType.NODE) {
    132132            Double lat = getAttributeDouble(atts, "lat");
    133133            Double lon = getAttributeDouble(atts, "lon");
     
    135135            primitive = new HistoryNode(id, version, visible, user, changesetId, timestamp, coor, changeset != null);
    136136
    137         } else if (type.equals(OsmPrimitiveType.WAY)) {
     137        } else if (type == OsmPrimitiveType.WAY) {
    138138            primitive = new HistoryWay(id, version, visible, user, changesetId, timestamp, changeset != null);
    139         } else if (type.equals(OsmPrimitiveType.RELATION)) {
     139        } else if (type == OsmPrimitiveType.RELATION) {
    140140            primitive = new HistoryRelation(id, version, visible, user, changesetId, timestamp, changeset != null);
    141141        }
  • trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java

    r13647 r14214  
    141141        int port = parseProxyPortValue(PROXY_HTTP_PORT, Config.getPref().get(PROXY_HTTP_PORT, null));
    142142        httpProxySocketAddress = null;
    143         if (proxyPolicy.equals(ProxyPolicy.USE_HTTP_PROXY)) {
     143        if (proxyPolicy == ProxyPolicy.USE_HTTP_PROXY) {
    144144            if (host != null && !host.trim().isEmpty() && port > 0) {
    145145                httpProxySocketAddress = new InetSocketAddress(host, port);
     
    153153        port = parseProxyPortValue(PROXY_SOCKS_PORT, Config.getPref().get(PROXY_SOCKS_PORT, null));
    154154        socksProxySocketAddress = null;
    155         if (proxyPolicy.equals(ProxyPolicy.USE_SOCKS_PROXY)) {
     155        if (proxyPolicy == ProxyPolicy.USE_SOCKS_PROXY) {
    156156            if (host != null && !host.trim().isEmpty() && port > 0) {
    157157                socksProxySocketAddress = new InetSocketAddress(host, port);
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r12846 r14214  
    194194        for (RelationMember member : !recursesDown() ? relation.getMembers() : Collections.<RelationMember>emptyList()) {
    195195            // avoid infinite recursion in case of cyclic dependencies in relations
    196             if (OsmPrimitiveType.from(member.getMember()).equals(OsmPrimitiveType.RELATION)
     196            if (OsmPrimitiveType.from(member.getMember()) == OsmPrimitiveType.RELATION
    197197                    && relations.contains(member.getMember().getId())) {
    198198                continue;
  • trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java

    r13493 r14214  
    191191        try {
    192192            Collection<Way> waysToCheck = new ArrayList<>(ds.getWays());
    193             if (isReadFull() || primitiveType.equals(OsmPrimitiveType.NODE)) {
     193            if (isReadFull() || primitiveType == OsmPrimitiveType.NODE) {
    194194                for (Way way: waysToCheck) {
    195195                    if (!way.isNew() && way.hasIncompleteNodes()) {
     
    234234            progressMonitor.beginTask(null, 3);
    235235            DataSet ret = new DataSet();
    236             if (primitiveType.equals(OsmPrimitiveType.NODE)) {
     236            if (primitiveType == OsmPrimitiveType.NODE) {
    237237                DataSet ds = getReferringWays(progressMonitor.createSubTaskMonitor(1, false));
    238238                DataSetMerger visitor = new DataSetMerger(ret, ds);
  • trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java

    r12713 r14214  
    121121              .append('/')
    122122              .append(id.getUniqueId());
    123             if (full && !id.getType().equals(OsmPrimitiveType.NODE)) {
     123            if (full && id.getType() != OsmPrimitiveType.NODE) {
    124124                sb.append("/full");
    125125            } else if (version > 0) {
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r13766 r14214  
    180180     */
    181181    public void writeContent(DataSet ds) {
    182         setWithVisible(UploadPolicy.NORMAL.equals(ds.getUploadPolicy()));
     182        setWithVisible(UploadPolicy.NORMAL == ds.getUploadPolicy());
    183183        writeNodes(ds.getNodes());
    184184        writeWays(ds.getWays());
  • trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java

    r14086 r14214  
    292292    static SearchResult searchName(List<SearchResult> results) {
    293293        return results.stream().filter(
    294                 x -> !OsmPrimitiveType.NODE.equals(x.getOsmId().getType())).iterator().next();
     294                x -> OsmPrimitiveType.NODE != x.getOsmId().getType()).iterator().next();
    295295    }
    296296
  • trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java

    r12620 r14214  
    4444            if (OsmApi.isUsingOAuth()
    4545                    && Objects.equals(OsmApi.getOsmApi().getHost(), getRequestingHost())
    46                     && RequestorType.SERVER.equals(getRequestorType())) {
     46                    && RequestorType.SERVER == getRequestorType()) {
    4747                // if we are working with OAuth we don't prompt for a password
    4848                return null;
     
    5555                return null;
    5656            }
    57             if (RequestorType.PROXY.equals(getRequestorType())) {
     57            if (RequestorType.PROXY == getRequestorType()) {
    5858                // Query user in case this authenticator is called (indicating that the authentication failed) the next time.
    5959                failedCredentials.add(hostTypePair);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java

    r12636 r14214  
    5050    protected static ImageryInfo findBingEntry() {
    5151        for (ImageryInfo i : ImageryLayerInfo.instance.getDefaultLayers()) {
    52             if (ImageryType.BING.equals(i.getImageryType())) {
     52            if (ImageryType.BING == i.getImageryType()) {
    5353                return i;
    5454            }
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r14121 r14214  
    314314                compression = Compression.forContentType(contentType);
    315315            }
    316             if (uncompressAccordingToContentDisposition && Compression.NONE.equals(compression)) {
     316            if (uncompressAccordingToContentDisposition && Compression.NONE == compression) {
    317317                final String contentDisposition = getHeaderField("Content-Disposition");
    318318                final Matcher matcher = Pattern.compile("filename=\"([^\"]+)\"").matcher(
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r14145 r14214  
    15361536
    15371537        // Check if the presets have icons for nodes/relations.
    1538         if (!OsmPrimitiveType.WAY.equals(primitive.getType())) {
     1538        if (OsmPrimitiveType.WAY != primitive.getType()) {
    15391539            final Collection<TaggingPreset> presets = new TreeSet<>((o1, o2) -> {
    15401540                final int o1TypesSize = o1.types == null || o1.types.isEmpty() ? Integer.MAX_VALUE : o1.types.size();
Note: See TracChangeset for help on using the changeset viewer.