core: Remove useless NPE check for syncContext in PF · grpc/grpc-java@33687d3

File tree

1 file changed

lines changed

  • core/src/main/java/io/grpc/internal

1 file changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -33,7 +33,6 @@

3333

import io.grpc.EquivalentAddressGroup;

3434

import io.grpc.LoadBalancer;

3535

import io.grpc.Status;

36-

import io.grpc.SynchronizationContext;

3736

import io.grpc.SynchronizationContext.ScheduledHandle;

3837

import java.net.SocketAddress;

3938

import java.util.ArrayList;

@@ -426,16 +425,7 @@ public void run() {

426425

}

427426

}

428427
429-

SynchronizationContext synchronizationContext = null;

430-

try {

431-

synchronizationContext = helper.getSynchronizationContext();

432-

} catch (NullPointerException e) {

433-

// All helpers should have a sync context, but if one doesn't (ex. user had a custom test)

434-

// we don't want to break previously working functionality.

435-

return;

436-

}

437-
438-

scheduleConnectionTask = synchronizationContext.schedule(

428+

scheduleConnectionTask = helper.getSynchronizationContext().schedule(

439429

new StartNextConnection(),

440430

CONNECTION_DELAY_INTERVAL_MS,

441431

TimeUnit.MILLISECONDS,