there are a couple of discussion on SO about setter methods returning "this" type. And looks like java 7 had the proposal of void methods returning this. But this proposal could not make it to java 7 features. I could not find if this proposal is moved on to java 8 or future or have been completely discarded. Is it?
I can't seem to find any sources of that, but I believe this feature was dropped completely. There are numerous reasons I can think of:
performance - each
voidmethod now has an extra return opcode and every place where this method is called needs implicit
popunless it actually uses method chaining
backward compatibility - compiling against this feature suddenly makes the code backward incompatible because the contract of every
voidmethod has changed
Of course this can also be implemented by the compiler (calling method on
void? You probably meant
this, let me add this implicitly), don't know what are the disadvantages of this approach.
I don't believe this was ever formally proposed for the 2009 incarnation of Project COIN. This page purports to list all of the proposals, and I can't see one that corresponds.
If it wasn't proposed, it wouldn't have been considered.