rspec/rules/S3706/java/rule.adoc

14 lines
368 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
There's no need to invoke ``++stream()++`` on a ``++Collection++`` before a ``++forEach++`` call because each ``++Collection++`` has its own ``++forEach++`` method.
== Noncompliant Code Example
----
identifiers.stream().forEach(System.out::println); // Noncompliant
----
== Compliant Solution
----
identifiers.forEach(System.out::println); // Noncompliant
----