Skip to content

8344647: Make java.se participate in the preview language feature requires transitive java.base #22322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Nov 22, 2024

There is a new preview language feature, requires transitive java.base;. And the java.se module is permitted to use the feature, without being marked as preview (i.e. the java.se module participates in preview). This is currently implemented by the common "participates in preview" way, by checking that java.base is exporting jdk.internal.javac package to java.se.

This common way works OK for internal preview feature and API usage, but turns out it may not be appropriate for this feature: the qualified export of the jdk.internal.javac package is not a specified API, it is an implementation detail; and the JLS itself specifies that the java.se module is participating in preview.

So this PR proposes to change the way javac handles the java.se module: it permits the use of the preview feature based on the module name, instead relying on the internal qualified export.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8344647: Make java.se participate in the preview language feature requires transitive java.base (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22322/head:pull/22322
$ git checkout pull/22322

Update a local copy of the PR:
$ git checkout pull/22322
$ git pull https://git.openjdk.org/jdk.git pull/22322/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22322

View PR using the GUI difftool:
$ git pr show -t 22322

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22322.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 22, 2024

👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 22, 2024

@lahodaj This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8344647: Make java.se participate in the preview language feature `requires transitive java.base`

Reviewed-by: asotona, darcy

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 480 new commits pushed to the master branch:

  • 4533109: 8345911: Enhance error message when IncompatibleClassChangeError is thrown for sealed class loading failures
  • ea50c54: 8321818: vmTestbase/nsk/stress/strace/strace015.java failed with 'Cannot read the array length because "" is null'
  • c0f0b8e: 8346151: Add transformer error logging to VerifyLocalVariableTableOnRetransformTest
  • f3e2f88: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds
  • 414eb6b: 8338714: vmTestbase/nsk/jdb/kill/kill001/kill001.java fails with JTREG_TEST_THREAD_FACTORY=Virtual
  • dc71e8c: 8342995: Enhance Attach API to support arbitrary length arguments - Linux
  • 4f44cf6: 8341481: [perf] vframeStreamCommon constructor may be optimized
  • 390b205: 8346048: test/lib/containers/docker/DockerRunOptions.java uses addJavaOpts() from ctor
  • 03821d9: 8346195: Fix static initialization problem in GDIHashtable
  • a5503fb: 8346432: java.lang.foreign.Linker comment typo
  • ... and 470 more: https://git.openjdk.org/jdk/compare/8f22db23a50fe537d8ef369e92f0d5f9970d98f0...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 22, 2024
@openjdk
Copy link

openjdk bot commented Nov 22, 2024

@lahodaj The following labels will be automatically applied to this pull request:

  • compiler
  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added core-libs core-libs-dev@openjdk.org compiler compiler-dev@openjdk.org labels Nov 22, 2024
@mlbridge
Copy link

mlbridge bot commented Nov 22, 2024

Webrevs

@lahodaj lahodaj changed the title 8344647: JDK-8335989 causes a bad requires flag: ACC_TRANSITIVE error for java.se 8344647: Make java.se participate in the preview language feature requires transitive java.base Dec 2, 2024
@cushon
Copy link
Contributor

cushon commented Dec 7, 2024

LGTM, thanks!

I verified this fixes the original issue I was seeing.

Copy link
Member

@asotona asotona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
JEP 494 puts java.se into a special position related to the preview participation and that position should not depend on java.base internal annotation.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 12, 2024
@lahodaj
Copy link
Contributor Author

lahodaj commented Dec 18, 2024

Thanks for the reviews!

@lahodaj
Copy link
Contributor Author

lahodaj commented Dec 18, 2024

/integrate

@lahodaj
Copy link
Contributor Author

lahodaj commented Dec 18, 2024

/backport jdk jdk24

@openjdk
Copy link

openjdk bot commented Dec 18, 2024

Going to push as commit d50b725.
Since your change was applied there have been 484 commits pushed to the master branch:

  • 9e8aa85: 8346017: Socket.connect specified to throw UHE for unresolved address is problematic for SOCKS V5 proxy
  • 5b703c7: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI
  • edbd76c: 8344951: Stabilize write barrier micro-benchmarks
  • 842f801: 8339331: GCC fortify error in vm_version_linux_aarch64.cpp
  • 4533109: 8345911: Enhance error message when IncompatibleClassChangeError is thrown for sealed class loading failures
  • ea50c54: 8321818: vmTestbase/nsk/stress/strace/strace015.java failed with 'Cannot read the array length because "" is null'
  • c0f0b8e: 8346151: Add transformer error logging to VerifyLocalVariableTableOnRetransformTest
  • f3e2f88: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds
  • 414eb6b: 8338714: vmTestbase/nsk/jdb/kill/kill001/kill001.java fails with JTREG_TEST_THREAD_FACTORY=Virtual
  • dc71e8c: 8342995: Enhance Attach API to support arbitrary length arguments - Linux
  • ... and 474 more: https://git.openjdk.org/jdk/compare/8f22db23a50fe537d8ef369e92f0d5f9970d98f0...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 18, 2024
@openjdk openjdk bot closed this Dec 18, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 18, 2024
@openjdk
Copy link

openjdk bot commented Dec 18, 2024

@lahodaj Pushed as commit d50b725.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@openjdk
Copy link

openjdk bot commented Dec 18, 2024

@lahodaj the backport was successfully created on the branch backport-lahodaj-d50b725a-jdk24 in my personal fork of openjdk/jdk. To create a pull request with this backport targeting openjdk/jdk:jdk24, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit d50b725a from the openjdk/jdk repository.

The commit being backported was authored by Jan Lahoda on 18 Dec 2024 and was reviewed by Adam Sotona and Joe Darcy.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk:

$ git fetch https://github.com/openjdk-bots/jdk.git backport-lahodaj-d50b725a-jdk24:backport-lahodaj-d50b725a-jdk24
$ git checkout backport-lahodaj-d50b725a-jdk24
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk.git backport-lahodaj-d50b725a-jdk24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler compiler-dev@openjdk.org core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants