Changeset 5822 in josm


Ignore:
Timestamp:
2013-04-02T02:26:07+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #8546 - Validator do not detect errors named identically (partial revert of r5783, reopens #8517). This is due to TreeMap that uses compareTo() instead of equals() (see Javadoc)

File:
1 edited

Legend:

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

    r5783 r5822  
    55import java.util.Collection;
    66import java.util.HashMap;
     7import java.util.LinkedHashSet;
    78import java.util.List;
    89import java.util.Map;
    910import java.util.Map.Entry;
    1011import java.util.Set;
    11 import java.util.TreeSet;
    1212
    1313/**
     
    3838        Set<B> vals = map.get(key);
    3939        if (vals == null) {
    40             vals = new TreeSet<B>();
     40            vals = new LinkedHashSet<B>();
    4141            map.put(key, vals);
    4242        }
     
    5353        if (map.containsKey(key))
    5454            return;
    55         map.put(key, new TreeSet<B>());
     55        map.put(key, new LinkedHashSet<B>());
    5656    }
    5757
     
    6464        Set<B> vals = map.get(key);
    6565        if (vals == null) {
    66             vals = new TreeSet<B>(values);
     66            vals = new LinkedHashSet<B>(values);
    6767            map.put(key, vals);
    6868        }
     
    9393    public Set<B> getValues(A key) {
    9494        if (!map.containsKey(key))
    95             return new TreeSet<B>();
     95            return new LinkedHashSet<B>();
    9696        return map.get(key);
    9797    }
Note: See TracChangeset for help on using the changeset viewer.