8274893: Update java.desktop classes to use try-with-resources#686
8274893: Update java.desktop classes to use try-with-resources#686TimPushkin wants to merge 3 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back tpushkin! A progress list of the required criteria for merging this PR into |
|
@TimPushkin This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be: 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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the 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 (@gnu-andrew) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
This backport pull request has now been updated with issue from the original commit. |
Webrevs
|
| return null; | ||
| try | ||
| { | ||
| try { |
There was a problem hiding this comment.
There should be try-with-resources
There was a problem hiding this comment.
There was in the original change but in this JDK try-with-resources on an existing variable is not possible (no JDK-7196163), so I fell back to try-finally. This is not the only place where I've done this, see 832c3c3.
Alternatives are to either create a copy variable for try-with-resources (which also must be used inside it to prevent a compiler warning) or move all interactions with the variable inside try-with-resources — both diverge code from the original change and the pre-existing code so I decided against them.
There was a problem hiding this comment.
Shouldn't we revert formatting changes here, then?
There was a problem hiding this comment.
I wasn't sure what would be the best here: keeping the existing formatting to changing it to be closer to the backported change — and went with the latter.
Since I don't really have a strong preference, reverted to the old one now as you suggest.
|
I believe test failures are not related |
|
@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 |
|
@TimPushkin The pull request is being re-evaluated and the inactivity timeout has been reset. |
|
@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 |
|
@TimPushkin The pull request is being re-evaluated and the inactivity timeout has been reset. |
|
@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 |
|
@TimPushkin The pull request is being re-evaluated and the inactivity timeout has been reset. |
|
@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 |
|
@TimPushkin The pull request is being re-evaluated and the inactivity timeout has been reset. |
Backport-of: 70c6df6be431fe11c5441986ed04040f9ec3b750
3fd18e4 to
fd9a023
Compare
|
@TimPushkin Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
|
Rebased on top of the current master |
|
@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 |
|
/keepalive |
|
@TimPushkin The pull request is being re-evaluated and the inactivity timeout has been reset. |
gnu-andrew
left a comment
There was a problem hiding this comment.
Mostly looks good to me. Just a few comments:
- For the case in
com.sun.media.sound.JARSoundbankReader.java, only anullcheck is outside thetryblock. Could that not be moved inside and the block converted to try-with-resources? - For the
iscase incom.sun.media.sound.SoftSynthesizer.java, could we not move theisdeclaration into a try-with-resources block? The only use outside thetryis anullcheck.
The other cases I think we are stuck with try-finally blocks.
|
The test failures don't seem related:
|
I agree.
I've seen this one on my own recent PRs (e.g. openjdk/shenandoah-jdk8u#122) and it seems to have turned up this weekend.
This should be resolved once #755 goes in.
I think this is a sporadic failure and can't see a HotSpot test failure being related to these JDK code changes. |
gnu-andrew
left a comment
There was a problem hiding this comment.
Thanks for the additional changes. You managed to cover more cases than I expected and it looks good.
|
|
|
/approval request Backporting for parity with Oracle and to make a dependent in-progress backport cleaner. |
|
@TimPushkin |
|
/approve yes |
|
@gnu-andrew |
|
/integrate |
|
@TimPushkin |
|
/sponsor |
|
Going to push as commit d043a24.
Your commit was automatically rebased without conflicts. |
|
@gnu-andrew @TimPushkin Pushed as commit d043a24. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Backport of JDK-8274893 for parity with Oracle's JDK 8u461.
Resolved conflicts:
jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java"ISO-8859-1"string is used instead ofISO_8859_1enum constantStringBufferis used instead ofStringBuilderjdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java"ISO-8859-1"string is used instead ofISO_8859_1enum constantjdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.javaObjects.requireNonNull(...)in this versionjdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.javasun.fontpackage are still needed in this filejdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.javaIOUtils.readAllBytes(InputStream is)instead of the missingInputStream.readAllBytes()Testing: GitHub CI,
jdk_imageiotest group locally (headless linux/arm64)Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/686/head:pull/686$ git checkout pull/686Update a local copy of the PR:
$ git checkout pull/686$ git pull https://git.openjdk.org/jdk8u-dev.git pull/686/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 686View PR using the GUI difftool:
$ git pr show -t 686Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/686.diff
Using Webrev
Link to Webrev Comment