Hi Tomasz,
Interesting idea but I’m not sure it’s worthwhile. A setting might seem simple and innocuous, but I don’t think lombok is actually improved if we have 50 parameters on every exception, most of which are exotic and therefore it would not be immediately obvious as to why most of them exist.
It’s also a tad hairy. What do we do for a method that returns a primitive? Return 0
/ false
/ 0.0
/ '\0'
? I think
that’s reaching - but it shows that RETURN_NULL
simply cannot be the name of that enum; it’d have to be RETURN_DEFAULT
or something, but how would you describe the behaviour of java for uninitialized non-final fields (0 / null / false / 0.0 / etc), also in light of valhalla types in future java releases? I don’t think a pithy term even exists.
Thus, clarity kills this proposal. I don’t see any route to make clear at a glance what this does, and this feature is by no means useful enough to warrant adding something that requires reading a manual to figure out.