Ignore:
Timestamp:
2016-12-14T04:19:09+01:00 (7 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/data/preferences/ListListSetting.java

    r10235 r11394  
    55import java.util.Collection;
    66import java.util.Collections;
    7 import java.util.Iterator;
    87import java.util.List;
    9 
    10 import org.openstreetmap.josm.tools.Utils;
    118
    129/**
     
    3936        }
    4037        return new ListListSetting(null);
    41     }
    42 
    43     @Override
    44     public boolean equalVal(List<List<String>> otherVal) {
    45         if (value == null)
    46             return otherVal == null;
    47         if (otherVal == null)
    48             return false;
    49         if (value.size() != otherVal.size())
    50             return false;
    51         Iterator<List<String>> itA = value.iterator();
    52         Iterator<List<String>> itB = otherVal.iterator();
    53         while (itA.hasNext()) {
    54             if (!Utils.equalCollection(itA.next(), itB.next()))
    55                 return false;
    56         }
    57         return true;
    5838    }
    5939
     
    9272        return new ListListSetting(null);
    9373    }
    94 
    95     @Override
    96     public boolean equals(Object other) {
    97         if (!(other instanceof ListListSetting))
    98             return false;
    99         return equalVal(((ListListSetting) other).getValue());
    100     }
    10174}
Note: See TracChangeset for help on using the changeset viewer.