JDK-8030123 : java/beans/Introspector/Test8027648.java fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • Submitted: 2013-12-13
  • Updated: 2021-04-21
  • Resolved: 2015-04-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8u270Fixed 9 b65Fixed openjdk8u302Fixed
Related Reports
Relates :  
Relates :  
Description
Fails on custom jdk1.8.0b120(link in comment) and jdk1.8.0b119. Fails on jdk1.7.0_45b18 for another reason. So it can be regression.

on jdk1.8.0 fails with exception

java.lang.Error: the child property type is not override the parent property type
	at Test8027648.test(Test8027648.java:45)
	at Test8027648.main(Test8027648.java:38)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:744)

on jdk1.7.0_45b18 with

java.lang.AssertionError: java.beans.IntrospectionException: type mismatch between indexed read and indexed write methods: index
        at java.beans.IndexedPropertyDescriptor.<init>(IndexedPropertyDescriptor.java:480)
        at java.beans.Introspector.processPropertyDescriptors(Introspector.java:647)
        at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:543)
        at java.beans.Introspector.getBeanInfo(Introspector.java:418)
        at java.beans.Introspector.getBeanInfo(Introspector.java:163)
        at BeanUtils.getPropertyDescriptors(BeanUtils.java:64)
        at BeanUtils.findPropertyDescriptor(BeanUtils.java:111)
        at Test8027648.getPropertyType(Test8027648.java:50)
        at Test8027648.test(Test8027648.java:43)
        at Test8027648.main(Test8027648.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
        at java.lang.Thread.run(Thread.java:744)
Caused by: java.beans.IntrospectionException: type mismatch between indexed read and indexed write methods: index
        at java.beans.IndexedPropertyDescriptor.findIndexedPropertyType(IndexedPropertyDescriptor.java:387)
        at java.beans.IndexedPropertyDescriptor.setIndexedReadMethod(IndexedPropertyDescriptor.java:215)
        at java.beans.IndexedPropertyDescriptor.<init>(IndexedPropertyDescriptor.java:471)
        ... 15 more
Comments
Fix Request (8u) This fixes a bug in beans, and keeps codebases in sync (I see 8u271/8u270). Patch applies cleanly (with usual reshufflings). Affected test used to fail, now passes.
19-04-2021

Test fails for SLES for jdk8u25b17 also RULE java/beans/Introspector/Test8027648.java Exception java.lang.Error: the child property type is not override the parent property type
25-11-2014

Release team: Approved for deferral.
17-12-2013

I suggest to defer this issue because the introspection of indexed properties is a rare case. For overridden methods now user could get a wrong property type. public static class BaseBean { public Object getIndex(int index) { ... } public void setIndex(int index, Object value) { ... } } public static class MyBean extends BaseBean { @Override public String getIndex(int index) { ... } public void setIndex(int index, String value) { ... } } In the example above the property type is Object on Ubuntu (wrong) and String on Windows (right). This is a regression since Generics were introduced, because now it is possible to override a method with another method, which return type is more specific.
16-12-2013

The reason is that the IndexedPropertyDescriptor(PropertyDescriptor,PropertyDescriptor) constructor, which has not been modified for years, relies on order of method retrieved via Reflection. The 7122138 issue fixes similar problem in PropertyDescriptor(PropertyDescriptor,PropertyDescriptor).
16-12-2013

This issue is reproducible on Ubuntu with 8b120.
16-12-2013

This issue is reproducible with 7u45 because the 8027648 fix is not backported to 7u.
16-12-2013

The issue is not reproducible on Windows 7 with JDK 8 b120: C:\utils\jdk32\8b120d\bin\javac.exe Test8027648.java BeanUtils.java C:\utils\jdk32\8b120d\bin\java.exe Test8027648 The issue is reproducible on Windows 7 with JDK 7u45 b18: C:\utils\jdk32\7u45b18d\bin\javac.exe Test8027648.java BeanUtils.java C:\utils\jdk32\7u45b18d\bin\java.exe Test8027648 Exception in thread "main" java.lang.AssertionError: java.beans.IntrospectionException: type mismatch between indexed read and indexed write methods: index at java.beans.IndexedPropertyDescriptor.<init>(IndexedPropertyDescriptor.java:480) at java.beans.Introspector.processPropertyDescriptors(Introspector.java:647) at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:543) at java.beans.Introspector.getBeanInfo(Introspector.java:418) at java.beans.Introspector.getBeanInfo(Introspector.java:163) at BeanUtils.getPropertyDescriptors(BeanUtils.java:64) at BeanUtils.findPropertyDescriptor(BeanUtils.java:111) at Test8027648.getPropertyType(Test8027648.java:50) at Test8027648.test(Test8027648.java:43) at Test8027648.main(Test8027648.java:37) Caused by: java.beans.IntrospectionException: type mismatch between indexed read and indexed write methods: index at java.beans.IndexedPropertyDescriptor.findIndexedPropertyType(IndexedPropertyDescriptor.java:387) at java.beans.IndexedPropertyDescriptor.setIndexedReadMethod(IndexedPropertyDescriptor.java:215) at java.beans.IndexedPropertyDescriptor.<init>(IndexedPropertyDescriptor.java:471) ... 9 more
16-12-2013