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

Introspector.getBeanInfo() fails for SwingBeanInfoBase, AbstractButtonBeanInfo etc

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • 9
    • 9
    • client-libs

      Please run the following test:

      import java.beans.BeanInfo;
      import java.beans.IntrospectionException;
      import java.beans.Introspector;
      import java.beans.SimpleBeanInfo;
      import javax.swing.SwingBeanInfoBase;
      import javax.swing.AbstractButtonBeanInfo;

      public class Test {
          public static void main(String[] args) throws IntrospectionException {

              BeanInfo i = Introspector.getBeanInfo(SimpleBeanInfo.class);
              System.out.println("test: " + i.getMethodDescriptors().length + " descriptors");
          }
      }



      Output:
      "test: 18 descriptors"

      But if replace "SimpleBeanInfo.class" with "SwingBeanInfoBase.class" or "AbstractButtonBeanInfo.class", it fails:

      Exception in thread "main" java.lang.NullPointerException
      at javax.swing.SwingBeanInfoBase.getAdditionalBeanInfo(SwingBeanInfoBase.java:70)
      at java.beans.Introspector.<init>(Introspector.java:445)
      at java.beans.Introspector.getBeanInfo(Introspector.java:204)
      at testfs.Test.main(Test.java:14)
      Java Result: 1


      Is that what expected?

      Checked with JDK9 b70, OS - Win 7.

            serb Sergey Bylokhov
            avstepan Alexander Stepanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: