Ignore:
Timestamp:
2023-07-24T15:55:23+02:00 (2 years ago)
Author:
taylor.smock
Message:

reltoolbox: Clean up a bunch of lint warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/ChosenRelation.java

    r34130 r36102  
    1111import java.awt.geom.GeneralPath;
    1212import java.util.HashSet;
     13import java.util.Objects;
    1314import java.util.Set;
    1415
     
    4142public class ChosenRelation implements ActiveLayerChangeListener, MapViewPaintable, DataSetListener {
    4243    protected Relation chosenRelation = null;
    43     private Set<ChosenRelationListener> chosenRelationListeners = new HashSet<>();
     44    private final Set<ChosenRelationListener> chosenRelationListeners = new HashSet<>();
    4445
    4546    public void set(Relation rel) {
    46         if (rel == chosenRelation || (rel != null && chosenRelation != null && rel.equals(chosenRelation)))
     47        if (Objects.equals(rel, chosenRelation))
    4748            return; // new is the same as old
    4849        Relation oldRel = chosenRelation;
     
    7374            return false;
    7475        else
    75             return chosenRelation != null && r.equals(chosenRelation);
     76            return r.equals(chosenRelation);
    7677    }
    7778
     
    150151        g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f * opacity));
    151152
    152         drawRelations(g, mv, bbox, chosenRelation, new HashSet<Relation>());
     153        drawRelations(g, mv, bbox, chosenRelation, new HashSet<>());
    153154
    154155        g.setComposite(oldComposite);
     
    178179                            }
    179180                            g.draw(b);
    180                         }   break;
     181                        }
     182                        break;
    181183                    case RELATION:
    182184                        Color oldColor = g.getColor();
     
    195197    @Override
    196198    public void relationMembersChanged(RelationMembersChangedEvent event) {
    197         if (chosenRelation != null && event.getRelation().equals(chosenRelation)) {
     199        if (event.getRelation().equals(chosenRelation)) {
    198200            fireRelationChanged(chosenRelation);
    199201        }
     
    202204    @Override
    203205    public void tagsChanged(TagsChangedEvent event) {
    204         if (chosenRelation != null && event.getPrimitive().equals(chosenRelation)) {
     206        if (event.getPrimitive().equals(chosenRelation)) {
    205207            fireRelationChanged(chosenRelation);
    206208        }
Note: See TracChangeset for help on using the changeset viewer.