<Beans Dev> Regression in Introspector
Vadim Beilin
vadim.beilin at gmail.com
Sat Jan 27 11:45:55 UTC 2018
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/20180127/a68dc00d/attachment.html>
More information about the beans-dev
mailing list