From 62b69cf99bc85b108649b1bb8c054203921b4b8f Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Sun, 8 Jun 2025 12:56:25 +0700 Subject: [PATCH 1/2] Update Contribution Guidelines About Streams Closes gh-17097 Signed-off-by: Tran Ngoc Nhan --- CONTRIBUTING.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index e0706cea23f..b493f2bd6c1 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -81,6 +81,9 @@ The wiki pages https://github.com/spring-projects/spring-framework/wiki/Code-Sty To format the code as well as check the style, run `./gradlew format && ./gradlew check`. +NOTE: Since the Stream API is https://github.com/spring-projects/spring-security/issues/7154[much slower] than `for` loop, please use it judiciously. +The team may ask you to change it to a `for` loop if the given code is along a hot path. + [[submit-a-pull-request]] === Submit a Pull Request From b9dee9190f478d2a74b4bc9c0926ba711db35a24 Mon Sep 17 00:00:00 2001 From: Josh Cummings <3627351+jzheaux@users.noreply.github.com> Date: Fri, 20 Jun 2025 13:49:36 -0600 Subject: [PATCH 2/2] Polish Stream Advice Issue gh-17097 --- CONTRIBUTING.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index b493f2bd6c1..b992d267bbd 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -79,10 +79,10 @@ See https://github.com/spring-projects/spring-security/tree/main#building-from-s The wiki pages https://github.com/spring-projects/spring-framework/wiki/Code-Style[Code Style] and https://github.com/spring-projects/spring-framework/wiki/IntelliJ-IDEA-Editor-Settings[IntelliJ IDEA Editor Settings] define the source file coding standards we use along with some IDEA editor settings we customize. -To format the code as well as check the style, run `./gradlew format && ./gradlew check`. +Additionally, since Streams are https://github.com/spring-projects/spring-security/issues/7154[much slower] than `for` loops, please use them judiciously. +The team may ask you to change to a `for` loop if the given code is along a hot path. -NOTE: Since the Stream API is https://github.com/spring-projects/spring-security/issues/7154[much slower] than `for` loop, please use it judiciously. -The team may ask you to change it to a `for` loop if the given code is along a hot path. +To format the code as well as check the style, run `./gradlew format && ./gradlew check`. [[submit-a-pull-request]] === Submit a Pull Request