<i18n dev> Integrated: 8302815 Use new Math.clamp method in core libraries

Tagir F. Valeev tvaleev at openjdk.org
Wed Feb 22 09:55:00 UTC 2023


On Sat, 18 Feb 2023 10:50:53 GMT, Tagir F. Valeev <tvaleev at openjdk.org> wrote:

> For cleanup and dogfooding the new method, it would be nice to use Math.clamp where possible in java.base. See PR #12428.
> 
> As Math.clamp performs an additional check that min is not greater than max, I conservatively replaced only those occurrences where I can see that this invariant is always held. There are more occurrences, where clamp can be potentially used but it's unclear whether min <= max is always true.

This pull request has now been integrated.

Changeset: 3f3a1f53
Author:    Tagir F. Valeev <tvaleev at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3f3a1f534b7f2f5be6d7ded9d9832fa9394e763c
Stats:     45 lines in 11 files changed: 0 ins; 8 del; 37 mod

8302815: Use new Math.clamp method in core libraries

Reviewed-by: alanb

-------------

PR: https://git.openjdk.org/jdk/pull/12633


More information about the i18n-dev mailing list