Skip to content

Commit

Permalink
Don't pass --add-opens= to javac
Browse files Browse the repository at this point in the history
They are unnecessary at compile-time, and this avoids a warning on recent
javac versions:

```
warning: [options] --add-opens has no effect at compile time
```

They are still collected and passed as runtime JVM flags.

See also

* #19850 (comment)
* #19876

Closes: #19859
PiperOrigin-RevId: 574527220
Change-Id: Ie9bfb8162869a3479b9401945e140c09875cc05e
  • Loading branch information
cushon authored and copybara-github committed Oct 18, 2023
1 parent 9136223 commit 367994a
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ def compile(
["--add-exports=%s=ALL-UNNAMED" % x for x in add_exports],
order = "preorder",
))
all_javac_opts.append(depset(
["--add-opens=%s=ALL-UNNAMED" % x for x in add_opens],
order = "preorder",
))

# detokenize target's javacopts, it will be tokenized before compilation
all_javac_opts.append(helper.detokenize_javacopts(helper.tokenize_javacopts(ctx, javac_opts)))
Expand Down

0 comments on commit 367994a

Please sign in to comment.