@@ -162,7 +162,7 @@ public Result selectConfig(PickSubchannelArgs args) {
162162 * <p>This is intended for use by gRPC internal components
163163 * that are responsible for creating auxiliary {@code ManagedChannel} instances.
164164 */
165- private ChannelConfigurator channelConfigurator = new ChannelConfigurator () {} ;
165+ private final ChannelConfigurator channelConfigurator ;
166166
167167 private final InternalLogId logId ;
168168 private final String target ;
@@ -554,9 +554,8 @@ ClientStream newSubstream(
554554 Supplier <Stopwatch > stopwatchSupplier ,
555555 List <ClientInterceptor > interceptors ,
556556 final TimeProvider timeProvider ) {
557- if (builder .channelConfigurator != null ) {
558- this .channelConfigurator = builder .channelConfigurator ;
559- }
557+ this .channelConfigurator = checkNotNull (builder .channelConfigurator ,
558+ "channelConfigurator" );
560559 this .target = checkNotNull (builder .target , "target" );
561560 this .logId = InternalLogId .allocate ("Channel" , target );
562561 this .timeProvider = checkNotNull (timeProvider , "timeProvider" );
@@ -1501,9 +1500,7 @@ protected ManagedChannelBuilder<?> delegate() {
15011500
15021501 // Note that we follow the global configurator pattern and try to fuse the configurations as
15031502 // soon as the builder gets created
1504- if (channelConfigurator != null ) {
1505- channelConfigurator .configureChannelBuilder (builder );
1506- }
1503+ channelConfigurator .configureChannelBuilder (builder );
15071504
15081505 return builder
15091506 // TODO(zdapeng): executors should not outlive the parent channel.
0 commit comments