@@ -13,9 +13,8 @@ Open [references/optional-examples.md](references/optional-examples.md) for work
1313
1414## Core Workflow
1515
16- 1 . Classify the boundary first: fallback, error, side effect, boolean check, collection lookup,
17- checked IO/prompt, or nullable API. Ordinary value flow should start with an Optional terminal,
18- not ` isPresent() ` .
16+ 1 . Classify the boundary first. For ordinary value flow, use an Optional terminal instead of
17+ ` isPresent() ` .
19182 . Use the Optional API that matches the intent: ` map ` , ` flatMap ` , ` filter ` , ` or ` , ` orElse ` for
2019 cheap values, ` orElseGet ` for lazy fallback work, ` orElseThrow ` for true absence errors, and
2120 ` ifPresent ` or ` ifPresentOrElse ` for side effects.
@@ -49,8 +48,9 @@ Open [references/optional-examples.md](references/optional-examples.md) for work
4948 chosen values in target Optional fields inside that lambda.
50497 . Special boundaries: use a plain branch for checked IO/prompts; keep ` orElse(null) ` only at
5150 null-based API boundaries; return an explicit decision for review-only tasks.
52- 8 . Verify manually and with tests: same return values, exceptions, prompts, side effects, lazy
53- fallback timing, generated output, branch order, and sibling Optional smells.
51+ 8 . Verify with relevant tests or a traced example for each changed branch: same return values,
52+ exceptions, prompts, side effects, laziness, generated output, and branch order; scan sibling code
53+ for the same Optional smell.
5454
5555## References
5656
0 commit comments