Change in ovirt-engine[master]: core: fix corner case of random number (Long.MIN_VALUE) in R...

yzaslavs at redhat.com yzaslavs at redhat.com
Sat Sep 8 15:44:33 UTC 2012


Yair Zaslavsky has submitted this change and it was merged.

Change subject: core: fix corner case of random number (Long.MIN_VALUE) in RandomUtils.
......................................................................


core: fix corner case of random number (Long.MIN_VALUE) in RandomUtils.

This code generates a random signed long and then computes the
absolute value of that random long. If the number returned by
the random number generator is Long.MIN_VALUE, then the result
will be negative as well (since Math.abs(Long.MIN_VALUE) == Long.MIN_VALUE).

Change-Id: Ic6fd4d0304c3ffa382fe20afa1a8d41f93a47bed
Signed-off-by: Sharad Mishra <snmishra at linux.vnet.ibm.com>
---
M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/RandomUtils.java
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Yair Zaslavsky: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/7851
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6fd4d0304c3ffa382fe20afa1a8d41f93a47bed
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sharad Mishra <snmishra at linux.vnet.ibm.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>



More information about the Engine-commits mailing list