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 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