RFR: 8347826: Introspector shows wrong method list after 8071693 [v4]
Sergey Bylokhov
serb at openjdk.org
Wed Feb 12 19:20:18 UTC 2025
On Thu, 6 Feb 2025 14:13:50 GMT, Roman Marchenko <rmarchenko at 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+azvegint at users.noreply.github.com>
In that example, the setFoo methods are not overridden but overloaded, so all of them are accessible at runtime. When you pass null, Java tries to select the most specific type, which is Integer. You can change that by casting null to Number.
see https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.12.2.5
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23443#issuecomment-2654635308
More information about the client-libs-dev
mailing list