RFR: 8295000: java/util/Formatter/Basic test cleanup
Brent Christian
bchristi at openjdk.org
Tue Oct 18 19:59:08 UTC 2022
On Tue, 18 Oct 2022 19:48:15 GMT, Justin Lu <duke at openjdk.org> wrote:
>> So, the above suggestion gives explicit auto-boxing, though some might find it wordier than necessary.
>>
>> Since `v.byteValue()` already returns a `byte`, the `(byte)` cast doesn't seem necessary. I see that L242 does:
>>> `return -v.intValue();`
>>
>> which is a pretty clean look. So `return -v.byteValue();` would be an option, too.
>
> Negating v.byteValue() promotes it into an int. So then casting to byte would be necessary.
Oh yeah...oops.
-------------
PR: https://git.openjdk.org/jdk/pull/10684
More information about the core-libs-dev
mailing list