@Test public void testEncodeDecodeInvalidHeaders() { Map<String, String> emptyHeaders = new HashMap<>(); emptyHeaders.put("key", null); try { ByteBuf binaryHeaders = serializer.encodeHeaders(emptyHeaders); fail(); } catch (Exception e) { } }
@Override public ByteBuf encodeHeaders(@NotNull Map<String, String> applicationHeaders) { boolean release = true; ByteBuf buf = DIRECT_BUFFER_PREFERRED ? ByteBufAllocator.DEFAULT.buffer() : ByteBufAllocator.DEFAULT.heapBuffer(); try { CodecUtils.encodeHeaders(applicationHeaders, buf); release = false; } finally { if (release) { buf.release(); } } return buf; }
ThriftSerializer implements Serializer.SerializerInterface { @Override public ByteBuf encodeHeaders(@NotNull Map<String, String> applicationHeaders) { boolean release = true; ByteBuf buf = DIRECT_BUFFER_PREFERRED ? ByteBufAllocator.DEFAULT.buffer() : ByteBufAllocator.DEFAULT.heapBuffer(); try { CodecUtils.encodeHeaders(applicationHeaders, buf); release = false; } finally { if (release) { buf.release(); } } return buf; } }
ThriftSerializer implements Serializer.SerializerInterface { @Override public ByteBuf encodeHeaders(@NotNull Map<String, String> applicationHeaders) { boolean release = true; ByteBuf buf = DIRECT_BUFFER_PREFERRED ? ByteBufAllocator.DEFAULT.buffer() : ByteBufAllocator.DEFAULT.heapBuffer(); try { CodecUtils.encodeHeaders(applicationHeaders, buf); release = false; } finally { if (release) { buf.release(); } } return buf; }  }
ThriftSerializer implements Serializer.SerializerInterface { @Override public ByteBuf encodeHeaders(@NotNull Map<String, String> applicationHeaders) { boolean release = true; ByteBuf buf = DIRECT_BUFFER_PREFERRED ? ByteBufAllocator.DEFAULT.buffer() : ByteBufAllocator.DEFAULT.heapBuffer(); try { CodecUtils.encodeHeaders(applicationHeaders, buf); release = false; } finally { if (release) { buf.release(); } } return buf; }  static boolean directBufferPreferred(); @Override @NotNull String decodeEndpoint(@NotNull ByteBuf arg1); @Override @NotNull Map<String, String> decodeHeaders(@NotNull ByteBuf arg2); @Override @Nullable T decodeBody(@NotNull ByteBuf arg3, @NotNull Class<T> bodyType); @Override ByteBuf encodeEndpoint(@NotNull String method); @Override ByteBuf encodeHeaders(@NotNull Map<String, String> applicationHeaders); @Override @Nullable ByteBuf encodeBody(@NotNull Object body); }
ThriftSerializer implements Serializer.SerializerInterface { @Override public ByteBuf encodeHeaders(@NotNull Map<String, String> applicationHeaders) { boolean release = true; ByteBuf buf = DIRECT_BUFFER_PREFERRED ? ByteBufAllocator.DEFAULT.buffer() : ByteBufAllocator.DEFAULT.heapBuffer(); try { CodecUtils.encodeHeaders(applicationHeaders, buf); release = false; } finally { if (release) { buf.release(); } } return buf; }  static boolean directBufferPreferred(); @Override @NotNull String decodeEndpoint(@NotNull ByteBuf arg1); @Override @NotNull Map<String, String> decodeHeaders(@NotNull ByteBuf arg2); @Override @Nullable T decodeBody(@NotNull ByteBuf arg3, @NotNull Class<T> bodyType); @Override ByteBuf encodeEndpoint(@NotNull String method); @Override ByteBuf encodeHeaders(@NotNull Map<String, String> applicationHeaders); @Override @Nullable ByteBuf encodeBody(@NotNull Object body);  }