File tree Expand file tree Collapse file tree
evals-reference/22-java8-version-scan
skills/java-streams/references Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ Assume Java 8.
77
88In ` review.md ` , start with the exact scan header and hard-stop ` rg ` scan command from the skill
99bundle, including the full marker regex and ` <touched Java files> ` placeholder. Then list each
10- Java-version drift issue and a Java 8-compatible direction. Also mention any stream marker that is
11- allowed on Java 8.
10+ Java-version drift issue and a Java 8-compatible direction. Also mention whether ` activeCount ` is
11+ acceptable Java 8 stream code, and be precise about whether plain ` count() ` is a bundled scan hit .
1212
1313``` java
1414import java.util.List ;
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ Fix these before finalizing:
1616- ` filter(...).count() > 0 ` for existence. Use ` anyMatch ` .
1717- Plain ` count() ` is appropriate when the requested result is a numeric count; do not replace it
1818 with ` anyMatch ` .
19+ The hard-stop scan regex catches only ` count() > 0 ` existence checks, not plain ` count() ` . If an
20+ audit calls out plain ` count() ` as allowed, say it is an allowed usage, not a scan hit.
1921- ` sorted(...).findFirst() ` or sorted-then-sublist just to get one extreme. Use ` min ` /` max ` ; keep
2022 sorting only when the ordered list itself is required.
2123- ` map(...).collect(toList()) ` followed immediately by ` String.join ` . Use ` Collectors.joining ` .
@@ -95,7 +97,8 @@ rg -nUP "count\\(\\)\\s*>\\s*0|collect\\([^;]+\\)\\s*\\.\\s*(?:isEmpty|size|getF
9597For each hit, decide whether it is legitimate for the project Java baseline and behavior. Fix
9698stream-quality issues. If a marker remains because it is legitimate, state why. When an audit asks
9799for allowed stream markers or allowed usages, also call out plain ` count() ` when it is the requested
98- numeric result rather than a ` count() > 0 ` existence check.
100+ numeric result rather than a ` count() > 0 ` existence check, and state that plain ` count() ` is not a
101+ hit for the bundled scan regex.
99102
100103When the requested audit is specifically about Java-version drift, keep the report scoped to APIs
101104that are unavailable for the stated baseline and to explicitly allowed markers. Do not add unrelated
You can’t perform that action at this time.
0 commit comments