You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "TisonKun (Jira)" <ji...@apache.org> on 2019/08/25 02:52:00 UTC

[jira] [Created] (ZOOKEEPER-3521) equals generate by jute potentially cause NPE

TisonKun created ZOOKEEPER-3521:
-----------------------------------

             Summary: equals generate by jute potentially cause NPE
                 Key: ZOOKEEPER-3521
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3521
             Project: ZooKeeper
          Issue Type: Bug
          Components: jute
    Affects Versions: 3.6.0
            Reporter: TisonKun
            Assignee: TisonKun
             Fix For: 3.6.0


jute generate {{equals}} as follow


{code:java}
    String genJavaEquals(String fname, String peer) {
        return "    ret = " + fname + ".equals(" + peer + ");\n";
    }
{code}

if {{fname}} is null at the runtime, then a {{NullPointerException}} would be thrown, see [this report|https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build-maven/org.apache.zookeeper$zookeeper/1167/testReport/junit/org.apache.zookeeper.server/PrepRequestProcessorTest/testPRequest/] for instance.

Java already solved this problem by using {{java.util.Objetcs.equals}}, I address this issue along with ZOOKEEPER-3290 in GH-839. But I need input from CPP and CSharp side.

BTW, is there anybody use jute's CSharp version or even CPP version?



--
This message was sent by Atlassian Jira
(v8.3.2#803003)