<Beans Dev> Regression in Introspector

Vadim Beilin vadim.beilin at gmail.com
Mon Jan 29 22:51:44 UTC 2018


I have filed the report.

Regarding the 8156043 fix: Yes, when I use debugger to reverse the effects
of `list.sort(MethodOrder.instance)` in MethodInfo.get(Class<?>), the write
method is found as expected.

Regards,
Vadim

On 29 January 2018 at 16:40, Semyon Sadetsky <semyon.sadetsky at oracle.com>
wrote:

> Hello Vadim,
>
> It looks like a consequence of the 8156043 fix discussed on this alias in
> May 2016. The fix author was warned that his change may result in wrong
> property setter methods in case of overriding. Nevertheless he insisted
> that the fix is justified by some improved stability reasons. It could
> require revising if you file this bug.
>
> --Semyon
>
>
> On 01/27/2018 03:45 AM, Vadim Beilin wrote:
>
>> Hello
>> We have come across what looks like a regression between Java 8 and Java
>> 9.
>>
>> The following program prints different results.
>> ------------------------------ BeansMain.java
>> import java.beans.*;
>>
>> class Parent<T> {
>>     T value;
>>     public T getValue() {
>>         return value;
>>     }
>>     protected void setValue(T value) {
>>         this.value = value;
>>     }
>> }
>>
>> class Child extends Parent<Runnable> {
>>     @Override
>>     public void setValue(Runnable value) {
>>         super.setValue(value);
>>     }
>> }
>>
>> public class BeansMain {
>>     public static void main(String[] args) throws IntrospectionException {
>>         BeanInfo beanInfo = Introspector.getBeanInfo(Child.class);
>>         for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
>>             System.out.println(pd.getName() + "\n  >> " +
>> pd.getReadMethod() + "\n  << " + pd.getWriteMethod());
>>         }
>>     }
>> }
>> ------------------------------
>>
>> With Java 8 (1.8.0_161-b12):
>> ------------------------------
>> class
>>   >> public final native java.lang.Class java.lang.Object.getClass()
>>   << null
>> value
>>   >> public java.lang.Object Parent.getValue()
>>   << public void Child.setValue(java.lang.Runnable)
>> ------------------------------
>>
>> With Java 9 (9.0.1+11):
>> ------------------------------
>> class
>>   >> public final native java.lang.Class java.lang.Object.getClass()
>>   << null
>> value
>>   >> public java.lang.Object Parent.getValue()
>>   << null
>> ------------------------------
>>
>> Is it something you have seen before? Does it look like a bug to you?
>>
>>
>>
>> Thanks,
>> Vadim
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/beans-dev/attachments/20180129/22507220/attachment.html>


More information about the beans-dev mailing list