Skip to content

Commit db6c21f

Browse files
SynchronizationContextTest checkstyle issues updated for issue10245
1 parent 6a713ed commit db6c21f

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

api/src/main/java/io/grpc/SynchronizationContext.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ public final ScheduledHandle scheduleWithFixedDelay(
198198
final Runnable task, Duration initialDelay, Duration delay, TimeUnit unit,
199199
ScheduledExecutorService timerService) {
200200
final ManagedRunnable runnable = new ManagedRunnable(task);
201-
System.out.println("Inside Durationcall");
202201
ScheduledFuture<?> future = timerService.scheduleWithFixedDelay(new Runnable() {
203202
@Override
204203
public void run() {
@@ -214,12 +213,8 @@ public String toString() {
214213
return new ScheduledHandle(runnable, future);
215214
}
216215
static long toNanosSaturated(Duration duration) {
217-
218216
try {
219-
//long delay = TimeUnit.MILLISECONDS.convert(500, TimeUnit.SECONDS); // Converts 500 seconds to milliseconds
220217
return duration.toNanos();
221-
//return TimeUnit.NANOSECONDS.convert(duration);
222-
223218
} catch (ArithmeticException tooBig) {
224219
return duration.isNegative() ? Long.MIN_VALUE : Long.MAX_VALUE;
225220
}

api/src/test/java/io/grpc/SynchronizationContextTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,9 @@ public void schedule() {
250250
@Test
251251
public void testScheduleWithFixedDelay(){
252252
MockScheduledExecutorService executorService = new MockScheduledExecutorService();
253-
254253
ScheduledHandle handle =
255-
syncContext.scheduleWithFixedDelay(task1, Duration.ofNanos(110), Duration.ofNanos(110), TimeUnit.NANOSECONDS, executorService);
256-
254+
syncContext.scheduleWithFixedDelay(task1, Duration.ofNanos(110), Duration.ofNanos(110),
255+
TimeUnit.NANOSECONDS, executorService);
257256
assertThat(executorService.delay)
258257
.isEqualTo(executorService.unit.convert(110, TimeUnit.NANOSECONDS));
259258
assertThat(handle.isPending()).isTrue();

0 commit comments

Comments
 (0)