RFR: 7902698: Collision of zero timestamp as a special value with use in filesystems [v2]
Dmitry Bessonov
dbessono at openjdk.java.net
Wed Feb 2 22:25:21 UTC 2022
On Tue, 25 Jan 2022 22:40:07 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:
>> This fixes a bug when the timestamp of a test file is set to zero, since jtharness currently uses zero as a special value. See discussion in [CODETOOLS-7902698](https://bugs.openjdk.java.net/browse/CODETOOLS-7902698).
>
> Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision:
>
> Use OptionalLong instead of -1L
seeing a failure of com.sun.javatest.SelectionTest regression test... inlined comments on the possible changes
src/com/sun/javatest/TRT_TreeNode.java line 794:
> 792: File thisDir = new File(TestResultTable.getRootRelativePath(this));
> 793: long lmd = table.getLastModifiedTime(thisDir);
> 794: if (lastScanDate.isEmpty() || lmd <= lastScanDate.getAsLong()) {
Seen a failure of com.sun.javatest.SelectionTest when checking the latest patch... It seems that here a more correct replacement could be
if (lastScanDate.isPresent() && lmd <= lastScanDate.getAsLong()) {
return;
}
src/com/sun/javatest/TRT_TreeNode.java line 907:
> 905: // may be less than if the custom finder starts to return a
> 906: // bogus value - like zero or 1 for whatever reason
> 907: if (lastScanDate.isEmpty() || thisScanDate <= lastScanDate.getAsLong()) {
Likely the same thing here, the mentioned `SelectionTest` passes with
if (lastScanDate.isPresent() && thisScanDate <= lastScanDate.getAsLong() ) {
return false;
}
-------------
Changes requested by dbessono (Committer).
PR: https://git.openjdk.java.net/jtharness/pull/22
More information about the jtharness-dev
mailing list