You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Anoop Sam John (JIRA)" <ji...@apache.org> on 2015/08/03 06:46:05 UTC

[jira] [Commented] (HBASE-14179) catch the same Exception twice

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

Anoop Sam John commented on HBASE-14179:
----------------------------------------

The 2nd catch is for the outer try block.  You can see the 1st one, after sleep() call comes within another catch block of the outer try catch.  So when the sleep happens if we have to catch the possible InterruptedException, we should have the catch block there. The outer catch block wont be able to catch it. (As the code is another block)

> catch the same Exception twice
> ------------------------------
>
>                 Key: HBASE-14179
>                 URL: https://issues.apache.org/jira/browse/HBASE-14179
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 1.0.1, 1.1.0, 1.1.1, 1.1.0.1
>            Reporter: songwanging
>            Priority: Minor
>
> In method "markRegionsRecovering()" of class: hbase-1.1.1\hbase-server\src\main\java\org\apache\hadoop\hbase\coordination\ZKSplitLogManagerCoordination.java
> "InterruptedException" is catched twice.
>   public void markRegionsRecovering(final ServerName serverName, Set<HRegionInfo> userRegions)
>       throws IOException, InterruptedIOException {
> ...
>    try {
>             Thread.sleep(20);
>           } catch (InterruptedException e1) {
>             throw new InterruptedIOException();
>           }
>         } catch (InterruptedException e) {
>           throw new InterruptedIOException();
>         }
> ...
> }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)