On Fri, 17 Jul 2026 14:22:53 GMT, Arno Zeller <[email protected]> wrote:
>>> As far as I understand the seenPlugins will not contain exclude-files in
>>> case it was disabled with --disable-plugin, because it was removed earlier
>>> from the list or haven't been on the list by default.
>>
>> Semantically, there should be no difference. Thus, I'd prefer one less extra
>> state to maintain. `seenPlugins` is guarded by `!Utils.isDisabled(plugin)`.
>> That's what we want.
>>
>>> And regarding user added filtering options I would guess, it is ok to keep
>>> the debuginfo filtering in case someone added an --exclude-files option on
>>> the commandline - do you agree?
>>
>> Yes. These should essentially be equivalent (on Linux):
>>
>> $ jlink --exclude-files=**/bin/java,**.debuginfo
>> --strip-native-debug-symbols=exclude-debuginfo-files
>> --strip-java-debug-attributes --add-modules java.base --verbose --output
>> ./build/java.base.jdk
>>
>> and
>>
>> $ jlink --exclude-files=**/bin/java --strip-debug --add-modules java.base
>> --verbose --output ./build/java.base.jdk
>
> I did not correctly express what I wanted to say in regard to:
> ` if (defaultStripDebugPlugin != null &&
> !seenPlugins.contains(EXCLUDE_FILES_NAME)) {`
> let me try again.
>
> In case of:
> `$ jlink --exclude-files=**/bin/java --strip-debug --add-modules java.base
> --verbose --output ./build/java.base.jdk`
>
> `seenPlugins` will contain `EXCLUDE_FILES_NAME` and will not disable the
> --strip-debug internal exclude.
>
> But in case of :
> `$ jlink --strip-debug --add-modules java.base --verbose --output
> ./build/java.base.jdk`
>
> the `.debuginfo` files are no longer excluded. As far as I understand
> `seenPlugins` only contains "by default enabled" plugins and therefore does
> not contain exclude-files if it is not on the commandline. Because of this, I
> guess that the additional list is needed to detect the disabled plugin.
Ah, yes. `seenPlugins` are plugins explicitly seen on the CLI and not disabled
explicitly. In case of `--strip-debug` only `exclude-files` won't be there.
Thanks for the clarification. This is pretty messy :-/
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31690#discussion_r3604461134