Changeset 7083 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2014-05-09T06:03:50+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Predicates.java
r6870 r7083 1 1 package org.openstreetmap.josm.tools; 2 2 3 import java.util.Collection; 4 import java.util.Objects; 5 import java.util.regex.Pattern; 6 3 7 import org.openstreetmap.josm.data.osm.OsmPrimitive; 4 5 import java.util.Collection;6 import java.util.regex.Pattern;7 8 8 9 /** … … 33 34 @Override 34 35 public boolean evaluate(T obj) { 35 return Utils.equal(obj, ref);36 return Objects.equals(obj, ref); 36 37 } 37 38 }; -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r7082 r7083 174 174 } 175 175 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 185 176 public static void ensure(boolean condition, String message, Object...data) { 186 177 if (!condition)
Note: See TracChangeset
for help on using the changeset viewer.