hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-11413) [findbugs] RV: Negating the result of compareTo()/compare()
Date Wed, 02 Jul 2014 19:38:26 GMT

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

Hudson commented on HBASE-11413:
--------------------------------

FAILURE: Integrated in HBase-0.98-on-Hadoop-1.1 #351 (See [https://builds.apache.org/job/HBase-0.98-on-Hadoop-1.1/351/])
HBASE-11413 [findbugs] RV: Negating the result of compareTo()/compare() (Mike Drob) (stack:
rev 1b2a05c9446cab8e616f6988ea6d176043fd8e57)
* hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
* hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
* hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java


> [findbugs] RV: Negating the result of compareTo()/compare()
> -----------------------------------------------------------
>
>                 Key: HBASE-11413
>                 URL: https://issues.apache.org/jira/browse/HBASE-11413
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Mike Drob
>            Assignee: Mike Drob
>            Priority: Trivial
>             Fix For: 0.99.0, 0.98.4, 2.0.0
>
>         Attachments: HBASE-11413.patch, HBASE-11413.patch
>
>
> Finbugs warns that {{CatalogJanitor.java}}, {{NamespaceUpgrade.java}} and {{FSTableDescriptors.java}}
have the following warning:
> {quote}
> RV: Negating the result of compareTo()/compare() (RV_NEGATING_RESULT_OF_COMPARETO)
> This code negatives the return value of a compareTo or compare method. This is a questionable
or bad programming practice, since if the return value is Integer.MIN_VALUE, negating the
return value won't negate the sign of the result. You can achieve the same intended result
by reversing the order of the operands rather than by negating the results. 
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message