▲ | BlindEyeHalo 3 days ago | |||||||
Crazy that it took this long to allow parameter validation and transformation before calling super in the constructor. That was something that always bothered me because it felt so counterintuitive. | ||||||||
▲ | delusional 3 days ago | parent | next [-] | |||||||
Especially because you were always able to bypass it by declaring a `static` function and calling that as part of the parameters to `super`: public Foo(int x) { super(validate(x)); } validate would run before super, even though super was technically the first statement in the constructor, and the compiler was happy. | ||||||||
| ||||||||
▲ | PaulHoule 3 days ago | parent | prev | next [-] | |||||||
I've been programming in Java since before JDK 1.0 and that was one misfeature that bothered me then but that I've long since learned to work around. | ||||||||
▲ | extraduder_ire 2 days ago | parent | prev [-] | |||||||
Wasn't that possible since java 22? | ||||||||
|