Changeset 11097 in josm for trunk


Ignore:
Timestamp:
2016-10-08T02:45:48+02:00 (3 years ago)
Author:
Don-vip
Message:

sonar - squid:S1612 - Lambdas should be replaced with method references

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java

    r10972 r11097  
    535535     */
    536536    public Set<String> getValues() {
    537         return tags.keySet().stream().map(e -> e.getValue()).collect(Collectors.toSet());
     537        return tags.keySet().stream().map(Tag::getValue).collect(Collectors.toSet());
    538538    }
    539539
     
    548548    public Set<String> getValues(String key) {
    549549        // null-safe
    550         return generateStreamForKey(key).map(e -> e.getValue()).collect(Collectors.toSet());
     550        return generateStreamForKey(key).map(Tag::getValue).collect(Collectors.toSet());
    551551    }
    552552
     
    737737
    738738    private Stream<String> generateKeyStream() {
    739         return tags.keySet().stream().map(tag -> tag.getKey());
     739        return tags.keySet().stream().map(Tag::getKey);
    740740    }
    741741
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r10880 r11097  
    180180        Map<Severity, Map<String, Map<String, List<TestError>>>> errorTreeDeep
    181181            = errors.stream().filter(filterToUse).collect(
    182                     Collectors.groupingBy(e -> e.getSeverity(), () -> new EnumMap<>(Severity.class),
     182                    Collectors.groupingBy(TestError::getSeverity, () -> new EnumMap<>(Severity.class),
    183183                            Collectors.groupingBy(e -> e.getDescription() == null ? "" : e.getDescription(),
    184                                     Collectors.groupingBy(e -> e.getMessage()))));
     184                                    Collectors.groupingBy(TestError::getMessage))));
    185185
    186186        List<TreePath> expandedPaths = new ArrayList<>();
  • trunk/src/org/openstreetmap/josm/gui/layer/CustomizeColor.java

    r10824 r11097  
    6666    @Override
    6767    public void actionPerformed(ActionEvent e) {
    68         Color cl = colors.stream().map(c -> c.get()).filter(Objects::nonNull).findAny().orElse(Color.GRAY);
     68        Color cl = colors.stream().map(AbstractProperty::get).filter(Objects::nonNull).findAny().orElse(Color.GRAY);
    6969        JColorChooser c = new JColorChooser(cl);
    7070        Object[] options = new Object[]{tr("OK"), tr("Cancel"), tr("Default")};
Note: See TracChangeset for help on using the changeset viewer.