File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
core/src/main/java/io/grpc/internal Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -737,18 +737,16 @@ public ManagedChannel build() {
737737 // TODO(zdapeng): FIX IT
738738 @ VisibleForTesting
739739 List <ClientInterceptor > getEffectiveInterceptors (String computedTarget ) {
740- List <ClientInterceptor > effectiveInterceptors = new ArrayList <>(this .interceptors );
741- for (int i = 0 ; i < effectiveInterceptors .size (); i ++) {
742- if (!(effectiveInterceptors .get (i ) instanceof InterceptorFactoryWrapper )) {
743- continue ;
744- }
745- InterceptorFactory factory =
746- ((InterceptorFactoryWrapper ) effectiveInterceptors .get (i )).factory ;
747- ClientInterceptor interceptor = factory .newInterceptor (computedTarget );
748- if (interceptor == null ) {
749- throw new NullPointerException ("Factory returned null interceptor: " + factory );
740+ List <ClientInterceptor > effectiveInterceptors = new ArrayList <>(this .interceptors .size ());
741+ for (ClientInterceptor interceptor : this .interceptors ) {
742+ if (interceptor instanceof InterceptorFactoryWrapper ) {
743+ InterceptorFactory factory = ((InterceptorFactoryWrapper ) interceptor ).factory ;
744+ interceptor = factory .newInterceptor (computedTarget );
745+ if (interceptor == null ) {
746+ throw new NullPointerException ("Factory returned null interceptor: " + factory );
747+ }
750748 }
751- effectiveInterceptors .set ( i , interceptor );
749+ effectiveInterceptors .add ( interceptor );
752750 }
753751
754752 boolean disableImplicitCensus = InternalConfiguratorRegistry .wasSetConfiguratorsCalled ();
You can’t perform that action at this time.
0 commit comments