Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4960996

[JDK1.5.0] NPE from Introspector.getBeanInfo if there are no properties

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 5.0
    • client-libs
    • None
    • x86
    • windows_2000

      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

            mdavidsosunw Mark Davidson (Inactive)
            tpavek Tomáš Pávek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: