Avoid further 'type mismatch' errors in ExtendedBeanInfo
This change fixes further cases under JDK 6 in which setting a bridged (e.g. String-returning) read method can conflict with an existing corresponding bridge write method that accepts an Object parameter. This appears to be a implementation difference between JDKs 6 and 7, where the JDK 6 Introspector adds bridge methods and JDK 7 does not. The solution here is to consistently null-out any existing write method before setting the read method. We were doing this elsewhere in ExtendedBeanInfo already, but these two changes make the approach consistent throuhout. Issue: SPR-8806
This commit is contained in:
parent
7b4bc08b14
commit
0c0a563a24
|
|
@ -301,6 +301,7 @@ class ExtendedBeanInfo implements BeanInfo {
|
|||
}
|
||||
}
|
||||
else {
|
||||
pd.setWriteMethod(null);
|
||||
pd.setReadMethod(readMethod);
|
||||
try {
|
||||
pd.setWriteMethod(writeMethod);
|
||||
|
|
@ -310,6 +311,7 @@ class ExtendedBeanInfo implements BeanInfo {
|
|||
// fall through -> add property descriptor as best we can
|
||||
}
|
||||
if (pd instanceof IndexedPropertyDescriptor) {
|
||||
((IndexedPropertyDescriptor)pd).setIndexedWriteMethod(null);
|
||||
((IndexedPropertyDescriptor)pd).setIndexedReadMethod(indexedReadMethod);
|
||||
try {
|
||||
((IndexedPropertyDescriptor)pd).setIndexedWriteMethod(indexedWriteMethod);
|
||||
|
|
|
|||
Loading…
Reference in New Issue