[jdk8u-dev] RFR: 8274893: Update java.desktop classes to use try-with-resources [v3]
Timofei Pushkin
tpushkin at openjdk.org
Mon Feb 9 21:48:00 UTC 2026
On Fri, 26 Dec 2025 11:12:17 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:
>> Backport of [JDK-8274893](https://bugs.openjdk.org/browse/JDK-8274893) for parity with Oracle's JDK 8u461.
>>
>> Resolved conflicts:
>> - `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)
>
> Timofei Pushkin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains one additional commit since the last revision:
>
> 8274893: Update java.desktop classes to use try-with-resources
>
> Backport-of: 70c6df6be431fe11c5441986ed04040f9ec3b750
The test failures don't seem related:
- `security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#digicerttlsrsarootg5` is the one failed in almost all of the cases ("Failed to validate https://digicert-tls-rsa4096-root-g5-revoked.chain-demos.digicert.com/") — there was already [JDK-8333937](https://bugs.openjdk.org/browse/JDK-8333937) some time ago with a similar error (not in the description but in the comments) and it was resolved externally
- `compiler/5091921/Test7005594.java` failed twice ("Test7005594.sh: 40: Bad substitution") — already reported as [JDK-8376951](https://bugs.openjdk.org/browse/JDK-8376951)
- `gc/logging/TestGCId.java` failed once (timeout)
-------------
PR Comment: https://git.openjdk.org/jdk8u-dev/pull/686#issuecomment-3871346354
More information about the jdk8u-dev
mailing list