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

@BeanProperty "bound" is broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 9
    • 9
    • client-libs
    • None

      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

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

              Created:
              Updated:
              Resolved: