Changeset 11132 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2016-10-15T21:45:25+02:00 (8 years ago)
Author:
simon04
Message:

fix #11072 - Sort validator warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r11128 r11132  
    1515import java.util.Map;
    1616import java.util.Set;
     17import java.util.TreeMap;
    1718import java.util.function.Predicate;
    1819import java.util.stream.Collectors;
     
    3435import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;
    3536import org.openstreetmap.josm.gui.util.GuiHelper;
     37import org.openstreetmap.josm.tools.AlphanumComparator;
    3638import org.openstreetmap.josm.tools.Destroyable;
    3739import org.openstreetmap.josm.tools.ListenerList;
     
    180182            = errors.stream().filter(filterToUse).collect(
    181183                    Collectors.groupingBy(TestError::getSeverity, () -> new EnumMap<>(Severity.class),
    182                             Collectors.groupingBy(TestError::getMessage,
    183                                     Collectors.groupingBy(e -> e.getDescription() == null ? "" : e.getDescription()
     184                            Collectors.groupingBy(TestError::getMessage, () -> new TreeMap<>(AlphanumComparator.getInstance()),
     185                                    Collectors.groupingBy(e -> e.getDescription() == null ? "" : e.getDescription(),
     186                                            () -> new TreeMap<>(AlphanumComparator.getInstance()),
     187                                            Collectors.toList()
    184188                                    ))));
    185189
     
    230234                    if (groupNode != null) {
    231235                        msg = tr("{0} ({1})", description, errors.size());
     236                    } else if (description == null || description.isEmpty()) {
     237                        msg = tr("{0} ({1})", message, errors.size());
    232238                    } else {
    233239                        msg = tr("{0} - {1} ({2})", message, description, errors.size());
Note: See TracChangeset for help on using the changeset viewer.