Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2425#discussion_r86321008
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
 ---
    @@ -64,26 +64,25 @@
     
        static final String NO_SECURE_COOKIE = "";
     
    -   static final Charset DEFAULT_CHARSET = Charset.forName("utf-8");
    -
        abstract ByteBuf write(ByteBufAllocator allocator) throws Exception;
     
        abstract void readFrom(ByteBuf buffer) throws Exception;
     
        // 
------------------------------------------------------------------------
     
        private static ByteBuf allocateBuffer(ByteBufAllocator allocator, byte 
id, String secureCookie) {
    -           return allocateBuffer(allocator, id, secureCookie, 0);
    +           return allocateBuffer(allocator, id, 0, secureCookie);
        }
     
    -   private static ByteBuf allocateBuffer(ByteBufAllocator allocator, byte 
id, String secureCookie, int length) {
    +   private static ByteBuf allocateBuffer(ByteBufAllocator allocator, byte 
id, int length, String secureCookie) {
    +           final Charset DEFAULT_CHARSET = Charset.forName("utf-8");
                secureCookie = secureCookie == null ? "": secureCookie;
    --- End diff --
    
    Simpler:
    ```java
    if (secureCookie == null) {
        secureCookie = NO_SECURE_COOKIE;
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to