[ 
https://issues.apache.org/jira/browse/HBASE-18470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16110754#comment-16110754
 ] 

Benedict Jin commented on HBASE-18470:
--------------------------------------

Hi [~chia7712]. Sorry for making you so upset. But you really should look 
around the method...
```java
public static String getDesc(List<Throwable> exceptions,
                             List<? extends Row> actions,
                             List<String> hostnamePort) {
  String s = getDesc(classifyExs(exceptions));
  StringBuilder addrs = new StringBuilder(s);
  addrs.append("servers with issues: ");
  Set<String> uniqAddr = new HashSet<>();
  uniqAddr.addAll(hostnamePort);
  for (String addr : uniqAddr) {
    addrs.append(addr).append(", ");
  }
  return uniqAddr.size() > 0 ? addrs.substring(0, addrs.length() - 2) : 
addrs.toString();
}
```

You see, `uniqAddr` will never be null, and the `HashSet#isEmpty` is calling 
`HashMap#isEmpty` inside, it still not check the null value situation.
```java
public boolean isEmpty() {
    return size == 0;
}
```

> `RetriesExhaustedWithDetailsException#getDesc` describe is not right
> --------------------------------------------------------------------
>
>                 Key: HBASE-18470
>                 URL: https://issues.apache.org/jira/browse/HBASE-18470
>             Project: HBase
>          Issue Type: Bug
>          Components: Client
>            Reporter: Benedict Jin
>            Assignee: Benedict Jin
>         Attachments: HBASE-18470.master.001.patch
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> The describe from `RetriesExhaustedWithDetailsException#getDesc` is `
> org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException: Failed 3 
> actions: FailedServerException: 3 times, `, there is a not need ', ' in the 
> tail.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to