JDK-4960996 : [JDK1.5.0] NPE from Introspector.getBeanInfo if there are no properties
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-11-28
  • Updated: 2003-12-01
  • Resolved: 2003-12-01
Related Reports
Duplicate :  
Duplicate :  
Description
Introspector.getBeanInfo fails on beans returning empty array of PropertyDescriptor in their BeanInfo. 
        at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:593)
        at java.beans.Introspector.getBeanInfo(Introspector.java:382)
        at java.beans.Introspector.getBeanInfo(Introspector.java:152)
...

Observed in tiger build 29. The cause seems to be that Introspector.properties map is now created in processPropertyDescriptors() method (was created automatically with the class in jdk 1.4.x), but only if there were some properties found - if it does not happen, processPropertyDescriptors() returns immediately as pdStore is null (pdStore is created if addPropertyDescriptor() is called at least once).

You may test this e.g. in current NetBeans dev builds, creating a new form and setting e.g. BoxLayout (it has no properties).
###@###.### 2003-11-28

Comments
EVALUATION Looks like a duplicate of 4948761 which was fixed and integrated for b30. ###@###.### 2003-12-01
01-12-2003