RFR (XS): 8188245: [Testbug] test/hotspot/jtreg/gc/logging/TestPrintReferences.java can fail
sangheon.kim
sangheon.kim at oracle.com
Mon Oct 9 17:12:47 UTC 2017
Hi Erik,
Thanks for the review!
Sangheon
On 10/09/2017 01:14 AM, Erik Österlund wrote:
> Hi Sangheaon,
>
> Looks good.
>
> Thanks,
> /Erik
>
> On 2017-10-06 22:30, sangheon.kim wrote:
>> Hi all,
>>
>> Could I have some reviews to fix Java 'double' type rounding issue?
>>
>> The test is trying to compare time spent at a phase and a sum of each
>> sub-phases, but the add and subtract operation of 'double' type can
>> result in rounding issue.
>> e.g.
>> double phaseTime=14.7;
>> double total = 14.8;
>> double result = phaseTime - total;
>> // result = -0.10000000000000142 but the test is expecting -0.1 so
>> fails.
>>
>> My proposal is to use BigDecimal whenever those operations are needed.
>>
>> CR: https://bugs.openjdk.java.net/browse/JDK-8188245
>> Webrev: http://cr.openjdk.java.net/~sangheki/8188245/webrev.0/
>> Testing: JPRT, total of 400 iterations of TestPrintReferences.java
>>
>> Thanks,
>> Sangheon
>
More information about the hotspot-gc-dev
mailing list