hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gustavo Anatoly (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-9589) Bytes#LexicographicalComparerHolder#UnsafeComparer#compareTo() has dead code
Date Fri, 18 Oct 2013 20:15:47 GMT

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

Gustavo Anatoly commented on HBASE-9589:
----------------------------------------

Ted, sorry for delay to answer.

At line 1185, when:

*diff > Integer.MAX_VALUE* For example on TestBytes
{code}
int x = (int) diff; // x is assigned to zero
{code}

But, 

*diff < Integer.MAX_VALUE* For example on TestLoadTestKVGenerator
In this case, "if block" is ignored.
{code}
int x = (int) diff; // x is assigned to same value of diff
{code}

Therefore, IMHO we need the line 1185.

> 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)

Mime
View raw message