jdk8u-dev icon indicating copy to clipboard operation
jdk8u-dev copied to clipboard

8274893: Update java.desktop classes to use try-with-resources

Open TimPushkin opened this issue 5 months ago • 11 comments

Backport of JDK-8274893 for parity with Oracle's JDK 8u461.

The first commit is a cherry-pick of the backport to JDK 11 with conflicts unresolved, the second resolves the conflicts, the rest resolve issues uncaught by git.

Resolved:

  • jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java
    • Missing JDK-8271456: "ISO-8859-1" string is used instead of ISO_8859_1 enum constant
    • Missing JDK-8041679: StringBuffer is used instead of StringBuilder
  • jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
    • Missing JDK-8271456: "ISO-8859-1" string is used instead of ISO_8859_1 enum constant
  • jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java
    • Missing JDK-8143909: no Objects.requireNonNull(...) in this version
  • jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java
    • Missing JDK-8054834: imports from sun.font package are still needed in this file
  • jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
    • Missing JDK-8080835: use IOUtils.readAllBytes(InputStream is) instead of the missing InputStream.readAllBytes()
  • Missing JDK-7196163: try-with-resources cannot be used with pre-existing variables — fell back to try-finally in such cases

Testing: GitHub CI, jdk_imageio test group locally (headless linux/arm64)


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [ ] JDK-8274893 needs maintainer approval
  • [x] Commit message must refer to an issue

Issue

  • JDK-8274893: Update java.desktop classes to use try-with-resources (Enhancement - P5)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 686

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

Using diff file

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

Using Webrev

Link to Webrev Comment

TimPushkin avatar Sep 01 '25 07:09 TimPushkin

:wave: Welcome back tpushkin! 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.

bridgekeeper[bot] avatar Sep 01 '25 07:09 bridgekeeper[bot]

❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.

openjdk[bot] avatar Sep 01 '25 07:09 openjdk[bot]

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

openjdk[bot] avatar Sep 01 '25 07:09 openjdk[bot]

Webrevs

mlbridge[bot] avatar Sep 01 '25 07:09 mlbridge[bot]

I believe test failures are not related

TimPushkin avatar Sep 01 '25 14:09 TimPushkin

@TimPushkin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Sep 30 '25 09:09 bridgekeeper[bot]

/touch

TimPushkin avatar Sep 30 '25 09:09 TimPushkin

@TimPushkin The pull request is being re-evaluated and the inactivity timeout has been reset.

openjdk[bot] avatar Sep 30 '25 09:09 openjdk[bot]

@TimPushkin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Oct 28 '25 14:10 bridgekeeper[bot]

/touch

TimPushkin avatar Oct 28 '25 15:10 TimPushkin

@TimPushkin The pull request is being re-evaluated and the inactivity timeout has been reset.

openjdk[bot] avatar Oct 28 '25 15:10 openjdk[bot]

@TimPushkin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Nov 26 '25 05:11 bridgekeeper[bot]

/touch

TimPushkin avatar Nov 26 '25 06:11 TimPushkin

@TimPushkin The pull request is being re-evaluated and the inactivity timeout has been reset.

openjdk[bot] avatar Nov 26 '25 06:11 openjdk[bot]