-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.2, 1.3.0, 1.4.0
-
generic, x86, sparc
-
generic, solaris_8, windows_95
Name: rlT66838 Date: 10/04/99
May be related to bug #4144543.
Reproducing the problem:
Create a class (call it "BITest") that extends java.awt.Component and overrides "public void setSize(Dimension size)".
Now call Introspector.getBeanInfo(BITest.class).getPropertyDestriptors(), and find the PropertyDescriptor for the "size" property.
This PropertyDescriptor returns "null" for "getReadMethod()", when it should return the "Component.getSize" method.
I imagine this is somehow caused by the multiple "setSize" methods defined by Component..?
<---- EXAMPLE SOURCE ---->
/*********************
* File: BITest.java *
*********************/
public class BITest extends java.awt.Component {
public void setSize(java.awt.Dimension size) {
super.setSize( size );
}
}
/*********************
* File: Main.java *
*********************/
import java.beans.*;
public class Main {
public static void main(String[] args) {
try {
BeanInfo bi = Introspector.getBeanInfo(BITest.class);
PropertyDescriptor[] pds = bi.getPropertyDescriptors();
PropertyDescriptor sizePD = null;
for(int i = 0; i < pds.length; i++) {
if (pds[i].getName().equals("size")) {
sizePD = pds[i];
break;
}
}
System.out.println("size ReadMethod: " + sizePD.getReadMethod());
} catch (Exception e) {
e.printStackTrace();
}
}
}
(Review ID: 36341)
======================================================================
- duplicates
-
JDK-4408406 "displayedMnemonic" property missing in javax.swing.JLabelBeanInfo
-
- Closed
-
-
JDK-4470622 JColorChooser exports data in unsupported 'int' format
-
- Closed
-
-
JDK-4477877 Introspection depends on method order, method order depends on class load order
-
- Resolved
-