Changeset 11394 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-12-14T04:19:09+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r11374 r11394 42 42 import java.util.List; 43 43 import java.util.Locale; 44 import java.util.Objects;45 44 import java.util.concurrent.Executor; 46 45 import java.util.concurrent.ForkJoinPool; … … 524 523 public static boolean equalsEpsilon(double a, double b) { 525 524 return Math.abs(a - b) <= EPSILON; 526 }527 528 /**529 * Determines if two collections are equal.530 * @param a first collection531 * @param b second collection532 * @return {@code true} if collections are equal, {@code false} otherwise533 * @since 9217534 */535 public static boolean equalCollection(Collection<?> a, Collection<?> b) {536 if (a == null) return b == null;537 if (b == null) return false;538 if (a.size() != b.size()) return false;539 Iterator<?> itA = a.iterator();540 Iterator<?> itB = b.iterator();541 while (itA.hasNext()) {542 if (!Objects.equals(itA.next(), itB.next()))543 return false;544 }545 return true;546 525 } 547 526
Note: See TracChangeset
for help on using the changeset viewer.