Skip to content

Parse dollar symbols when a matching currency is configured - #446

Open
ryanduguid wants to merge 1 commit into
JavaMoney:masterfrom
ryanduguid:fix/explicit-dollar-currency
Open

ryanduguid wants to merge 1 commit into
JavaMoney:masterfrom
ryanduguid:fix/explicit-dollar-currency

Conversation

@ryanduguid

@ryanduguid ryanduguid commented Oct 2, 2026 •

Copy link
Copy Markdown

Summary

A symbol format configured with a dollar currency currently rejects $1000.00 with $ is not a unique currency symbol. Use that supplied CurrencyUnit when the input matches its full symbol in the format's locale, and consume only that symbol. For example, a US format configured with USD can now parse the amount as USD 1,000.

Fixes #423. The change covers the existing dollar-rejection branch. Dollar input without a matching configured unit still fails; the configured unit remains a fallback for other parsed currencies.

Evidence

  • Before: 13 new success observations fail across the token and public format tests. After: all 19 new observations pass, covering USD, CAD, AUD, a supplied custom unit, French $US, adjacent amount text, small and negative amounts, mismatching hints and ambiguity controls.
  • OpenJDK 11.0.32.1.u1-1 and 21.0.12.1, Maven 3.9.16: all 624 core tests pass on each JDK. Both defined mvn -B -DskipTests -Dmaven.test.skip clean package builds pass, using isolated settings and the public 1.5-SNAPSHOT parent installed locally.
  • Final clean Java 21 focused run: 59 tests, zero failures or errors. Local JaCoCo reports 54 of 60 lines and 27 of 33 branches covered in CurrencyToken.parse.
  • Full reactor runs cover 748 tests. Java 11 has three remote IMF failures; Java 21 has two. Clean 729-test baselines also fail remote IMF tests, with varying node IDs. Every patched failure appears in a baseline run. These counts come from Surefire XML because the parent enables testFailureIgnore.
  • git diff --check passes. No dependencies or POM files change.

Risk

Previously rejected dollar inputs become valid when the configured unit's locale symbol matches. The tests require the supplied unit's identity and full symbol consumption, and retain rejection when a hint is absent or does not match.

Unverified

A fully passing reactor build, Java 21.0.6 (hosted CI's version), Windows, other JDKs and upstream CI are unverified. The Coveralls upload needs credentials and was skipped; local tests and JaCoCo ran.


This change is Reviewable

ryanduguid added a commit to ryanduguid/release-policy that referenced this pull request Oct 14, 2026
## Summary

Moves the central PR-review caller from reviewer `6b20437` (3 October)
to current main `1cd5539`, and updates its baseline digest. At `6b20437`
the reviewer caps output at 12,288 tokens. MiMo reached that cap
(`finish_reason: length`) on the largest chunk of
JavaMoney/jsr354-ri#446, so the review failed with
`incomplete_completion` on 3 October (run 37084986655) and again today
(run 38495499693). The current policy allows 32,768 output tokens and
includes #139 to #141 (reviewer output qualification, generation
metadata, Python 3.14).

```diff
- uses: 6b20437
+ uses: 1cd5539
```

The `central_public_report_v1` inputs and the `OPENROUTER_API_KEY`
secret are unchanged in `pr-review.yml` between the two commits.
`pr-review-consumer.yml` keeps its pin; #142 is changing that caller.

## Evidence

- **Before:** run 38495499693's receipts show GLM 5.3 finished both
chunks (`stop`), and MiMo v2.6 Pro stopped at 12,288 completion tokens
(`length`, `completion_contract`).
- **After:** `tests/test_repository_baseline.sh` passes with the new
digest, and actionlint is clean.

## Merge danger

**Door:** two-way. **Blast radius:** advisory reviews

The review is advisory and runs only on Ryan's manual dispatch. The max
review spend stays at US$3.

## Unverified

The paid review at the new pin runs after merge.

Co-authored-by: Ryan Duguid <ryanduguid@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How do I parse "$1000.00" in current versions?

1 participant