RFR: 8333727: Use JOpt in jpackage to parse command line [v6]

Alexander Matveev almatvee at openjdk.org
Sat Nov 15 00:31:05 UTC 2025


On Fri, 14 Nov 2025 18:54:13 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

>> src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/StandardValidator.java line 48:
>> 
>>> 46:     static final Predicate<Path> IS_DIRECTORY = Files::isDirectory;
>>> 47: 
>>> 48:     static final Predicate<Path> IS_EXISTENT_NOT_DIRECTORY = path -> {
>> 
>> `IS_EXISTENT_NOT_DIRECTORY` will be same as `IS_REGULAR_FILE`? And just do `return Files. isRegularFile(path)`.
>
> `IS_EXISTENT_NOT_DIRECTORY` means it can be a regular file or a symlink.

In this case should it be something like below? Sounds more clear to me.

``` 
static final Predicate<Path> IS_FILE_OR_SYMLINK = path -> {
        return Files.isRegularFile(path) || Files.isSymbolicLink(path);
};

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28163#discussion_r2529319956


More information about the core-libs-dev mailing list