Updated Branches: refs/heads/master 416206595 -> 9631df8d0
Fix CID 1127021 Operands don't affect results int can never be bigger than maxint. Auto unboxing of Integer, not need for intValue() Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9631df8d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9631df8d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9631df8d Branch: refs/heads/master Commit: 9631df8d0ec96085b03ba6a324089b9ca41edf0c Parents: f611c24 Author: Hugo Trippaers <[email protected]> Authored: Thu Nov 7 13:23:22 2013 +0100 Committer: Hugo Trippaers <[email protected]> Committed: Thu Nov 7 13:34:48 2013 +0100 ---------------------------------------------------------------------- server/src/com/cloud/vm/UserVmManagerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9631df8d/server/src/com/cloud/vm/UserVmManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 3eaf33a..2d537bf 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2739,19 +2739,19 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (offering.isDynamic()) { //insert the custom value of dynamic parameters if (offering.getCpu() == null) { - if ((cpuNumber != null) && ((cpuNumber.intValue() <= 0) || (cpuNumber.intValue() > 2147483647))) { + if ((cpuNumber != null) && (cpuNumber <= 0)) { throw new InvalidParameterValueException("Invalid CPU number value, specify a value between 1 and 2147483647"); } } if (offering.getSpeed() == null) { - if ((cpuSpeed != null) && ((cpuSpeed.intValue() <= 0) || (cpuSpeed.intValue() > 2147483647))) { + if ((cpuSpeed != null) && (cpuSpeed <= 0)) { throw new InvalidParameterValueException("Invalid CPU speed value, specify a value between 1 and 2147483647"); } } if (offering.getRamSize() == null) { - if ((memory != null) && ((memory.intValue() < 32) || (memory.intValue() > 2147483647))) { + if ((memory != null) && (memory < 32)) { throw new InvalidParameterValueException("Invalid memory value, specify a value between 32 and 2147483647 MB"); } }
