Skip to content

Commit 606e924

Browse files
committed
Clarify non-capturing lambda review guidance
1 parent 091f650 commit 606e924

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/agents/code-review-and-fix.agent.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ Auto-fix boundaries:
304304
- Never change:
305305
- literal type suffixes (e.g., `200``200L` or vice-versa) — Java widens
306306
automatically; both forms compile identically and the change is noise
307-
- non-capturing lambdas or method references as unnecessary allocations; do not flag or
308-
fix these, because on modern JDKs these are typically cached at the call site rather
309-
than allocated on every invocation
307+
- non-capturing lambdas or method references as allocation issues; do not flag,
308+
fix, or justify changes to these as per-call allocations. On HotSpot /
309+
OpenJDK 8+, these are cached at the call site.
310310

311311
Output content rules:
312312

.github/agents/code-review.agent.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ For each file in scope:
9191
- PR mode: changed lines only
9292
- File/directory mode: all lines
9393
4. Apply checklist rules (below) and insert comments above offending lines.
94-
5. Do not flag a non-capturing lambda or method reference as an unnecessary allocation,
95-
because on modern JDKs these are typically cached at the call site rather than
96-
allocated on every invocation.
94+
5. Do not flag a non-capturing lambda or method reference as an allocation issue.
95+
On HotSpot / OpenJDK 8+, these are cached at the call site.
9796
6. Flag a missing version-boundary comment on a single-class `hasClassesNamed(...)`
9897
check in `classLoaderMatcher()` only after validating the stated boundary from
9998
repository or upstream evidence. Use `// added in X.Y` for a pure lower bound.

.github/agents/knowledge/general-rules.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ Read and apply `docs/contributing/style-guide.md`.
7575
Do not flag the following patterns (common false positives):
7676

7777
- FQCN is acceptable when class-name collision makes import impossible.
78+
- Do not claim that a Java non-capturing lambda or method reference allocates per
79+
call. On HotSpot / OpenJDK 8+, these are cached at the call site.
7880

7981
## [Style] Visibility modifiers
8082

0 commit comments

Comments
 (0)