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

Rewrite generated calls to Objects.requireNonNull() #75

Closed
cushon opened this issue Dec 11, 2015 · 2 comments
Closed

Rewrite generated calls to Objects.requireNonNull() #75

cushon opened this issue Dec 11, 2015 · 2 comments

Comments

@cushon
Copy link
Contributor

cushon commented Dec 11, 2015

In JDK 8 and below, javac generates synthetic null-checks by calling Object.getClass. Starting in JDK 9, Objects.requireNonNull() is used if it is available (see JDK-8074306).

This prevents retrolambda users from compiling code with JDK9 and running it on JDK6 or below, since java.util.Objects was introduced in JDK7.

When targeting JDK < 7, retrolambda should rewrite the generated calls to requireNonNull.

@luontola
Copy link
Owner

Cool. Thanks about telling what JDK 9 does. I haven't yet tried using it. I'll try to get some time to update Retrolambda this month.

cushon added a commit to cushon/retrolambda that referenced this issue Mar 3, 2016
requireNonNull is only available in JDK 7 and above.

Starting in JDK 9, javac uses requireNonNull for synthetic null-checks,
see: http://bugs.openjdk.java.net/browse/JDK-8074306

Fixes luontola#75
@luontola
Copy link
Owner

This is included in Retrolambda 2.2.0

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