Skip to content
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

8323965: modify fix for 8317771 to remove reflection instantiation of the inner class #18867

Closed
wants to merge 1 commit into from

Conversation

savoptik
Copy link
Contributor

@savoptik savoptik commented Apr 19, 2024

I replaced reflection with using an accessor
@azuev-java please review


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

Warning

 ⚠️ Found leading lowercase letter in issue title for 8323965: modify fix for 8317771 to remove reflection instantiation of the inner class

Issues

  • JDK-8323965: modify fix for 8317771 to remove reflection instantiation of the inner class (Bug - P4)
  • JDK-8329667: [macos] Issue with JTree related fix for JDK-8317771 (Bug - P3) ⚠️ Issue is already resolved. Consider making this a "backport pull request" by setting the PR title to Backport <hash> with the hash of the original commit. See Backports.

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18867

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

Using diff file

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

Webrev

Link to Webrev Comment

Sorry, something went wrong.

…the inner class
@bridgekeeper
Copy link

bridgekeeper bot commented Apr 19, 2024

👋 Welcome back asemenov! 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 Apr 19, 2024

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

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 19, 2024
@openjdk
Copy link

openjdk bot commented Apr 19, 2024

@savoptik 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 client client-libs-dev@openjdk.org label Apr 19, 2024
@savoptik
Copy link
Contributor Author

/issue add 8322239

@openjdk
Copy link

openjdk bot commented Apr 19, 2024

@savoptik
Adding additional issue to issue list: 8322239: [macos] a11y : java.lang.NullPointerException is thrown when focus is moved on the JTabbedPane.

@savoptik savoptik changed the title 8323965 modify fix for 8317771 to remove reflection instantiation of …the inner class 8323965 modify fix for 8317771 to remove reflection instantiation of the inner class Apr 19, 2024
@openjdk openjdk bot changed the title 8323965 modify fix for 8317771 to remove reflection instantiation of the inner class 8323965: modify fix for 8317771 to remove reflection instantiation of the inner class Apr 19, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 19, 2024

Webrevs

@savoptik
Copy link
Contributor Author

/issue remove8322239

@openjdk
Copy link

openjdk bot commented Apr 19, 2024

@savoptik Command syntax:

  • /issue [add|remove] <id>[,<id>,...]
  • /issue [add] <id>: <description>
  • `/issue create [PX] /[subcomponent]

Some examples:

  • /issue add JDK-1234567,4567890
  • /issue remove JDK-4567890
  • /issue 1234567: Use this exact title
  • `/issue create hotspot/jfr
  • `/issue create P4 core-libs/java.nio

If issues are specified only by their ID, the title will be automatically retrieved from JBS. The project prefix (JDK- in the above examples) is optional. Separate multiple issue IDs using either spaces or commas.

@savoptik
Copy link
Contributor Author

/issue remove 8322239

@openjdk
Copy link

openjdk bot commented Apr 19, 2024

@savoptik
Removing additional issue from issue list: 8322239.

@savoptik
Copy link
Contributor Author

/issue add 8329667

@openjdk
Copy link

openjdk bot commented Apr 19, 2024

@savoptik
Adding additional issue to issue list: 8329667: [macos] Issue with JTree related fix for JDK-8317771.

public static AccessibleJTreeNodeCreateAccessor getAccessibleJTreeNodeCreateAccessor() {
var access = accessibleJTreeNodeCreateAccessor;
if (access == null) {
ensureClassInitialized(JTree.class);
Copy link
Member

Choose a reason for hiding this comment

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

This probably doesn't work as JTree class initialization does not seem to trigger AccessibleJTree class initialization. The other one for AccessibleJTreeNode is dubious too, maybe it just happens that all accesses are correctly made only after the related classes are initialized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line calls the ensureClassInitialized() method, which performs a full initialization of the class... It calls: MethodHandles.lookup().ensureInitialized(), which, as stated in the documentation , performs a full initialization.

Copy link
Member

Choose a reason for hiding this comment

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

I know, but initializing a class does not necessarily initialize its nested/inner classes

@azuev-java
Copy link
Member

The problem with this fix is that on the test example attached to the bug any attempt of navigation trough the items of JTree whole voice over is enabled causes java to stop responding. I see in the logs that it does call this exact place thousands of time constantly. So it seems like it makes the problem with java stalling on large size trees to re-appear.

@savoptik
Copy link
Contributor Author

@azuev-java
I'm restoring the context: There was a cycle that recursively collected children, and on new MacOS it worked for a very long time.. JDK-8317771 .
I added a solution for JTree, which works much faster, but there was a reflection, you asked to remove it. Unlike the old algorithm, it now works in seconds, not minutes...
The essence of JDK-8329667 is that the custom tree did not work due to reflection.
I removed the reflection, I did not add any additional acceleration.
As for speeding up the tree, I suggest adding caching, similar to how it is implemented in tables.

@@ -4272,6 +4272,10 @@ protected class AccessibleJTree extends AccessibleJComponent
TreePath leadSelectionPath;
Accessible leadSelectionAccessible;

static {
SwingAccessor.setAccessibleJTreeNodeCreateAccessor(new AccessibleTreNodeACreateccessor());
Copy link
Member

Choose a reason for hiding this comment

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

I think there is a typo here. AccessibleTreNodeACreateccessor does not sound right. Should be AccessibleTreeNodeCreateAccessor.

@bridgekeeper
Copy link

bridgekeeper bot commented May 22, 2024

@savoptik 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 add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@openjdk
Copy link

openjdk bot commented May 25, 2024

@savoptik this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout asemenov/JDK-8323965
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label May 25, 2024
@openjdk openjdk bot removed the rfr Pull request is ready for review label Jun 6, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Jun 22, 2024

@savoptik 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 add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 20, 2024

@savoptik This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Jul 20, 2024
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 merge-conflict Pull request has merge conflict with target branch
Development

Successfully merging this pull request may close these issues.

None yet

3 participants