Changeset 15735 in josm


Ignore:
Timestamp:
2020-01-19T23:02:10+01:00 (5 years ago)
Author:
simon04
Message:

Java 8: replace .stream().forEach() with .forEach()

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r15657 r15735  
    267267
    268268    private static void setSelection(DataSet ds, Collection<OsmPrimitive> toSet) {
    269         toSet.stream().forEach(x -> updatePreservedFlag(x, true));
     269        toSet.forEach(x -> updatePreservedFlag(x, true));
    270270        ds.setSelected(toSet);
    271271    }
     
    334334        DataSet ds = getLayerManager().getEditDataSet();
    335335        if (ds != null) {
    336             ds.getSelected().stream().forEach(x -> updatePreservedFlag(x, false));
     336            ds.getSelected().forEach(x -> updatePreservedFlag(x, false));
    337337        }
    338338
     
    387387        // Make sure helper line is computed later (causes deadlock in selection event chain otherwise)
    388388        SwingUtilities.invokeLater(() -> {
    389             event.getOldSelection().stream().forEach(x -> updatePreservedFlag(x, false));
    390             event.getSelection().stream().forEach(x -> updatePreservedFlag(x, true));
     389            event.getOldSelection().forEach(x -> updatePreservedFlag(x, false));
     390            event.getSelection().forEach(x -> updatePreservedFlag(x, true));
    391391            if (MainApplication.getMap() != null) {
    392392                computeHelperLine();
  • trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java

    r13173 r15735  
    9797                }
    9898            }
    99             newPrimitives.stream().forEach(p -> p.setModified(true));
     99            newPrimitives.forEach(p -> p.setModified(true));
    100100        } else { // redo
    101101            // When redoing this command, we have to add the same objects, otherwise
  • trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java

    r15716 r15735  
    267267    public void remove(Collection<Tag> tags) {
    268268        if (tags != null) {
    269             tags.stream().forEach(this::remove);
     269            tags.forEach(this::remove);
    270270        }
    271271    }
     
    279279    public void remove(TagCollection tags) {
    280280        if (tags != null) {
    281             tags.tags.keySet().stream().forEach(this::remove);
     281            tags.tags.keySet().forEach(this::remove);
    282282        }
    283283    }
  • trunk/src/org/openstreetmap/josm/gui/layer/CustomizeColor.java

    r15586 r15735  
    8585        switch (answer) {
    8686        case 0:
    87             colorLayers.stream().forEach(l -> l.setColor(c.getColor()));
     87            colorLayers.forEach(l -> l.setColor(c.getColor()));
    8888            break;
    8989        case 1:
    9090            return;
    9191        case 2:
    92             colorLayers.stream().forEach(l -> l.setColor(null));
     92            colorLayers.forEach(l -> l.setColor(null));
    9393            break;
    9494        }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java

    r15586 r15735  
    151151        switch (answer) {
    152152        case 0:
    153             tracks.stream().forEach(t -> t.setColor(c.getColor()));
     153            tracks.forEach(t -> t.setColor(c.getColor()));
    154154            GPXSettingsPanel.putLayerPrefLocal(layer, "colormode", "0"); //set Colormode to none
    155155            break;
     
    157157            return;
    158158        case 2:
    159             tracks.stream().forEach(t -> t.setColor(null));
     159            tracks.forEach(t -> t.setColor(null));
    160160            break;
    161161        }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/CustomizeDrawingAction.java

    r15497 r15735  
    9292        panel.savePreferences();
    9393        MainApplication.getMainPanel().repaint();
    94         layers.stream().forEach(Layer::invalidate);
     94        layers.forEach(Layer::invalidate);
    9595    }
    9696
  • trunk/src/org/openstreetmap/josm/io/ValidatorErrorWriter.java

    r12699 r15735  
    8484                        map.put(errorClass, list);
    8585                    }
    86                     e2.getValue().values().stream().forEach(list::addAll);
     86                    e2.getValue().values().forEach(list::addAll);
    8787                }
    8888            }
  • trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java

    r12770 r15735  
    158158
    159159    private void fireChange() {
    160         listeners.stream().forEach(l -> l.bugReportChanged(this));
     160        listeners.forEach(l -> l.bugReportChanged(this));
    161161    }
    162162
  • trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java

    r15034 r15735  
    179179        // load the data
    180180        DataSet dataSet = testConfig.getOsmDataSet();
    181         dataSet.allPrimitives().stream().forEach(this::loadPrimitiveStyle);
     181        dataSet.allPrimitives().forEach(this::loadPrimitiveStyle);
    182182        dataSet.setSelected(dataSet.allPrimitives().stream().filter(n -> n.isKeyTrue("selected")).collect(Collectors.toList()));
    183183
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.java

    r15591 r15735  
    278278
    279279        tagRegex(way1, "way[ref][count(tag_regex(\"ref\")) > 1] {}", new Boolean[] {true, false, false, true, false});
    280         way1.keySet().stream().forEach(key -> way1.put(key, null));
     280        way1.keySet().forEach(key -> way1.put(key, null));
    281281        way1.put("old_ref", "A1");
    282282        way1.put("ref", "A2");
  • trunk/test/unit/org/openstreetmap/josm/testutils/PluginServer.java

    r14179 r15735  
    8080                try {
    8181                    jarFile = new JarFile(srcJar, false);
    82                     jarFile.getManifest().getMainAttributes().entrySet().stream().forEach(
     82                    jarFile.getManifest().getMainAttributes().entrySet().forEach(
    8383                        entry -> attrs.put(entry.getKey().toString(), entry.getValue().toString())
    8484                    );
Note: See TracChangeset for help on using the changeset viewer.