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

core: allow Java 7 source and bytecode #4801

Merged
merged 1 commit into from
Aug 28, 2018

Conversation

ericgribkoff
Copy link
Contributor

(This PR is a follow-up for an issue identified in #4799 and should not be merged without that change)

javac can produce code that invokes Object.requireNonNull when instantiating
an inner class using a instance variable. See
https://bugs.openjdk.java.net/browse/JDK-8202137

@ejona86 From the linked bug, I don't see that there is an option here other than marking the inner class non-static. It's slightly unsettling that we apparently need animalsniffer to catch javac including code that isn't present on old Android devices; I haven't had time to check if the android build system would otherwise do something fancy here to avoid issues at runtime on older devices.

If this looks alright, do you want to cherry-pick this commit into #4799, or keep this as a stand-alone PR?

Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this a separate PR.

@@ -74,7 +74,7 @@ void cancel(boolean permanent) {
}
}

private static final class FutureRunnable implements Runnable {
private final class FutureRunnable implements Runnable {

private final Rescheduler rescheduler;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this as well? Otherwise it could be pretty confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

The JDK will produce code that invokes Object.requireNonNull when instantiating
an inner class using a instance variable. See
https://bugs.openjdk.java.net/browse/JDK-8202137
Rescheduler.this.serializingExecutor.execute(new ChannelFutureRunnable());
}

private boolean isEnabled() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... Sorry, I missed that. A bit of a pain. Whatever.

@ericgribkoff ericgribkoff merged commit 67ee4b6 into grpc:master Aug 28, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Nov 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants