Invoking overridable methods during construction is Allowed - there is nothing illegal about this.
Invoking overridable methods during construction is NOT Advisable - It is generally ill-advised to invoke overridable methods during construction because this can cause incomplete objects to be exposed and restricts the predictability of the system.
public class A {
final int a;
public A() {
a = method();
}
protected int method() {
return 42;
}
@Override
public String toString() {
return "A{" + "a=" + a + '}';
}
}
public class B extends A {
@Override
protected int method() {
System.out.println("this=" + this);
return 96;
}
}
public void test() {
System.out.println("B = " + new B());
}
Note that your first quote only refers to the documentation, not the code. I would suggest the only issue is the use of must when should would probably be more appropriate.