-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8263846: Bad JNI lookup getFocusOwner in accessibility code on Mac OS X #3099
Conversation
Initialize sjc_CAccessibility before using it
👋 Welcome back kizune! A progress list of the required criteria for merging this PR into |
@azuev-java 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. |
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.
Since there is no test, I assume that the JBS issue should have noreg-hard
label.
@azuev-java 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 6 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
@@ -1456,6 +1456,7 @@ - (id)accessibilityHitTest:(NSPoint)point withEnv:(JNIEnv *)env | |||
- (id)accessibilityFocusedUIElement | |||
{ | |||
JNIEnv *env = [ThreadUtilities getJNIEnv]; | |||
GET_CACCESSIBILITY_CLASS_RETURN(nil); |
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.
Is it caused by the JDK-8257853? Should we update the accessibilityIndexOfChild as well?
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.
It made it visible however it is just a good practice not to assume that class reference is already initialized before using it. So, yes, while i was not seeing any failures in accessibilityIndexOfChild i might fix it as well.
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.
If this was missed in the JNF work, add the label "jnf" to the bug.
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.
Done.
Yes, as with most of platform-specific accessibility issues just configuring a system to be able to invoke this native functionality is quite hard. I will put the corresponding keyword into the bug. |
@@ -799,6 +799,7 @@ - (NSUInteger)accessibilityIndexOfChild:(id)child | |||
} | |||
|
|||
JNIEnv *env = [ThreadUtilities getJNIEnv]; | |||
GET_CACCESSIBILITY_CLASS_RETURN(0); |
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.
This isn't necessary. Because the line below takes care of it. The definition looks like
#define GET_ACCESSIBLEINDEXINPARENT_STATIC_METHOD_RETURN(ret)
GET_CACCESSIBILITY_CLASS_RETURN(ret);
GET_STATIC_METHOD_RETURN(sjm_getAccessibleIndexInParent, sjc_CAccessibility, "getAccessibleIndexInParent",
"(Ljavax/accessibility/Accessible;Ljava/awt/Component;)I", ret);
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.
Ah, ok, was missed that. Will revert this change.
@@ -1456,6 +1456,7 @@ - (id)accessibilityHitTest:(NSPoint)point withEnv:(JNIEnv *)env | |||
- (id)accessibilityFocusedUIElement | |||
{ | |||
JNIEnv *env = [ThreadUtilities getJNIEnv]; | |||
GET_CACCESSIBILITY_CLASS_RETURN(nil); |
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.
If this was missed in the JNF work, add the label "jnf" to the bug.
there takes care of the class initialization.
/integrate |
@azuev-java Since your change was applied there have been 6 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 118a49f. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Progress
Issue
Reviewers
Download
To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3099/head:pull/3099
$ git checkout pull/3099
To update a local copy of the PR:
$ git checkout pull/3099
$ git pull https://git.openjdk.java.net/jdk pull/3099/head