hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yu Li (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-15117) Resolve ICAST findbugs warnings in current codes
Date Fri, 15 Jan 2016 03:20:39 GMT
Yu Li created HBASE-15117:
-----------------------------

             Summary: Resolve ICAST findbugs warnings in current codes
                 Key: HBASE-15117
                 URL: https://issues.apache.org/jira/browse/HBASE-15117
             Project: HBase
          Issue Type: Bug
            Reporter: Yu Li
            Priority: Minor


In [findbugs output|https://builds.apache.org/job/PreCommit-HBASE-Build/120/artifact/patchprocess/branch-findbugs-hbase-server-warnings.html#Warnings_STYLE]
of recent build, we could see ICAST warnings (Result of integer multiplication cast to long)
on Compactor and ExportSnapshot

>From the code I guess the design is to avoid multiplication result to overflow, however
current implementation cannot achieve the goal. For example, output of below codes
{code}
int i = 1000000;
long a = i * i;
long b = (long) i * i;
System.out.println(a);
System.out.println(b);
{code}
will be
{noformat}
-727379968
1000000000000
{noformat}

Will make some minor changes to resolve this issue.



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

Mime
View raw message