Ticket #6254: 6254.patch

File 6254.patch, 1.1 KB (added by simon04, 15 years ago)
  • src/org/openstreetmap/josm/data/osm/TagCollection.java

     
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    66import java.util.ArrayList;
     7import java.util.Arrays;
    78import java.util.Collection;
    89import java.util.Collections;
    910import java.util.HashMap;
     
    707708     * @return the concatenation of all tag values
    708709     */
    709710    public String getJoinedValues(String key) {
    710         StringBuffer buffer = new StringBuffer();
    711         List<String> values = new ArrayList<String>(getValues(key));
     711        StringBuilder buffer = new StringBuilder();
     712        HashSet<String> valSet = new HashSet<String>();
     713        for (String vs : getValues(key)) {
     714            valSet.addAll(Arrays.asList(vs.split(";")));
     715        }
     716        List<String> values = new ArrayList<String>(valSet);
    712717        values.remove("");
    713718        Collections.sort(values);
    714719        Iterator<String> iter = values.iterator();