Skip to content

Commit eeedd10

Browse files
fix: clarify count scan precision
1 parent b6fe350 commit eeedd10

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

evals-reference/22-java8-version-scan/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Assume Java 8.
77

88
In `review.md`, start with the exact scan header and hard-stop `rg` scan command from the skill
99
bundle, 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
1414
import java.util.List;

skills/java-streams/references/hard-stops.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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
9597
For each hit, decide whether it is legitimate for the project Java baseline and behavior. Fix
9698
stream-quality issues. If a marker remains because it is legitimate, state why. When an audit asks
9799
for 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

100103
When the requested audit is specifically about Java-version drift, keep the report scoped to APIs
101104
that are unavailable for the stated baseline and to explicitly allowed markers. Do not add unrelated

0 commit comments

Comments
 (0)