Skip to content

8378802: [21u] backport changes to TKit.java by JDK-8352419#2633

Closed
mmm-choi wants to merge 2 commits intoopenjdk:masterfrom
mmm-choi:JDK-8352419-SkippedException
Closed

8378802: [21u] backport changes to TKit.java by JDK-8352419#2633
mmm-choi wants to merge 2 commits intoopenjdk:masterfrom
mmm-choi:JDK-8352419-SkippedException

Conversation

@mmm-choi
Copy link
Copy Markdown
Contributor

@mmm-choi mmm-choi commented Feb 23, 2026

In order to fix #2606, consensus was reached to pull the SkippedException hardcode change from tip to fix.

The other parts of the backport require additional backports that are not trivial.

The upstream commit JDK-8352419 openjdk/jdk@70e3250 contains changes to 4 files:

  • TKit.java - Embeds jtreg.SkippedException bytecode (included in this backport)
  • PackageType.java - Adds new methods used by refactored ErrorTest
  • PackageTest.java - Adds filtering logic for new ErrorTest infrastructure
  • ErrorTest.java - Uses new PackageTypeSpec record and test infrastructure

Only the TKit.java change is self-contained. The other changes depend on JDK-8351372 openjdk/jdk@3aa6d62 ("Improve negative tests coverage of jpackage"), which is a big refactoring that completely rewrote ErrorTest.java (~700 lines changed).

Required Prerequisites for Full Backport

JBS ID Description Impact
JDK-8351372 Improve negative tests coverage of jpackage Complete ErrorTest.java rewrite (581 insertions, 78 deletions)
JDK-8352293 Fix rpm packages on Ubuntu after 8351372 Follow-up fix (1 line in PackageType.java)

These backports are unnecessary for JDK 21 - they are test infrastructure improvements for jdk-tip that don't exist in 21.

This PR backports only the JtregSkippedExceptionClass inner class from TKit.java, which embeds the jtreg.SkippedException bytecode via Base64 and dynamically defines the class at runtime. This eliminates the need for @library /test/lib and @build jtreg.SkippedException in jpackage tests and fixes all jpackage tests that call SkippedException through reflection.

Tested all tools/jpackage tests and also ran a simple test and it skips correctly now.

import jdk.jpackage.test.Annotations.Test;
import jdk.jpackage.test.TKit;

/*
 * @test
 * @summary Test TKit.throwSkippedException() without @library /test/lib
 * @library /test/jdk/tools/jpackage/helpers
 * @build jdk.jpackage.test.*
 * @build TKitSkipTest
 * @run main/othervm -Xmx512m jdk.jpackage.test.Main
 *  --jpt-run=TKitSkipTest
 */
public class TKitSkipTest {

    @Test
    public void test() {
        TKit.throwSkippedException("Testing TKit.throwSkippedException()");
    }
}

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
  • JDK-8375080 needs maintainer approval
  • JDK-8378802 needs maintainer approval

Issues

  • JDK-8378802: [21u] backport changes to TKit.java by JDK-8352419 (Bug - P4 - Approved)
  • JDK-8375080: The tools/jpackage/windows/Win8365790Test.java may fail with ClassNotFoundException: jtreg.SkippedException (Bug - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/2633/head:pull/2633
$ git checkout pull/2633

Update a local copy of the PR:
$ git checkout pull/2633
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/2633/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2633

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/2633.diff

Using Webrev

Link to Webrev Comment

mmm-choi and others added 2 commits February 17, 2026 18:59
Backport only the TKit.java change from JDK-8352419 that embeds
a Base64-encoded jtreg.SkippedException class, eliminating the need
for @library /test/lib and @build jtreg.SkippedException in tests.

This is a minimal backport - the other changes in 8352419 (PackageType.java,
PackageTest.java, ErrorTest.java) are not included as they depend on
JDK-8351372 refactoring that is not present in JDK 21.
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Feb 23, 2026

👋 Welcome back mmm-choi! 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
Copy Markdown

openjdk Bot commented Feb 23, 2026

@mmm-choi 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:

8378802: [21u] backport changes to TKit.java by JDK-8352419
8375080: The tools/jpackage/windows/Win8365790Test.java may fail with ClassNotFoundException: jtreg.SkippedException

Reviewed-by: phh

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 28 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@phohensee) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk Bot changed the title Backport 70e325004536eb9b79f4943f27eed4ac6cec8bd5 8352419: Test tools/jpackage/share/ErrorTest.java#id0 and #id1 fail Feb 23, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Feb 23, 2026

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk Bot added the backport Port of a pull request already in a different code base label Feb 23, 2026
@mmm-choi
Copy link
Copy Markdown
Contributor Author

/issue add 8375080

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Feb 23, 2026

@mmm-choi
Adding additional issue to issue list: 8375080: The tools/jpackage/windows/Win8365790Test.java may fail with ClassNotFoundException: jtreg.SkippedException.

@mmm-choi mmm-choi marked this pull request as ready for review February 23, 2026 20:59
@openjdk openjdk Bot added the rfr Pull request is ready for review label Feb 23, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Feb 23, 2026

Webrevs

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Feb 24, 2026

⚠️ @mmm-choi This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@mmm-choi
Copy link
Copy Markdown
Contributor Author

/approval request

This backport is a partial cherry-pick of JDK-8352419, taking only the self-contained TKit.java change that embeds jtreg.SkippedException bytecode via a hardcoded Base64-encoded class definition.

This fixes JDK-8375080 jpackage tests that call TKit.throwSkippedException() which currently fail with ClassNotFoundException because they don't declare @library /test/lib and @build jtreg.SkippedException. The hardcoded bytecode approach (already in tip) eliminates this dependency entirely.

The remaining changes in the upstream commit (PackageType.java, PackageTest.java, ErrorTest.java) depend on JDK-8351372, a large test infrastructure refactoring (~700 lines) that is unnecessary for 21/17. Only the TKit.java change is needed to fix the skip behavior.

Tested by running tools/jpackage tests and a standalone test confirming TKit.throwSkippedException() correctly produces Passed.Skipped status without test/lib on the classpath.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Feb 24, 2026

@mmm-choi
8352419: The approval request has been created successfully.
8375080: The approval request has been created successfully.

@openjdk openjdk Bot added the approval Requires approval; will be removed when approval is received label Feb 24, 2026
@mmm-choi
Copy link
Copy Markdown
Contributor Author

/issue add 8378802

@mmm-choi mmm-choi changed the title 8352419: Test tools/jpackage/share/ErrorTest.java#id0 and #id1 fail 8378802: [21u] backport changes to TKit.java by JDK-8352419 Feb 27, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Feb 27, 2026

@mmm-choi This issue is referenced in the PR title - it will now be updated.

@openjdk openjdk Bot added approval Requires approval; will be removed when approval is received and removed approval Requires approval; will be removed when approval is received labels Feb 27, 2026
@GoeLin
Copy link
Copy Markdown
Member

GoeLin commented Mar 2, 2026

Hi,

I was not aware that there was already a bug open for this.
It would be clearer if there was only one issue for this, and the push would be associated with only one of them.
I am fine with both as long as JDK-8352419 is not marked as backported which would be misleading. if you want to you can remove one of the bugs from this PR and then push, and close the other as duplicate, or delete it or whatever. But it's also fine to push as-is.

If you want to backport to 17, you should make that PR use "backport <hash of push to 21>", maybe you can even use the /backport command in the push to 21.

Best regards, Goetz.

@GoeLin
Copy link
Copy Markdown
Member

GoeLin commented Mar 2, 2026

Also, the approval request in JDK-8378802 is missing.

@openjdk openjdk Bot removed the approval Requires approval; will be removed when approval is received label Mar 2, 2026
@mmm-choi
Copy link
Copy Markdown
Contributor Author

mmm-choi commented Mar 2, 2026

/approval JDK-8378802 request
This backport is a partial cherry-pick of JDK-8352419, taking only the self-contained TKit.java change that embeds jtreg.SkippedException bytecode via a hardcoded Base64-encoded class definition.

This fixes JDK-8375080 jpackage tests that call TKit.throwSkippedException() which currently fail with ClassNotFoundException because they don't declare @library /test/lib and @build jtreg.SkippedException. The hardcoded bytecode approach (already in tip) eliminates this dependency entirely.

The remaining changes in the upstream commit (PackageType.java, PackageTest.java, ErrorTest.java) depend on JDK-8351372, a large test infrastructure refactoring (~700 lines) that is unnecessary for 21/17. Only the TKit.java change is needed to fix the skip behavior.

Tested by running tools/jpackage tests and a standalone test confirming TKit.throwSkippedException() correctly produces Passed.Skipped status without test/lib on the classpath.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 2, 2026

@mmm-choi
JDK-8378802: The approval request has been created successfully.

@openjdk openjdk Bot added approval Requires approval; will be removed when approval is received ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels Mar 2, 2026
@mmm-choi
Copy link
Copy Markdown
Contributor Author

/integrate

@openjdk openjdk Bot added the sponsor Pull request is ready to be sponsored label Mar 10, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 10, 2026

@mmm-choi
Your change (at version 29e173a) is now ready to be sponsored by a Committer.

@phohensee
Copy link
Copy Markdown
Member

/sponsor

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 10, 2026

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Mar 10, 2026
@openjdk openjdk Bot closed this Mar 10, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Mar 10, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 10, 2026

@phohensee @mmm-choi Pushed as commit 3931807.

💡 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

backport Port of a pull request already in a different code base integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants