此內容由 AI 產生(specification-mapper 全庫審查 2026-07-16.執行圖)。
Work package WP10 · findings: TEST-03 · worst severity: medium · effort: S
From the 2026-07-16 whole-codebase review of branch jakarta (snapshot 7de4a33; modules mapper/ + starter/). Every finding below is CONFIRMED by independent adversarial verification. File:line coordinates are from the snapshot and may have drifted.
Trimmed since the review. The review's WP10 also carried TEST-05 (nested-AND typo) and TEST-06 (single-threaded concurrency test); both were fixed post-review by PR #187 (verified on jakarta HEAD). Only TEST-03 survives, so this package is reduced to it.
Findings
TEST-03 — Inherited fields of criteria POJOs are silently ignored (doWithLocalFields) and no test pins this contract (testing, medium)
- File:
mapper/src/main/java/tw/com/softleader/data/jpa/spec/ReflectionDatabind.java:80
- Evidence (re-confirmed on
jakarta HEAD): newFieldLookup uses ReflectionUtils.doWithLocalFields(target.getClass(), …), which visits only fields declared on the concrete class — fields inherited from a superclass criteria POJO are never databound. No test in ReflectionDatabindTest exercises a subclass criteria POJO, so the contract (intended or not) is unpinned.
Plan
- Add a test with a criteria POJO that
extends a base criteria class carrying an annotated field, asserting the current behavior: the inherited field is not databound (i.e. pin doWithLocalFields' local-only contract) — so any future switch to doWithFields becomes a deliberate, test-visible decision.
- Add a short Javadoc note on
newFieldLookup stating the local-fields-only contract, so the limitation is discoverable at the source.
Scope note: this pins the current behavior. Whether inherited fields should be databound is a separate behavior-change decision left to the maintainer; this package does not make that change.
Acceptance criteria
- A new
ReflectionDatabindTest case pins the inherited-field behavior and passes.
- Regression:
make test green.
Work package WP10 · findings: TEST-03 · worst severity: medium · effort: S
From the 2026-07-16 whole-codebase review of branch
jakarta(snapshot 7de4a33; modulesmapper/+starter/). Every finding below is CONFIRMED by independent adversarial verification. File:line coordinates are from the snapshot and may have drifted.Findings
TEST-03 — Inherited fields of criteria POJOs are silently ignored (
doWithLocalFields) and no test pins this contract (testing, medium)mapper/src/main/java/tw/com/softleader/data/jpa/spec/ReflectionDatabind.java:80jakartaHEAD):newFieldLookupusesReflectionUtils.doWithLocalFields(target.getClass(), …), which visits only fields declared on the concrete class — fields inherited from a superclass criteria POJO are never databound. No test inReflectionDatabindTestexercises a subclass criteria POJO, so the contract (intended or not) is unpinned.Plan
extendsa base criteria class carrying an annotated field, asserting the current behavior: the inherited field is not databound (i.e. pindoWithLocalFields' local-only contract) — so any future switch todoWithFieldsbecomes a deliberate, test-visible decision.newFieldLookupstating the local-fields-only contract, so the limitation is discoverable at the source.Acceptance criteria
ReflectionDatabindTestcase pins the inherited-field behavior and passes.make testgreen.