You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jeff Jirsa (JIRA)" <ji...@apache.org> on 2017/03/21 05:23:41 UTC

[jira] [Assigned] (CASSANDRA-13357) A possible NPE

     [ https://issues.apache.org/jira/browse/CASSANDRA-13357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Jirsa reassigned CASSANDRA-13357:
--------------------------------------

    Assignee: Hao Zhong

> A possible NPE
> --------------
>
>                 Key: CASSANDRA-13357
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13357
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>            Reporter: Hao Zhong
>            Assignee: Hao Zhong
>             Fix For: 4.x
>
>
> The GetEndpoints.execute method has the following code:
> {code:title=GetEndpoints.java|borderStyle=solid}
>        List<InetAddress> endpoints = probe.getEndpoints(ks, table, key);
>         for (InetAddress endpoint : endpoints)
>         {
>             System.out.println(endpoint.getHostAddress());
>         }
> {code}
> This code can throw NPE. A similar bug is fixed in CASSANDRA-8950. The buggy code  is 
> {code:title=NodeCmd.java|borderStyle=solid}
>   List<InetAddress> endpoints = this.probe.getEndpoints(keySpace, cf, key);
>         for (InetAddress anEndpoint : endpoints)
>         {
>            output.println(anEndpoint.getHostAddress());
>         }
> {code}
> The fixed code is:
> {code:title=NodeCmd.java|borderStyle=solid}
> try
>         {
>             List<InetAddress> endpoints = probe.getEndpoints(keySpace, cf, key);
>             for (InetAddress anEndpoint : endpoints)
>                output.println(anEndpoint.getHostAddress());
>         }
>         catch (IllegalArgumentException ex)
>         {
>             output.println(ex.getMessage());
>             probe.failed();
>         }
> {code}
> The GetEndpoints.execute method shall be modified as CASSANDRA-8950 does.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)