8334868: Ensure CheckUninstallModalHook is called in WPageDialogPeer._show#30207
8334868: Ensure CheckUninstallModalHook is called in WPageDialogPeer._show#30207aivanov-jdk wants to merge 4 commits into
Conversation
|
👋 Welcome back aivanov! A progress list of the required criteria for merging this PR into |
|
@aivanov-jdk 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: 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 393 new commits pushed to the
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 |
|
@aivanov-jdk The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
This looks much better compared to with the |
|
/reviewers 2 reviewer |
|
@aivanov-jdk |
|
/summary Reverse the condition of the if statement and Remove the doIt flag and use explicit returns:
|
|
@aivanov-jdk Setting summary to: |
|
/integrate |
|
Going to push as commit 8357de8.
Your commit was automatically rebased without conflicts. |
|
@aivanov-jdk Pushed as commit 8357de8. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This is a re-worked version of my previous attempt to fix the issue that was found during code review #19786 (comment) for JDK-8334509.
To ensure
AwtDialog::CheckInstallModalHook()andAwtDialog::ModalActivateNextWindoware always called, I moved them from the bottom of the function. Now these functions are called right after displaying the page dialog, that is after::PageSetupDlgreturns.I reversed the condition of the
ifstatement toif (!ret)and exit from the function right away if::PageSetupDlgreturned an error.The diff looks large because the body of the
ifis unindented.With this change, I modify the data flow and remove the
doItflag. The data flow with the flag is not as clear, and I already raised my concern. I'm sure this is what caused JDK-8334509.There was only one place where
JNI_TRUEis assigned to thedoItflag—in the end of theif (ret)block. Therefore, the lastreturnstatement in theWPageDialogPeer__1showfunction could have eitherJNI_FALSEorJNI_TRUEstored in thedoItflag. In all the otherreturnstatements, the value ofdoItremainsJNI_FALSE.It was the mistake in #18584 that assumed
JNI_TRUEwas the only possibility in the end of the function.By returning early if
::PageSetupDlgresults in an error, I eliminate the above possibility—if the lastreturnstatement inWPageDialogPeer__1showis reached, it has to returnJNI_TRUE.All the other
returnstatements explicitly returnJNI_FALSE… because an error occurred.To verify that this change does not introduce another regression,
PageDialogCancelTest.javathat was added in 8334509: Cancelling PageDialog does not return the same PageFormat object #19786 which covers the case where::PageSetupDlgreturns an error; andPageDialogFormatTest.java, that covers the successful case.Additionally, I ensure
::GlobalUnlock(setup.hDevMode)is called on the error return from the block at lines 687–700.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30207/head:pull/30207$ git checkout pull/30207Update a local copy of the PR:
$ git checkout pull/30207$ git pull https://git.openjdk.org/jdk.git pull/30207/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30207View PR using the GUI difftool:
$ git pr show -t 30207Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30207.diff
Using Webrev
Link to Webrev Comment