hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duo Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-19797) Operator priority leads to wrong logic
Date Mon, 15 Jan 2018 07:20:00 GMT

     [ https://issues.apache.org/jira/browse/HBASE-19797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Duo Zhang updated HBASE-19797:
------------------------------
    Description: 
{code}
if (e instanceof EOFException ||
        e.getCause() instanceof EOFException && logQueue.size() > 1 &&
this.eofAutoRecovery)
{code}

https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html

According to the doc here, && has a higher priority than ||, so we will only check
logQueueSize when e.getCause is an EOFException, which is incorrect.

> Operator priority leads to wrong logic
> --------------------------------------
>
>                 Key: HBASE-19797
>                 URL: https://issues.apache.org/jira/browse/HBASE-19797
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Duo Zhang
>            Priority: Major
>
> {code}
> if (e instanceof EOFException ||
>         e.getCause() instanceof EOFException && logQueue.size() > 1 &&
this.eofAutoRecovery)
> {code}
> https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html
> According to the doc here, && has a higher priority than ||, so we will only
check logQueueSize when e.getCause is an EOFException, which is incorrect.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message