RFR: 8291081: Some sun/tools/jstatd/TestJstatd* tests fail with "Not a percentage\: 68.31\: expected true, was false" [v3]
Chris Plummer
cjplummer at openjdk.org
Wed Aug 10 20:52:32 UTC 2022
On Tue, 9 Aug 2022 20:29:42 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
>> The test should use the same locales in all processes, the default language should work fine.
>
> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
>
> fixed print
test/jdk/sun/tools/jstatd/JstatGCUtilParser.java line 112:
> 110: double percentage = NumberFormat.getInstance().parse(value).doubleValue();
> 111: assertTrue(0 <= percentage && percentage <= 100,
> 112: "Not a percentage. value: " + value + " percentage: " + percentage);
This doesn't look right. If the type is `INTEGER_OR_DASH` and the value is not a "-", then we don't do the `NumberFormat` check that we previously would have done if the type was `INTEGER`. Instead we treat it as a double and assert that the value is between 0 and 100. Same issue with `DOUBLE_OR_DASH`.
-------------
PR: https://git.openjdk.org/jdk/pull/9798
More information about the serviceability-dev
mailing list