HBASE-19985 Redundant instanceof check in ProtobufUtil#getServiceException

This commit is contained in:
dbist13 2018-03-03 02:45:40 -08:00
parent aae12e8470
commit 4bdfa342a5
1 changed files with 2 additions and 5 deletions

View File

@ -337,11 +337,8 @@ public final class ProtobufUtil {
* @param se ServiceException that wraps IO exception thrown by the server
* @return Exception wrapped in ServiceException.
*/
public static IOException getServiceException(ServiceException e) {
Throwable t = e;
if (e instanceof ServiceException) {
t = e.getCause();
}
public static IOException getServiceException(ServiceException se) {
Throwable t = se.getCause();
if (ExceptionUtil.isInterrupt(t)) {
return ExceptionUtil.asInterrupt(t);
}