Ignore:
Timestamp:
2014-05-09T06:03:50+02:00 (12 years ago)
Author:
Don-vip
Message:

see #8465 - replace Utils.equal by Objects.equals, new in Java 7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java

    r6280 r7083  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.mappaint;
    3 
    4 import static org.openstreetmap.josm.tools.Utils.equal;
    53
    64import java.awt.BasicStroke;
     
    97import java.awt.Rectangle;
    108import java.awt.Stroke;
     9import java.util.Objects;
    1110
    1211import org.openstreetmap.josm.Main;
     
    2827    public final MapImage mapImage;
    2928    public final Symbol symbol;
    30    
     29
    3130    private Image enabledNodeIcon;
    3231    private Image disabledNodeIcon;
     
    6362            return  symbol == other.symbol &&
    6463                    size == other.size &&
    65                     equal(stroke, other.stroke) &&
    66                     equal(strokeColor, other.strokeColor) &&
    67                     equal(fillColor, other.fillColor);
     64                    Objects.equals(stroke, other.stroke) &&
     65                    Objects.equals(strokeColor, other.strokeColor) &&
     66                    Objects.equals(fillColor, other.fillColor);
    6867        }
    6968
     
    170169        if (shapeKW == null)
    171170            return null;
    172         if (equal(shapeKW.val, "square")) {
     171        if ("square".equals(shapeKW.val)) {
    173172            shape = SymbolShape.SQUARE;
    174         } else if (equal(shapeKW.val, "circle")) {
     173        } else if ("circle".equals(shapeKW.val)) {
    175174            shape = SymbolShape.CIRCLE;
    176         } else if (equal(shapeKW.val, "triangle")) {
     175        } else if ("triangle".equals(shapeKW.val)) {
    177176            shape = SymbolShape.TRIANGLE;
    178         } else if (equal(shapeKW.val, "pentagon")) {
     177        } else if ("pentagon".equals(shapeKW.val)) {
    179178            shape = SymbolShape.PENTAGON;
    180         } else if (equal(shapeKW.val, "hexagon")) {
     179        } else if ("hexagon".equals(shapeKW.val)) {
    181180            shape = SymbolShape.HEXAGON;
    182         } else if (equal(shapeKW.val, "heptagon")) {
     181        } else if ("heptagon".equals(shapeKW.val)) {
    183182            shape = SymbolShape.HEPTAGON;
    184         } else if (equal(shapeKW.val, "octagon")) {
     183        } else if ("octagon".equals(shapeKW.val)) {
    185184            shape = SymbolShape.OCTAGON;
    186         } else if (equal(shapeKW.val, "nonagon")) {
     185        } else if ("nonagon".equals(shapeKW.val)) {
    187186            shape = SymbolShape.NONAGON;
    188         } else if (equal(shapeKW.val, "decagon")) {
     187        } else if ("decagon".equals(shapeKW.val)) {
    189188            shape = SymbolShape.DECAGON;
    190189        } else
     
    356355        final NodeElemStyle other = (NodeElemStyle) obj;
    357356        // we should get the same image object due to caching
    358         if (!equal(mapImage, other.mapImage))
     357        if (!Objects.equals(mapImage, other.mapImage))
    359358            return false;
    360         if (!equal(symbol, other.symbol))
     359        if (!Objects.equals(symbol, other.symbol))
    361360            return false;
    362361        return true;
Note: See TracChangeset for help on using the changeset viewer.