mirror of https://github.com/grpc/grpc-java.git
core: fix FakeClock, SynchronizationContext lints (#4991)
Fix lints for import. Remove unused vars. Make path and package match so tests run successfully internally.
This commit is contained in:
parent
5dd5b70f82
commit
d7af1ee874
|
|
@ -25,7 +25,6 @@ import java.util.concurrent.Executor;
|
|||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Logger;
|
||||
import javax.annotation.concurrent.GuardedBy;
|
||||
import javax.annotation.concurrent.ThreadSafe;
|
||||
|
||||
|
|
@ -52,8 +51,6 @@ import javax.annotation.concurrent.ThreadSafe;
|
|||
@ThreadSafe
|
||||
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4984")
|
||||
public final class SynchronizationContext implements Executor {
|
||||
private static final Logger log = Logger.getLogger(SynchronizationContext.class.getName());
|
||||
|
||||
private final Object lock = new Object();
|
||||
private final UncaughtExceptionHandler uncaughtExceptionHandler;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.grpc.internal;
|
||||
package io.grpc;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.junit.Assert.assertSame;
|
||||
|
|
@ -24,8 +24,8 @@ import static org.mockito.Mockito.inOrder;
|
|||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import io.grpc.SynchronizationContext;
|
||||
import io.grpc.SynchronizationContext.ScheduledHandle;
|
||||
import io.grpc.internal.FakeClock;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ public final class FakeClock {
|
|||
public class ScheduledTask extends AbstractFuture<Void> implements ScheduledFuture<Void> {
|
||||
public final Runnable command;
|
||||
public final long dueTimeNanos;
|
||||
private boolean hasRun;
|
||||
|
||||
ScheduledTask(long dueTimeNanos, Runnable command) {
|
||||
this.dueTimeNanos = dueTimeNanos;
|
||||
|
|
@ -244,7 +243,6 @@ public final class FakeClock {
|
|||
}
|
||||
ScheduledTask task;
|
||||
while ((task = dueTasks.poll()) != null) {
|
||||
task.hasRun = true;
|
||||
task.command.run();
|
||||
task.complete();
|
||||
count++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue