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

View File

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