RFR: 7903229: ParameterFilter - check initFiles for any File with an empty path
Jonathan Gibbons
jjg at openjdk.org
Thu Sep 1 00:39:23 UTC 2022
On Sat, 2 Jul 2022 16:20:10 GMT, Dmitry Bessonov <dbessono at openjdk.org> wrote:
> ParameterFilter.java : method `update` could check check initFiles (which is result of `stringsToFiles()` call) for any File with an empty path
src/com/sun/javatest/ParameterFilter.java line 241:
> 239: if (file.getPath().isEmpty()) {
> 240: throw new IllegalArgumentException("The passed configuration parameters contain an empty path " +
> 241: "identifying a test or a folder of tests within the test suite to be run");
This check seems later than it could be.
You have a set of Strings (`initStrings`), that get converted to files (`initFiles`) that get converted to back to paths (file.getPath`).
Why not just check that the strings are not blank in the first place? That being said, how does this code relate to the comment on lines 232,233, that a null or empty check has already been done.
Finally, what are the implications of throwing unchecked exceptions, like `IllegalArgumentException` in this code?
-------------
PR: https://git.openjdk.org/jtharness/pull/33
More information about the jtharness-dev
mailing list