-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8347826: Introspector shows wrong method list after 8071693 #23443
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
Conversation
|
👋 Welcome back rmarchenko! A progress list of the required criteria for merging this PR into |
|
@wkia 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 121 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@azvegint, @aivanov-jdk, @mrserb) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
azvegint
left a comment
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.
Looks good.
|
Hi, As this PR is approved, hopefully it will be merged to master soon. But ticket JDK-8347826 doesn't mention Java 17 backporting. Can you please also add request for backporting to Java 17 also. Many Thanks, |
….java Co-authored-by: Aleksandr Zvegintsev <77687766+azvegint@users.noreply.github.com>
Sure, however usually backports are requested in backward order (23, 21, 17, ...) after the change is integrated to the upstream. So, I'm going to backport this after the integration is completed. |
|
/integrate |
|
/reviewers 2 reviewer |
|
https://openjdk.org/groups/client-libs/ |
|
In jdk 9 we started to sort the list of methods for each class for a few reasons, and the main one was:
So MethodOrder is just a workaround to help us reproduce the bugs. I understand how the current change will fix the problem, but it would be nice to update the code that retrieves the method from that list, or at least provide some information why we can't do that. Example from the past #7190 where MethodOrder was simplified due to JDK-8196373 |
@mrserb Sorry, I don't feel I completely understand what are you asking for. What do you mean "the code that retrieves the method from that list"? Should I add comments somewhere in source code with the issue details why does Introspector.addMethod() work wrong for now, or with details about sorting? Or should I update the PR description? I couldn't find any clues in #7190, sorry. And BTW, I'm concerning why I can't find a check in this PR which builds and tests the change. Should I trigger it somehow, or is it just invisible for me? |
In the past we received various reports that were caused by bugs in the Introspector implementation, but we could not reproduce them because that bugs depended on some order of methods returned by the Class.getMethods(). So, the method you updated was added to make the method list stable, it is just a utility wrapper. You don't need to update that method. But instead you can change the code that uses the result of MethodInfo.get() in Or, most likely, you can skip adding the default method in MethodInfo.get() if non-default methods are already added.
You should enable that actions/checks in your fork. |
|
For example, if you change the return type of After8071693.B.getDefault1() to String + mark parent as non-default + change "A" from interface to class, the correct method will be chosen, because the code for covariance types will discard the "Object version" and choose the "String version" of the method. Similar logic should be added to discard default methods if the same non-default method exists. |
|
Also please check the next example: Is the next output expected()? btw it will be good to cover this scenario in the test. |
I'm currently busy, I'll get to look at this PR as soon as I can. Does it make sense to expand tests to cover cases that @mrserb brought up? With module system and exported vs non-exported classes and interfaces? |
|
Could you review, please? |
Please update the test to cover the latest change. |
|
It would be nice to merge the master, the branch is quite outdated |
Done |
|
/integrate |
|
/sponsor |
|
Going to push as commit c5f235c.
Your commit was automatically rebased without conflicts. |
Fixed
com.sun.beans.introspect.MethodInfoandcom.sun.beans.introspect.PropertyInfoto makeIntrospector.addMethod()working properly when filtering methods out.Also, after PR discussion, added the approptiate test cases with corresponding fixes in MethodInfo.java and PropertyInfo.java.
getMethodDescriptors()returns descriptors of public methods of a class and its parent classes, including default and static methods defined in interfaces. The result doesn't include methods which were declared and not implemented, bridge methods, or methods which were overriden in subclasses.When a subclass "overrides" a static method from a parent class
getMethodDescriptors()behaves as follows:getPropertyDescriptors()returns descriptors of methods which were identified as getters or setters. As there can be the only method getter/setter per property, the following rules are applied when choosing a getter/setter:Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23443/head:pull/23443$ git checkout pull/23443Update a local copy of the PR:
$ git checkout pull/23443$ git pull https://git.openjdk.org/jdk.git pull/23443/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23443View PR using the GUI difftool:
$ git pr show -t 23443Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23443.diff
Using Webrev
Link to Webrev Comment