JDK-4812428 : Exception comes to occur at getBeanInfo() in 1.4.X, not in 1.3.1
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-02-04
  • Updated: 2003-03-17
  • Resolved: 2003-03-17
Related Reports
Duplicate :  
Relates :  
Description
An Exception occurs at getBeanInfo() method in 1.4.X, although it does not
in 1.3.1_0X.


REPRODUCE:
 1. Compile the attached 3 files
    (TestBean.java, TestBeanParent.java, TestMain.java)
 2. Launch "java TestMain TestBean"


BEHAVIOR:

- Actual behavior(1.4.X)

goedel[74]% java TestMain TestBean
Exception in thread "main" java.lang.Error: PropertyDescriptor: internal error while merging PDs: type mismatch between read and write methods
        at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:343)
        at java.beans.IndexedPropertyDescriptor.<init>(IndexedPropertyDescriptor.java:243)
        at java.beans.Introspector.processPropertyDescriptors(Introspector.java:715)
        at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:549)
        at java.beans.Introspector.getBeanInfo(Introspector.java:372)
        at java.beans.Introspector.getBeanInfo(Introspector.java:144)
        at TestMain.main(TestMain.java:13)


- Expected behavior(1.3.1_06)

goedel[20]% java TestMain TestBean
PropertyDescriptor[0]: class
  Type  : class java.lang.Class
  Getter: public final native java.lang.Class java.lang.Object.getClass()
  Setter: null
PropertyDescriptor[1]: rec
  Type  : class java.lang.String
  Getter: null
  Setter: public void TestBeanParent.setRec(java.lang.String)
  IndexedGetter: public TestBean TestBeanParent.getRec(int)
  IndexedSetter: null

CONFIGRATION:
  OS : Solaris7/Windows2000(SP2, Japanese)
  JDK:  
    java version "1.4.1"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
    Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

    java version "1.4.2-beta"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b13)
    Java HotSpot(TM) Client VM (build 1.4.2-beta-b13, mixed mode)

==========================================================================

Comments
EVALUATION This exception is a result of the Introspector fix 4387842. Bug 4277957 also descibes a similar problem and both of these issues were resolved for 1.4.0. The getRec/setRec is not really a javabean property since there is no common data type between them. The introspector is also confused if this is a read only property of TestBean or an indexed propertie. This type of edge case is confusing the logic. "rec" is not a valid JavaBean property but it should not throw an exception either. This should be fixed for tiger. ###@###.### 2003-02-04 There are many bugs which are very similar to this one. Fundamentally, the Introspector gets confused when trying to create PropertyDescriptors from methods that have matching names and may span across a class hierarchy. This is a duplicate of 4619536. I've decided to close this bug as a duplicate of 4619536 since that bug described the problem in more detail. ###@###.### 2003-03-17
17-03-2003