Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Won't Fix
-
None
-
Normal
Description
The GetEndpoints.execute method has the following code:
GetEndpoints.java
List<InetAddress> endpoints = probe.getEndpoints(ks, table, key); for (InetAddress endpoint : endpoints) { System.out.println(endpoint.getHostAddress()); }
This code can throw NPE. A similar bug is fixed in CASSANDRA-8950. The buggy code is
NodeCmd.java
List<InetAddress> endpoints = this.probe.getEndpoints(keySpace, cf, key); for (InetAddress anEndpoint : endpoints) { output.println(anEndpoint.getHostAddress()); }
The fixed code is:
NodeCmd.java
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(); }
The GetEndpoints.execute method shall be modified as CASSANDRA-8950 does.