RFR: 8275242: Remove redundant stream() call before forEach in jdk.compiler
Vicente Romero
vromero at openjdk.java.net
Fri Oct 15 20:16:00 UTC 2021
On Wed, 15 Sep 2021 07:24:35 GMT, Andrey Turbanov <duke at openjdk.java.net> wrote:
> There are several places in the jdk.compiler, jdk.javadoc, jdk.jshell that use stream().forEach(...), these can be cleaned up.
> Instead Collection.forEach or Map.forEach can be used directly.
> This is continuation of
> 1. [JDK-8273710](https://bugs.openjdk.java.net/browse/JDK-8273710) Remove redundant stream() call before forEach in jdk.jdeps
> 2. [JDK-8273711](https://bugs.openjdk.java.net/browse/JDK-8273711) Remove redundant stream() call before forEach in jdk.jlink
src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java line 60:
> 58: import com.sun.tools.javac.tree.JCTree;
> 59: import com.sun.tools.javac.tree.TreeInfo;
> 60: import com.sun.tools.javac.tree.JCTree.JCBlock;
probably IDE generated but I think that it is preferable to let the explicit imports and instead remove the:
`import com.sun.tools.javac.tree.JCTree.*` below
-------------
PR: https://git.openjdk.java.net/jdk/pull/5521
More information about the compiler-dev
mailing list