unitsofmeasurement / indriya

JSR 385 - Reference Implementation
Other
115 stars 40 forks source link

format: add option to NumberDelimiterQuantityFormat to not override NumberFormat setting #364

Closed bradh closed 2 years ago

bradh commented 2 years ago

358 identifies an issue with NumberDelimiterQuantityFormat overriding the precision set in the composed NumberFormat. That looks like it is intended behaviour (i.e. there is a bunch of additional code to make that happen). However it is not always desired (as shown in #358).

The attached patch makes that optional via a builder setting. Additional options are undesirable, but in this case I can't see another way to keep the current behaviour for backwards compatibility and to support the required use case. For backwards compatibility, the option defaults to the current behaviour.

There are additional unit tests to verify it works as stated.


This change is Reviewable

bradh commented 2 years ago

Any thoughts on this PR? Anything I can do to help move it forward?

andi-huber commented 2 years ago

I believe number formatting precision has no impact on any of our internal arithmetic classes. So not sure if I'm the right person to review formatting features. Are the original authors still around?

keilw commented 2 years ago

@bradh Please check the contribution guide, sorry to not have pointed you to it earlier. I could not spot your name in the list of JCP Members. While most other artifacts are a little easier to contribute the core parts of the JSR (API, RI and TCK) except for minor CI build scripts, Maven or similar do require an Associate JCP Membership first, which is not too hard to join, it may take a little time and patience with Oracle/PMO but it usually works on that level. Please let us know if we can help you with the membership.