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

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

Location:
trunk/src/org/openstreetmap/josm/data
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • 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) {
Note: See TracChangeset for help on using the changeset viewer.