Skip to content

8378057: CAccessibility roleKey and AWTAccessor.AccessibleBundleAccessor are Redundant#29868

Open
mickleness wants to merge 3 commits intoopenjdk:masterfrom
mickleness:JDK-8378057
Open

8378057: CAccessibility roleKey and AWTAccessor.AccessibleBundleAccessor are Redundant#29868
mickleness wants to merge 3 commits intoopenjdk:masterfrom
mickleness:JDK-8378057

Conversation

@mickleness
Copy link
Contributor

@mickleness mickleness commented Feb 22, 2026

This PR proposes replacing the native roleKey method with the AWTAccessor.AccessibleBundleAccessor. They appear to do the same thing.

I ran all the existing jtreg tests in the javax/accessibility folder and observed no new regressions (tested on Mac).


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8378057: CAccessibility roleKey and AWTAccessor.AccessibleBundleAccessor are Redundant (Task - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29868/head:pull/29868
$ git checkout pull/29868

Update a local copy of the PR:
$ git checkout pull/29868
$ git pull https://git.openjdk.org/jdk.git pull/29868/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 29868

View PR using the GUI difftool:
$ git pr show -t 29868

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29868.diff

Using Webrev

Link to Webrev Comment

The `roleKey(x)` method does the same thing as `AWTAccessor.getAccessibleBundleAccessor().getKey(x)`.

Neither supports a null argument.

I don't have a strong preference which one is removed. I'm proposing removing `roleKey` first, simply because it appears similar to reflection (which we try to avoid).

I ran jtreg against all the tests in the jdk/test/jdk/javax/accessibility/ directory, and this did not introduce any new regressions.
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 22, 2026

👋 Welcome back jwood! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Feb 22, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Feb 22, 2026
@openjdk
Copy link

openjdk bot commented Feb 22, 2026

@mickleness The following label will be automatically applied to this pull request:

  • client

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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 22, 2026
@mlbridge
Copy link

mlbridge bot commented Feb 22, 2026

Webrevs

final AccessibleRole role = context.getAccessibleRole();
String roleStr = role == null ? null :
AWTAccessor.getAccessibleBundleAccessor().getKey(role);
if (role != null && ignoredRoles != null &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be changed to roleStr != null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

if (!ignoredRoles.contains(roleKey(nvRole))) {
String roleStr = AWTAccessor.getAccessibleBundleAccessor().
getKey(nvRole);
if (!ignoredRoles.contains(roleStr)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks fine, but I’m wondering if we need the same null check here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need it, but I added one just now since you asked about it.

Previously this invocation (at line 119) did not include a null check, and the other invocation (at line 1037) did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants