RFR: 7903020: Command line error: Incorrect output filename - can't write

Alexandre Iline shurailine at openjdk.java.net
Mon Aug 30 02:27:35 UTC 2021


On Fri, 27 Aug 2021 02:50:59 GMT, Leonid Kuskov <lkuskov at openjdk.org> wrote:

> This is the fix for https://bugs.openjdk.java.net/browse/CODETOOLS-7903020
> The fix extends checking of files as existing as non-existing

src/classes/com/sun/tdk/jcov/Merger.java line 996:

> 994:         if (opts.isSet(DSC_OUTPUT_TEST_LIST)) {
> 995:             outTestList = opts.getValue(DSC_OUTPUT_TEST_LIST);
> 996:             Utils.checkFileNotNull(outTestList, "output testlist filename",

If this is an _output_ test list (like I assume for merging with test scales, does it have to exist)?

src/classes/com/sun/tdk/jcov/Merger.java line 1017:

> 1015:         template = opts.getValue(DSC_TEMPLATE);
> 1016:         Utils.checkFileCanBeNull(template, "template filename",
> 1017:                 Utils.CheckOptions.FILE_EXISTS, Utils.CheckOptions.FILE_ISFILE, Utils.CheckOptions.FILE_CANREAD);

is FILE_EXISTS a subset of FILE_CANREAD?

src/classes/com/sun/tdk/jcov/Merger.java line 1022:

> 1020: 
> 1021:         output = opts.getValue(DSC_OUTPUT);
> 1022:         Utils.checkFileNotNull(output, "output filename",

It appears that the set of permissions is the same but in a different order.
It would help if the changset did not contain any formatting changes

src/classes/com/sun/tdk/jcov/util/Utils.java line 1192:

> 1190:                     }
> 1191:                     break;
> 1192:                 case FILE_CANWRITE:

I assume you have reviewed all usages of FILE_CANWRITE, because by this change you do change the meaning of it.

-------------

PR: https://git.openjdk.java.net/jcov/pull/18


More information about the jcov-dev mailing list