-
Bug
-
Resolution: Duplicate
-
P3
-
9
-
None
Please run:
import java.beans.*;
public class Test {
public static class C1 {
private Object x;
@BeanProperty(expert = true, description = "xxx")
public void setX(Object i) { x = i; }
public void setX(int i) { x = i; }
public Object getX() { return x; }
}
public static class C2 {
private Object x;
@BeanProperty(expert = true, description = "xxx")
public void setX(int i) { x = i; }
public void setX(Object i) { x = i; }
public Object getX() { return x; }
}
public static void main(String[] args) throws Exception {
PropertyDescriptor d;
d = Introspector.getBeanInfo(C1.class, Object.class).getPropertyDescriptors()[0];
System.out.println(d.getShortDescription() + " " + d.isExpert());
d = Introspector.getBeanInfo(C2.class, Object.class).getPropertyDescriptors()[0];
System.out.println(d.getShortDescription() + " " + d.isExpert());
}
}
Please note: C1 and C2 are equal in fact; the only difference is an order of setters (in the 2nd case the annotation precedes the setter whose type differs from the field 'x' type)
Output (JDK9 b73, Ubuntu 14.04 Linux):
xxx true
x false
import java.beans.*;
public class Test {
public static class C1 {
private Object x;
@BeanProperty(expert = true, description = "xxx")
public void setX(Object i) { x = i; }
public void setX(int i) { x = i; }
public Object getX() { return x; }
}
public static class C2 {
private Object x;
@BeanProperty(expert = true, description = "xxx")
public void setX(int i) { x = i; }
public void setX(Object i) { x = i; }
public Object getX() { return x; }
}
public static void main(String[] args) throws Exception {
PropertyDescriptor d;
d = Introspector.getBeanInfo(C1.class, Object.class).getPropertyDescriptors()[0];
System.out.println(d.getShortDescription() + " " + d.isExpert());
d = Introspector.getBeanInfo(C2.class, Object.class).getPropertyDescriptors()[0];
System.out.println(d.getShortDescription() + " " + d.isExpert());
}
}
Please note: C1 and C2 are equal in fact; the only difference is an order of setters (in the 2nd case the annotation precedes the setter whose type differs from the field 'x' type)
Output (JDK9 b73, Ubuntu 14.04 Linux):
xxx true
x false
- duplicates
-
JDK-8132163 @BeanProperty: Bean info depends on a getter return type / setter argument type
- Open
- relates to
-
JDK-8132163 @BeanProperty: Bean info depends on a getter return type / setter argument type
- Open
-
JDK-8132973 @BeanProperty: what is the correct output in case of repeating annotations?
- Resolved
-
JDK-8132269 [TESTBUG] Add regression test for JDK-8132163, JDK-8132240
- Closed