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

Ted Yu commented on HBASE-9589:
-------------------------------

Pardon me for not being clear.
What I meant was that the body of following if block would not be executed:
{code}
            if (x == 0) {
              x = (int) (diff >>> 32);
              n = 32;
            }
{code}
because x wouldn't be 0.
{code}
int x = (int) diff; // x is assigned to zero
{code}
Can you confirm whether 0 is assigned to x ?
In the following example, x is assigned x       -2147483647:
{code}
    long diff = Integer.MAX_VALUE + 2;
    int x = (int) diff;
{code}

> Bytes#LexicographicalComparerHolder#UnsafeComparer#compareTo() has dead code
> ----------------------------------------------------------------------------
>
>                 Key: HBASE-9589
>                 URL: https://issues.apache.org/jira/browse/HBASE-9589
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>
> Starting with line 1177:
> {code}
>           if (diff != 0) {
>             if (!littleEndian) {
>               return lessThanUnsigned(lw, rw) ? -1 : 1;
>             }
>             // Use binary search
>             int n = 0;
>             int y;
>             int x = (int) diff;
>             if (x == 0) {
>               x = (int) (diff >>> 32);
> {code}
> The value of "x" cannot be equal to 0.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to