Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use of '_' as an identifier might not be supported in releases after Java SE 8 #1

Closed
debdattabasu opened this issue Jan 6, 2015 · 6 comments

Comments

@debdattabasu
Copy link

Hi,
First of all, thank you for such an awesome library, made even more awesome by Java8's lambdas. However, in Java8 builds, the use of underscore seems to be marked for deprecation. It gives a warning on compilation. Is there some other name you can give the underscore object?

Regards,
Debdatta Basu

@javadev
Copy link
Owner

javadev commented Jan 6, 2015

What character may be used for replacement _? :)

@debdattabasu
Copy link
Author

Well, the reasoning behind using _ in js is that it is a short identifier. However, in java we have static imports. So, we can name the static class whatever we want, import it, and have all the functions in the global namespace.

I was thinking something like Functional. So you can do:

Functional.each(collection, item-> {});

or, you can do:

import static Functional

each(collection, item->{});

Edit: you can even name it Underscore. Silly me. :D
What do you think?

@javadev
Copy link
Owner

javadev commented Jan 7, 2015

Underscore is a good name for the class. I will prepare a pull request.

@javadev
Copy link
Owner

javadev commented Sep 21, 2015

'_' was changed with '$' 👍

@javadev
Copy link
Owner

javadev commented Aug 3, 2018

$ was changed with U.

tpai added a commit to tpai/docker-l1jtw-server that referenced this issue May 4, 2019
@javadev
Copy link
Owner

javadev commented Dec 4, 2021

U was changed with Underscore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants