You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Raghu Angadi (JIRA)" <ji...@apache.org> on 2007/05/19 00:43:16 UTC
[jira] Commented: (HADOOP-1393) using Math.abs(Random.getInt())
does not guarantee a positive number
[ 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.