RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v2]

Tagir F. Valeev tvaleev at openjdk.org
Mon Feb 6 09:37:23 UTC 2023


On Sun, 5 Feb 2023 18:14:28 GMT, ExE Boss <duke at openjdk.org> wrote:

>> Tagir F. Valeev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Typo in doc fixed
>
> src/java.base/share/classes/java/lang/Math.java line 2215:
> 
>> 2213:     public static int clamp(long value, int min, int max) {
>> 2214:         if (min > max) {
>> 2215:             throw new IllegalArgumentException(min + ">" + max);
> 
> These should probably have some spacing or a better error message:
> Suggestion:
> 
>             throw new IllegalArgumentException(min + " > " + max);

Updated, thanks

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

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


More information about the core-libs-dev mailing list