<i18n dev> RFR: 8295000: java/util/Formatter/Basic test cleanup

Brent Christian bchristi at openjdk.org
Fri Oct 14 00:42:05 UTC 2022

On Thu, 13 Oct 2022 01:02:43 GMT, Justin Lu <duke at openjdk.org> wrote:

> Issue: java/util/Formatter/Basic regression test emits lots of warning messages (~60). 
> Fix: Made adjustments to Basic-X.java.template as the BasicXXX.java files where the errors originate from are generated from the template. 
> Note: The reason why there is white space added (and already existing in the BasicXXX files) is due to how the template is generated.

Changes requested by bchristi (Reviewer).

test/jdk/java/util/Formatter/BasicByteObject.java line 232:

> 230: 
> 231:     private static Byte negate(Byte v) {
> 232:         return (byte) -v.byteValue();

We want to be returning a `Byte`, so casting to `(byte)` doesn't seem right to me.

`Byte.valueOf()` takes a `byte` and returns a `Byte`, so using that as the replacement for `new Byte`, we get:
`return Byte.valueOf(-v.byteValue());`
Is there a way to get the template to do that?


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

More information about the i18n-dev mailing list