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

Reply via email to