hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghu Angadi (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-1393) using Math.abs(Random.getInt()) does not guarantee a positive number
Date Fri, 18 May 2007 22:43:16 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-1393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497072
] 

Raghu Angadi commented on HADOOP-1393:
--------------------------------------

Good fix. I am fixing 3 of these. I had replaced {{nextInt()}} with {{nextInt() & 0x7FFFFFFF}}.
 But {{nextInt(Integer.MAX_VALUE)}} looks better.

I suggest we wait for couple of days before committing the findbugs fixes so that if different
people are fixing similar issues, the fixes can be more consistent.


> using Math.abs(Random.getInt()) does not guarantee a positive number
> --------------------------------------------------------------------
>
>                 Key: HADOOP-1393
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1393
>             Project: Hadoop
>          Issue Type: Bug
>          Components: mapred
>    Affects Versions: 0.13.0
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.14.0
>
>         Attachments: 1393.patch
>
>
> Findbugs suggested that we fix the potential for Integer.MIN_VALUE to slip through Math.abs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message