From vadim.beilin at gmail.com Sat Jan 27 11:45:55 2018 From: vadim.beilin at gmail.com (Vadim Beilin) Date: Sat, 27 Jan 2018 11:45:55 +0000 Subject: Regression in Introspector Message-ID: 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 value; public T getValue() { return value; } protected void setValue(T value) { this.value = value; } } class Child extends Parent { @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: From Sergey.Bylokhov at oracle.com Sun Jan 28 09:15:45 2018 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Sun, 28 Jan 2018 01:15:45 -0800 Subject: Regression in Introspector In-Reply-To: References: Message-ID: <6a0af018-9902-af43-560e-c19f374935c1@oracle.com> Hi, Vadim. > Is it something you have seen before? Does it look like a bug to you? It looks like a bug, please report it here: https://bugs.java.com/ -- Best regards, Sergey. From semyon.sadetsky at oracle.com Mon Jan 29 16:40:26 2018 From: semyon.sadetsky at oracle.com (Semyon Sadetsky) Date: Mon, 29 Jan 2018 08:40:26 -0800 Subject: Regression in Introspector In-Reply-To: References: Message-ID: <2c262e40-03c2-57ce-14a2-876616334220@oracle.com> 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 value; > ??? public T getValue() { > ??????? return value; > ??? } > ??? protected void setValue(T value) { > ??????? this.value = value; > ??? } > } > > class Child extends Parent { > ??? @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 From vadim.beilin at gmail.com Mon Jan 29 22:51:44 2018 From: vadim.beilin at gmail.com (Vadim Beilin) Date: Mon, 29 Jan 2018 22:51:44 +0000 Subject: Regression in Introspector In-Reply-To: <2c262e40-03c2-57ce-14a2-876616334220@oracle.com> References: <2c262e40-03c2-57ce-14a2-876616334220@oracle.com> Message-ID: 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 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 value; >> public T getValue() { >> return value; >> } >> protected void setValue(T value) { >> this.value = value; >> } >> } >> >> class Child extends Parent { >> @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: From Sergey.Bylokhov at oracle.com Tue Jan 30 03:14:49 2018 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Mon, 29 Jan 2018 19:14:49 -0800 Subject: Regression in Introspector In-Reply-To: References: <2c262e40-03c2-57ce-14a2-876616334220@oracle.com> Message-ID: <98049d04-a715-6ea1-f2e7-6ffff10ede53@oracle.com> Hi, Vadim. Thank you for the report. On 29/01/2018 14:51, Vadim Beilin wrote: > 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. -- Best regards, Sergey.