JDK-8131684 : @SwingContainer: what is the correct result for getBeanDescriptor().getValue("isContainer") for an unannotated class?
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2015-07-16
  • Updated: 2021-07-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
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

Comments
Part of this issue was fixed in JDK-8076312. The case what should be returned when @SwingContainer is not present still under discussion.
24-07-2015