JDK-8132153 : @BeanProperty "bound" is broken
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2015-07-22
  • Updated: 2015-07-27
  • Resolved: 2015-07-24
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.
JDK 9
9Resolved
Related Reports
Relates :  
Relates :  
Description
Please run:

import java.beans.BeanInfo;
import java.beans.BeanProperty;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;


public class Test {

    public static class C {

        private double x;


        @BeanProperty(
            bound     = true,
            expert    = true,
            hidden    = true,
            preferred = true,
            description = "TEST",
            enumerationValues = {
                "javax.swing.SwingConstants.EAST"}
            )
        public void setX(double d) { x = d; }
        public double getX() { return x; }
    }

    public static void main(String[] args) throws Exception {

        BeanInfo i = Introspector.getBeanInfo(C.class, Object.class);
        PropertyDescriptor x = i.getPropertyDescriptors()[0];

        System.out.println(x.getName() + ": " + x.getShortDescription());
        System.out.println("bound:     " + x.isBound());
        System.out.println("expert:    " + x.isExpert());
        System.out.println("hidden:    " + x.isHidden());
        System.out.println("preferred: " + x.isPreferred());
    }
}


Output (JDK9 b73, Ubuntu 14.04 Linux):

x: TEST
bound:     false
expert:    true
hidden:    true
preferred: true

Comments
Yes, sorry, it was mentioned in the documentation. I have to update the webrev for JDK-8132237.
27-07-2015

The bound property affects the beans that have the {@link PropertyChangeListener propertyChange} event set. It will work if you add this to the test: private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); public void addPropertyChangeListener(PropertyChangeListener listener) { this.pcs.addPropertyChangeListener(listener); } public void removePropertyChangeListener(PropertyChangeListener listener) { this.pcs.removePropertyChangeListener(listener); }
24-07-2015