JDK-8132067 : declaring user-defined BeanInfo class static/non-static affects the bean info
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 9
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2015-07-21
  • 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
Please compile/run the attached code. The output will be (JDK9 b73, Ubuntu 14.04 Linux):

description: user-defined-description
default property index: 1
default event index: 0
isContainer: true
containerDelegateuser-defined-delegate

property descriptors:

---other---
isBound: false
isConstrained: false
isExpert: false
isHidden: false
isPreferred: false
required: false
visualUpdate: false
---value---
isBound: true
isConstrained: true
isExpert: true
isHidden: true
isPreferred: true
required: true
visualUpdate: true

(as expected). Then please remove the "static" keyword from TestClassBeanInfo declaration (declaring "TestClass" static / non-static does not affect the results). The output now is invalid:

description: StaticOrNot$TestClass
default property index: -1
default event index: -1
isContainer: null
containerDelegatenull

property descriptors:

---other---
isBound: false
isConstrained: false
isExpert: false
isHidden: false
isPreferred: false
required: null
visualUpdate: null
---value---
isBound: false
isConstrained: false
isExpert: false
isHidden: false
isPreferred: false
required: null
visualUpdate: null

- is that what expected?

Please note also that in case if we, e.g., remove TestClassBeanInfo and TestClass from the test class (placing them to the separate files), then the result would be correct (no need in "static"). But: at the same time we'll have the same incorrect result when using jtreg.

These static / non-static changes seemingly do not affect new bean annotations (@JavaBean, @BeanProperty, @SwingContainer).
Comments
Targeted to 10 as an issue introduced in 8u or 9
17-02-2017

Approved by component triage team to defer
12-08-2016

SQE: OK to defer
12-08-2016

9-client-defer-candidate: There is no resource to fix it in jdk9.
12-08-2016