RFR: 8326100: DeflaterDictionaryTests should use Deflater.getBytesWritten instead of Deflater.getTotalOut [v2]
Eirik Bjørsnøs
eirbjo at openjdk.org
Sun Feb 18 10:58:54 UTC 2024
On Sun, 18 Feb 2024 10:56:03 GMT, Eirik Bjørsnøs <eirbjo at openjdk.org> wrote:
>> Please review this test-only cleanup PR in preparation for deprecating `Deflater.getTotalOut()` in JDK-8326096.
>>
>> This PR replaces various calls in`test/jdk/java/util/zip/DeflaterDictionaryTests.java` to `Deflater.getTotalOut()` with calls to `Deflater.getBytesWritten()` when formatting some debugging output lines.
>>
>> Additionally, various debug output lines claim to print the result of calling `Deflater.getAdler`, but instead prints the output of `Deflater.getTotalOut'. This PR fixes this to print the actual Adler value instead.
>>
>> Testing and verification: This is a test-only fix affecting only debug output. I have added the `noreg-self` label to the issue.
>
> Eirik Bjørsnøs has updated the pull request incrementally with one additional commit since the last revision:
>
> Use more specific format specifier %d instead of %s
Thanks for your review Alan!
> The hazard when the format specifiers are all %s.
Not sure I understand your comment since all arguments are of the same type (int) anyhow, I guess they would still be easy to get wrong or in the wrong order. Was that the hazard you refer to?
Anyhow, I went ahead and replaced the %s specifiers with the more specific decimal integer specifier %d.
WDYT?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17901#issuecomment-1951145968
More information about the core-libs-dev
mailing list