Ignore:
Timestamp:
2016-12-14T04:19:09+01:00 (3 years ago)
Author:
Don-vip
Message:

simplify preference settings equals handling (already performed by AbstractList.equals / AbstractMap.equals) - fixes squid:S1206 and findbugs HE_EQUALS_NO_HASHCODE warnings

File:
1 edited

Legend:

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

    r11374 r11394  
    4242import java.util.List;
    4343import java.util.Locale;
    44 import java.util.Objects;
    4544import java.util.concurrent.Executor;
    4645import java.util.concurrent.ForkJoinPool;
     
    524523    public static boolean equalsEpsilon(double a, double b) {
    525524        return Math.abs(a - b) <= EPSILON;
    526     }
    527 
    528     /**
    529      * Determines if two collections are equal.
    530      * @param a first collection
    531      * @param b second collection
    532      * @return {@code true} if collections are equal, {@code false} otherwise
    533      * @since 9217
    534      */
    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;
    546525    }
    547526
Note: See TracChangeset for help on using the changeset viewer.