Skip to content

Commit 963f885

Browse files
committed
mutable copy
1 parent ebade2d commit 963f885

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.io.InputStream;
3333
import java.net.URISyntaxException;
3434
import java.nio.ByteBuffer;
35+
import java.util.ArrayList;
3536
import java.util.Iterator;
3637
import java.util.List;
3738
import java.util.Optional;
@@ -84,7 +85,8 @@ public class FlightClient implements AutoCloseable {
8485
List<FlightClientMiddleware.Factory> middleware) {
8586
this.allocator = incomingAllocator.newChildAllocator("flight-client", 0, Long.MAX_VALUE);
8687
this.channel = channel;
87-
this.middleware = middleware;
88+
// We need a mutable copy (shared between this class and ClientInterceptorAdapter)
89+
this.middleware = new ArrayList<>(middleware);
8890

8991
final ClientInterceptor[] interceptors;
9092
interceptors =

0 commit comments

Comments
 (0)