Name: krC82822 Date: 11/09/2000
9 Nov 2000, eval1127@eng -- reproducible with 1.3.0. See also 4168833.
java version "1.2.2"
Classic VM (build JDK-1.2.2-001, green threads, sunwjit)
Consider the following java bean with test routine.
The getProp() and setProp() methods conflict because
the former returns a float while the latter takes an int.
However, the Introspector detects both methods (this is
the bug).
It should reject one or the other -- as it does in the
case of a non-indexed property, where it rejects the
'get' method...
----test program------
import java.beans.*;
import java.lang.reflect.*;
public class BeanTest {
public static void main(String[] args) throws Exception {
BeanInfo info = Introspector.getBeanInfo(BeanTest.class);
PropertyDescriptor[] props = info.getPropertyDescriptors();
for (int i = 0; i < props.length; i++) {
PropertyDescriptor prop = props[i];
if (Class.class.equals(prop.getPropertyType())) continue;
System.out.println("Property: type " + prop.getPropertyType());
System.out.println(" read " + prop.getReadMethod());
System.out.println(" write " + prop.getWriteMethod());
if (prop instanceof IndexedPropertyDescriptor) {
IndexedPropertyDescriptor iprop = (IndexedPropertyDescriptor)prop;
System.out.println(" idx read " + iprop.getIndexedReadMethod());
System.out.println(" idx write " + iprop.getIndexedWriteMethod());
}
}
}
public float getProp(int i) { return 0f; }
public void setProp(int i, int x) { }
}
-----java output-----
Property: type null
read null
write null
idx read public float BeanTest.getProp(int) <=== should be null
idx write public void BeanTest.setProp(int,int)
(Review ID: 102302)
======================================================================