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

@SwingContainer: what is the correct result for getBeanDescriptor().getValue("isContainer") for an unannotated class?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9
    • client-libs

      Not sure if that's a bug, but looking at JDK-8130937: what is the expected result for "C": "false" or "null"?

      import java.beans.IntrospectionException;
      import java.beans.Introspector;
      import javax.swing.SwingContainer;

      public class SwingContainerTest {
          
          @SwingContainer
          public class A {}
          
          @SwingContainer(false)
          public class B {}
          
          public class C {}
          
          static void test(Class<?> c) throws IntrospectionException {
              System.out.println(c.getSimpleName() + ": " +
                      Introspector.getBeanInfo(c, Object.class).getBeanDescriptor().getValue("isContainer"));
          }
          
          public static void main(String[] args) throws IntrospectionException {
              test(A.class);
              test(B.class);
              test(C.class);
          }
      }

      Output (JDK9 b72, Win 7):

      A: true
      B: false
      C: null

            Unassigned Unassigned
            avstepan Alexander Stepanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: