-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDK-8326140: src/jdk.accessibility/windows/native/libjavaaccessbridge/AccessBridgeJavaEntryPoints.cpp ReleaseStringChars might be missing in early returns #17915
Conversation
👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into |
btw there might be further room for improvement / simplification. The current macro code blocks look like this
The second parameter could be omitted because it is always FALSE anyway in those EXCEPTION_CHECK_WITH_RELEASE blocks. |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@MBaesken 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 130 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 |
@@ -1735,11 +1743,10 @@ AccessBridgeJavaEntryPoints::getAccessibleContextInfo(jobject accessibleContext, | |||
EXCEPTION_CHECK("Getting AccessibleName - call to GetStringChars()", FALSE); | |||
wcsncpy(info->name, stringBytes, (sizeof(info->name) / sizeof(wchar_t))); | |||
length = jniEnv->GetStringLength(js); | |||
EXCEPTION_CHECK_WITH_RELEASE("Getting AccessibleName - call to GetStringLength()", FALSE, js, stringBytes); | |||
EXCEPTION_CHECK("Getting AccessibleName - call to ReleaseStringChars()", FALSE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is for the call to ReleaseStringChars() when there is no exception doing the GetStringLength
Since all the calls to ReleaseStringChars are now moved inside the WITH_RELEASE macro, it would seem more
logical to me to move this 2nd macro call inside the definition of the new macro (option 1)
Either that OR (option 1) do not move the "no previous exception" case inside the new macro at all
In other words, this CHECK should be placed next to where I can see the call that requires it.
Now, you'll probably tell me it isn't needed in the cases where the method immediately returns, so if that causes
a problem then option 2 seems like it would be better.
Hi Phil, I thought about this too. Just one EXCEPTION_CHECK_WITH_RELEASE macro and there the second check inside this macro, the two EXCEPTION_CHECK_WITH_RELEASE and EXCEPTION_CHECK just after it look a bit odd. |
Adjusted the coding, now do more in the EXCEPTION_CHECK_WITH_RELEASE macro. Please check . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi Christoph and Phil, thanks for the reviews ! /integrate |
Going to push as commit d9ef16d.
Your commit was automatically rebased without conflicts. |
In AccessBridgeJavaEntryPoints.cpp we have a couple of exception checks with potential early returns. Those miss ReleaseStringChars .
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17915/head:pull/17915
$ git checkout pull/17915
Update a local copy of the PR:
$ git checkout pull/17915
$ git pull https://git.openjdk.org/jdk.git pull/17915/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17915
View PR using the GUI difftool:
$ git pr show -t 17915
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17915.diff
Webrev
Link to Webrev Comment