Skip to content
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

JDK-8310550: Adjust references to rt.jar #14593

Closed
wants to merge 5 commits into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented Jun 21, 2023

There are a few references to rt.jar in comments and in the codebase itself. Some of them might be removed or adjusted.


Progress

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

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14593

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 21, 2023

👋 Welcome back mbaesken! 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 openjdk bot added the rfr Pull request is ready for review label Jun 21, 2023
@openjdk
Copy link

openjdk bot commented Jun 21, 2023

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

  • build
  • client
  • compiler
  • core-libs
  • hotspot-compiler
  • serviceability

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 serviceability serviceability-dev@openjdk.org build build-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org client client-libs-dev@openjdk.org core-libs core-libs-dev@openjdk.org compiler compiler-dev@openjdk.org labels Jun 21, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 21, 2023

Webrevs

Copy link
Member

@erikj79 erikj79 left a comment

Choose a reason for hiding this comment

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

The update to Java.gmk is good.

/reviewers 2

@openjdk
Copy link

openjdk bot commented Jun 21, 2023

@MBaesken 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:

8310550: Adjust references to rt.jar

Reviewed-by: erikj, clanger

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 175 new commits pushed to the master branch:

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 ready Pull request is ready to be integrated label Jun 21, 2023
@openjdk
Copy link

openjdk bot commented Jun 21, 2023

@erikj79
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jun 21, 2023
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Mostly seems okay - a couple of things need further adjusting I think.

Thanks.

@@ -193,7 +193,7 @@ private Path getPath(String first, String... more) {
}

/**
* Set whether or not to use ct.sym as an alternate to rt.jar.
* Set whether or not to use ct.sym as an alternate
Copy link
Member

Choose a reason for hiding this comment

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

As an alternate to what? This needs something else.

Copy link
Member Author

Choose a reason for hiding this comment

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

should "to the image modules files" be used instead ?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe "... to the current runtime."?

Copy link
Member

Choose a reason for hiding this comment

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

The name of this test includes RTJar. It needs to be changed too I think. Does this test actually still test something?

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems to start a javap. So I think it tests something, how important this is and what other tests might cover similar stuff, I do not know unfortunately .

Copy link
Member

Choose a reason for hiding this comment

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

This is a trivial test for a trivial issue. javap will be tested much more thoroughly by other tests. I think this test can be deleted without any loss of coverage. Or it can just be left.

@@ -654,7 +654,7 @@ private static Connection getConnection(
/*
* When callerCl is null, we should check the application's
* (which is invoking this class indirectly)
* classloader, so that the JDBC driver class outside rt.jar
* classloader, so that the JDBC driver class outside the image
* can be loaded from here.
Copy link
Contributor

Choose a reason for hiding this comment

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

This code should probably be changed to use VM.isSystemDomainLoader(callerCL).

I think the comment should be replaced because it doesn't match what it actually does and it's nothing to do with the whether the JDBC driver is in the run-time image or not. How about:

"If the caller is defined to the bootstrap or platform class loader then use the Thread CCL as the initiating class loader so that a JDBC on the class path, or bundled with an application, is found."

Copy link
Member Author

@MBaesken MBaesken Jun 28, 2023

Choose a reason for hiding this comment

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

Hi Alan, regarding usage of class VM I get
'package jdk.internal.misc is declared in module java.base, which does not export it to module java.sql'
Is there any concern to export it as well to module java.sql ?
And btw did you mean to use it like this, in the if ?

if (callerCL == null || VM.isSystemDomainLoader(callerCL)) { callerCL = Thread.currentThread().getContextClassLoader(); }

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Alan, regarding usage of class VM I get 'package jdk.internal.misc is declared in module java.base, which does not export it to module java.sql' Is there any concern to export it as well to module java.sql ? And btw did you mean to use it like this, in the if ?

if (callerCL == null || VM.isSystemDomainLoader(callerCL)) { callerCL = Thread.currentThread().getContextClassLoader(); }

It was just a passing comment, I didn't meant to suggest changing it as part of this PR. We have always think twice before adding qualified exports from java.base and this is case where java.sql is very "non-core", we don't want to give it any access to java.base internals.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi Alan, thanks for clarifying. So I should only adjust the comment, correct ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi Alan, I adjusted the comment in DriverManager.java .

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Alan, I adjusted the comment in DriverManager.java .

Thanks, the update looks okay.

Copy link
Contributor

@RealCLanger RealCLanger 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 overall. I made a few suggestions.

@@ -193,7 +193,7 @@ private Path getPath(String first, String... more) {
}

/**
* Set whether or not to use ct.sym as an alternate to rt.jar.
* Set whether or not to use ct.sym as an alternate
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe "... to the current runtime."?

@@ -37,7 +37,7 @@
* Test checks that agent's JAR file is appended at the end of the system class path.
* Agent's JAR file contains modified class java.util.TooManyListenersException (it is assumed
* that this class isn't loaded before agent is loaded), agent instantiates TooManyListenersException
* and checks that non-modified version of this class was loaded from rt.jar (not from agent's JAR).
* and checks that non-modified version of this class was loaded from jdk image (not from agent's JAR).
Copy link
Contributor

Choose a reason for hiding this comment

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

"from the jdk image"

@@ -107,7 +107,7 @@ private static void buildJar() throws Throwable {
public static class TestMain {
public static void main(String args[]) throws Exception {
// deal with internal builds where classes are loaded from the
// 'classes' directory rather than rt.jar
// 'classes' directory rather than the image modules file
Copy link
Contributor

Choose a reason for hiding this comment

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

"... rather than the runtime image"

@@ -24,7 +24,7 @@
/*
* @test
* @bug 4798312
* @summary In Windows, javap doesn't load classes from rt.jar
* @summary In Windows, javap doesn't load classes from image
Copy link
Contributor

Choose a reason for hiding this comment

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

"... from the runtime image"

@MBaesken
Copy link
Member Author

MBaesken commented Jul 5, 2023

Hi Christoph, thanks for the suggestions, I added some changes.

Copy link
Contributor

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

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

Fine from my end now. Just one minor nit left. 😄

@@ -193,7 +193,7 @@ private Path getPath(String first, String... more) {
}

/**
* Set whether or not to use ct.sym as an alternate to rt.jar.
* Set whether or not to use ct.sym as an alternate to the current runtime
Copy link
Contributor

Choose a reason for hiding this comment

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

You should bring back the period at the end of the sentence.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 5, 2023
@MBaesken
Copy link
Member Author

MBaesken commented Jul 6, 2023

Hi Christoph, thanks for the review !
I added the '.' as suggested.

Any objections to the latest revision?

@MBaesken
Copy link
Member Author

MBaesken commented Jul 7, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Jul 7, 2023

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

  • 848abd2: 8311511: Improve description of NativeLibrary JFR event
  • 6485b7d: 6875229: Wrong placement of icons in JTabbedPane in Nimbus
  • 27de536: 8311581: Remove obsolete code and comments in TestLVT.java
  • e848d94: 8310923: Refactor Currency tests to use JUnit
  • 0c86c31: 8302351: "assert(!JavaThread::current()->is_interp_only_mode() || !nm->method()->is_continuation_enter_intrinsic() || ContinuationEntry::is_interpreted_call(return_pc)) failed: interp_only_mode but not in enterSpecial interpreted entry" in fixup_callers_callsite
  • ec7da91: 8240567: MethodTooLargeException thrown while creating a jlink image
  • 97e99f0: 8311087: PhiNode::wait_for_region_igvn should break early
  • 7173c30: 8307766: Linux: Provide the option to override the timer slack
  • 356067d: 8311489: Remove unused dirent_md files
  • 3d813ae: 8311301: MethodExitTest may fail with stack buffer overrun
  • ... and 175 more: https://git.openjdk.org/jdk/compare/826dcb5424a931953ac1964e7893aec7ec839862...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jul 7, 2023

@MBaesken Pushed as commit 25cbe85.

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

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