accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Tubbs (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ACCUMULO-2284) DirectoryDecommissioner#getBackupName() shouldn't compute absolute value of signed random integer
Date Wed, 18 Jun 2014 19:02:25 GMT

     [ https://issues.apache.org/jira/browse/ACCUMULO-2284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Christopher Tubbs updated ACCUMULO-2284:
----------------------------------------

    Labels: findbugs newbie  (was: newbie)

> DirectoryDecommissioner#getBackupName() shouldn't compute absolute value of signed random
integer
> -------------------------------------------------------------------------------------------------
>
>                 Key: ACCUMULO-2284
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2284
>             Project: Accumulo
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>              Labels: findbugs, newbie
>
> {code}
>     return new Path(path.getParent(), path.getName() + "_" + System.currentTimeMillis()
+ "_" + Math.abs(rand.nextInt()) + ".bak");
> {code}
> this is because Math.abs can actually return negative result for integer input:
> {code}
> assertTrue( Math.abs(Integer.MIN_VALUE) < 0 );
> {code}



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

Mime
View raw message