-
Bug
-
Resolution: Unresolved
-
P3
-
9
Please run:
import java.beans.*;
public class Test {
public static class C {
private int x;
@BeanProperty(
hidden = true,
preferred = true,
description = "xxx"
)
public void setX(int i) { x = i; }
public double getX() { return x; }
}
public static void main(String[] args) throws Exception {
BeanInfo i = Introspector.getBeanInfo(C.class, Object.class);
PropertyDescriptor d = i.getPropertyDescriptors()[0];
System.out.println(d.getShortDescription());
System.out.println(d.isHidden());
System.out.println(d.isPreferred());
}
}
note: here getX() returns double instead of int.
Output (JDK9 b73, linux-64):
x
false
false
- just default values.
If change "double getX()" to "int getX()" then the output will be as expected:
xxx
true
true
import java.beans.*;
public class Test {
public static class C {
private int x;
@BeanProperty(
hidden = true,
preferred = true,
description = "xxx"
)
public void setX(int i) { x = i; }
public double getX() { return x; }
}
public static void main(String[] args) throws Exception {
BeanInfo i = Introspector.getBeanInfo(C.class, Object.class);
PropertyDescriptor d = i.getPropertyDescriptors()[0];
System.out.println(d.getShortDescription());
System.out.println(d.isHidden());
System.out.println(d.isPreferred());
}
}
note: here getX() returns double instead of int.
Output (JDK9 b73, linux-64):
x
false
false
- just default values.
If change "double getX()" to "int getX()" then the output will be as expected:
xxx
true
true
- duplicates
-
JDK-8131342 new @BeanProperty annotation: could we specify more than one per bean?
- Closed
-
JDK-8132240 @BeanProperty: Bean info depends on an order of setters declaration
- Closed
- relates to
-
JDK-8132240 @BeanProperty: Bean info depends on an order of setters declaration
- Closed
-
JDK-8132269 [TESTBUG] Add regression test for JDK-8132163, JDK-8132240
- Closed