rspec/rules/S3706/java/rule.adoc

28 lines
562 B
Plaintext

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
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::highlighting.adoc[]
endif::env-github,rspecator-view[]