core: switch to Java 7 source and bytecode (#4801)

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
This commit is contained in:
Eric Gribkoff 2018-08-27 20:48:57 -07:00 committed by GitHub
parent a80159f85c
commit 67ee4b6a8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 18 deletions

View File

@ -1,11 +1,5 @@
description = 'gRPC: Core'
// Workaround:
// [Undefined reference (android-api-level-14-4.0_r4)] io.grpc.internal.(Rescheduler.java:87)
// >> Object java.util.Objects.requireNonNull(Object)
sourceCompatibility = 1.6
targetCompatibility = 1.6
dependencies {
compile project(':grpc-context'),
libraries.gson,

View File

@ -60,7 +60,7 @@ final class Rescheduler {
if (wakeUp != null) {
wakeUp.cancel(false);
}
wakeUp = scheduler.schedule(new FutureRunnable(this), delayNanos, TimeUnit.NANOSECONDS);
wakeUp = scheduler.schedule(new FutureRunnable(), delayNanos, TimeUnit.NANOSECONDS);
}
runAtNanos = newRunAtNanos;
}
@ -74,17 +74,14 @@ final class Rescheduler {
}
}
private static final class FutureRunnable implements Runnable {
private final Rescheduler rescheduler;
FutureRunnable(Rescheduler rescheduler) {
this.rescheduler = rescheduler;
}
private final class FutureRunnable implements Runnable {
@Override
public void run() {
rescheduler.serializingExecutor.execute(rescheduler.new ChannelFutureRunnable());
Rescheduler.this.serializingExecutor.execute(new ChannelFutureRunnable());
}
private boolean isEnabled() {
return Rescheduler.this.enabled;
}
}
@ -99,7 +96,7 @@ final class Rescheduler {
long now = nanoTime();
if (runAtNanos - now > 0) {
wakeUp = scheduler.schedule(
new FutureRunnable(Rescheduler.this), runAtNanos - now, TimeUnit.NANOSECONDS);
new FutureRunnable(), runAtNanos - now, TimeUnit.NANOSECONDS);
} else {
enabled = false;
wakeUp = null;
@ -110,7 +107,7 @@ final class Rescheduler {
@VisibleForTesting
static boolean isEnabled(Runnable r) {
return ((FutureRunnable) r).rescheduler.enabled;
return ((FutureRunnable) r).isEnabled();
}
private long nanoTime() {