DEV Community

Discussion on: How I misunderstood Lombok

Collapse
 
moaxcp profile image
John Mercier • Edited

It makes sense that lombok would put the check after the call to super(name). Any call to a super constructor must be the first statement in the child constructor. It is a compile error otherwise. This is because the parent needs to be initialized before any parent methods may be called in the child constructor. I think that since name is already checked in the parent it shouldn't be checked in the child.