You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "LiAoNan (Jira)" <ji...@apache.org> on 2020/12/31 01:43:00 UTC

[jira] [Created] (ZOOKEEPER-4042) LeanerHandler.sock is always not null

LiAoNan created ZOOKEEPER-4042:
----------------------------------

             Summary: LeanerHandler.sock is always not null
                 Key: ZOOKEEPER-4042
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4042
             Project: ZooKeeper
          Issue Type: Improvement
            Reporter: LiAoNan


It's final, and initialized in the conctructor

{code:java}
protected final Socket sock;

//...

LearnerHandler(Socket sock, BufferedInputStream bufferedInput, LearnerMaster learnerMaster) throws IOException {
        super("LearnerHandler-" + sock.getRemoteSocketAddress());
        this.sock = sock;
        //...
    }
{code}

So there's no need to worry about null-pointer exceptions



--
This message was sent by Atlassian Jira
(v8.3.4#803005)