/ jdk Public
8253412: Unsupported GC options passed in JAVA_TOOL_OPTIONS are silently ignored #282
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.
See the reproducer in the bug itself. I think that happens because GCConfig checks only for FLAG_IS_CMDLINE, which is only from cmdline-originated flags. In this case, the flag comes from the environment variable. Maybe checking for
!FLAG_IS_DEFAULTis better, as it captures all non-default origins.
But them, instead of checking for
FLAG_IS_CMDLINE, I think we can rely on the fact that all
falseby default. So if any of such flags is
true, it means something had selected the GC. This allows for some further simplification of the macro (although I am not sure if it was intended to be ever used to check
$ git fetch https://git.openjdk.java.net/jdk pull/282/head:pull/282
$ git checkout pull/282