JEP 302: Lambda Leftovers

Nicolai Parlog nipa at
Wed Dec 7 10:30:56 UTC 2016


Great proposal! Especially the underscore is cool, much better than
naming those variables "ignored". I wonder whether I should start using
two underscores now so I can later replace them with a single one. :) I
guess it will be possible to use "_" for multiple parameters?

I would like to request a feature regarding method references. I like
making non-public methods static to convey the fact that they do not
interact with or even change the state of the object they are called on.
But this conflicts with the ease of method references:

	// `isGenderNeutralName` is an instance method


	// `isGenderNeutralName` is a static method

As a consequence I often go back and make it an instance method to keep
the reference readable but it hurts because I give up on an immutability

It would be awesome if it were possible to reference a static method in
the same class without repeating the entire class name. Reusing the
`class` keyword seems like an obvious* choice:

	// `isGenderNeutralName` is a static method

Using Martijn's shorthand, IANALE (I Am Not A Language Expert) so I have
no idea whether this is tractable but it would surely be a nice addition.

 so long ... Nicolai

* I am aware that the obvious idea might be also be a terrible idea.

On 07.12.2016 00:50, mark.reinhold at wrote:
> New JEP Candidate:
> - Mark


PGP Key:

        a blog about software development
        high-quality Java/JVM content
        Free and Open Source Software for the City of Dortmund


More information about the platform-jep-discuss mailing list