On Thu, 6 Feb 2025 14:13:50 GMT, Roman Marchenko <rmarche...@openjdk.org> wrote:

>> Fixed `com.sun.beans.introspect.MethodInfo#MethodOrder` to make 
>> `Introspector.addMethod()` working properly when filtering methods out.
>> 
>> Also fixed the test, and added the approptiate test case.
>
> Roman Marchenko has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Update test/jdk/java/beans/Introspector/DefaultMethodBeanPropertyTest.java
>   
>   Co-authored-by: Aleksandr Zvegintsev 
> <77687766+azveg...@users.noreply.github.com>

In jdk 9 we started to sort the list of methods for each class for a few 
reasons, and the main one was:
 1. We had a number of bugs which state that our JavaBeans randomly does not 
work, examples: JDK-6807471[1] , JDK-6788525[2], the reason was that the order 
of methods from Class.getMethods() is not specified.

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 https://github.com/openjdk/jdk/pull/7190 where 
MethodOrder was simplified due to JDK-8196373

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23443#issuecomment-2644491830

Reply via email to