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

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

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Predicates.java

    r6870 r7083  
    11package org.openstreetmap.josm.tools;
    22
     3import java.util.Collection;
     4import java.util.Objects;
     5import java.util.regex.Pattern;
     6
    37import org.openstreetmap.josm.data.osm.OsmPrimitive;
    4 
    5 import java.util.Collection;
    6 import java.util.regex.Pattern;
    78
    89/**
     
    3334            @Override
    3435            public boolean evaluate(T obj) {
    35                 return Utils.equal(obj, ref);
     36                return Objects.equals(obj, ref);
    3637            }
    3738        };
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r7082 r7083  
    174174    }
    175175
    176     /**
    177      * for convenience: test whether 2 objects are either both null or a.equals(b)
    178      */
    179     public static <T> boolean equal(T a, T b) {
    180         if (a == b)
    181             return true;
    182         return (a != null && a.equals(b));
    183     }
    184 
    185176    public static void ensure(boolean condition, String message, Object...data) {
    186177        if (!condition)
Note: See TracChangeset for help on using the changeset viewer.