|
46 | 46 | import java.util.concurrent.CountDownLatch; |
47 | 47 | import java.util.concurrent.TimeUnit; |
48 | 48 | import java.util.function.BiConsumer; |
| 49 | +import java.util.function.BiFunction; |
49 | 50 | import java.util.function.Supplier; |
50 | 51 | import java.util.logging.Logger; |
51 | 52 | import javax.annotation.Nullable; |
@@ -283,8 +284,8 @@ public void writeTrailers(Metadata trailers, boolean headersSent, Status status) |
283 | 284 | if (!headersSent) { |
284 | 285 | writeHeadersToServletResponse(trailers); |
285 | 286 | } else { |
286 | | - serializeHeaders(trailers, (key, value) -> |
287 | | - trailerSupplier.get().merge(key, value, TrailerSupplier::joinValues)); |
| 287 | + BiFunction<String, String, String> merge = (oldV, newV) -> oldV + "," + newV; |
| 288 | + serializeHeaders(trailers, (key, value) -> trailerSupplier.get().merge(key, value, merge)); |
288 | 289 | } |
289 | 290 |
|
290 | 291 | writer.complete(); |
@@ -322,10 +323,6 @@ private static final class TrailerSupplier implements Supplier<Map<String, Strin |
322 | 323 | public Map<String, String> get() { |
323 | 324 | return trailers; |
324 | 325 | } |
325 | | - |
326 | | - static String joinValues(String oldValue, String newValue) { |
327 | | - return oldValue + "," + newValue; |
328 | | - } |
329 | 326 | } |
330 | 327 |
|
331 | 328 | static String toHexString(byte[] bytes, int length) { |
|
0 commit comments