Implicit 'this' return for void methods

Eirik Lygre eirik.lygre at
Thu Mar 27 20:52:21 UTC 2014

On Thu, Mar 27, 2014 at 5:35 PM, Jochen Theodorou <blackdrag at> wrote:

> Am 26.03.2014 16:51, schrieb Guy Steele:
> [...]
>  I am wholeheartedly in favor of allowing "chaining" of dotted expressions
>> such as
>>     CharBuffer.allocate(26).position(2).put("C").position(25).put("Z")
> this also shows a potential point of critic this proposal will have to
> find arguments against. This style highly encourages mutation of the
> object, which is not very functional. Since java8 java tries to be more
> functional, thus this idea would be totally against this new line.

The JavaBean specification, with it's "void setSomething()" functions are
fundamental to so many things Java that they will never go away (good
thing, too!).The suggested language change builds on top of that, is
beneficial to a large body of existing code and does not invalidate any
existing practices.

It is, I think, a great example of bang for the buck -- low cost, high
return. No changes needed in the VM; everything can be done by the
compiler. Almost too sweet.

I should have paid more attention to the dragon book, so that I could have
taken a shot at the compiler myself :-/


More information about the core-libs-dev mailing list