On Tue, 4 Oct 2022 18:23:17 GMT, Harshitha Onkar <[email protected]> wrote:
>> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line
>> 255:
>>
>>> 253: * @return a {@code int} which is the rounded value of
>>> provided number
>>> 254: */
>>> 255: private static int roundDown(double d)
>>
>> The name of this method is a bit misleading, the operation doesn't actually
>> round down, but rounds the number normally except for the x.5 case right?
>> Does this operation exist somewhere else?
>
> Yes, that is correct. The method doc does clarify the purpose. But I see your
> point - probably `roundOff()` would sound less ambiguous and neutral?
[`roundHalfDown`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/RoundingMode.html#HALF_DOWN)?
-------------
PR: https://git.openjdk.org/jdk/pull/10274