Not sure if that's a bug, but just in case. Does the annotation affect only the public accessors?
Please run the following example:
import java.beans.*;
public class Test {
public static class C {
private boolean prop = false;
@BeanProperty(hidden = true, expert = true, description = "xxx")
void setX(boolean b) { prop = b; }
public boolean getX() { return prop; }
}
public static void main(String[] args) throws Exception {
BeanInfo i = Introspector.getBeanInfo(C.class, Object.class);
PropertyDescriptor pd[] = i.getPropertyDescriptors();
for (PropertyDescriptor d: pd) {
System.out.print(d.getShortDescription());
System.out.print(", hidden = " + d.isHidden());
System.out.println(", expert = " + d.isExpert());
}
}
}
Here the setter for the base class do not have "public" modifier. Output (Win 7, JDK9 b72):
"x, hidden = false, expert = false"
(so it seems we have some default values here generated just because of presence of the public setter)
Then please move the annotation to set it in front of the public getter. Then the output is as expected:
"xxx, hidden = true, expert = true"