cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject [21/31] git commit: updated refs/heads/planner_reserve to db4f335
Date Thu, 16 May 2013 19:23:21 GMT
instead of using '==', use equals() to test Long value equality


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6d573936
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6d573936
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6d573936

Branch: refs/heads/planner_reserve
Commit: 6d57393629bb93fbf0944e462c841f245b40f919
Parents: e7fef86
Author: Mice Xia <mice_xia@tcloudcomputing.com>
Authored: Thu May 16 16:00:02 2013 +0800
Committer: Mice Xia <mice_xia@tcloudcomputing.com>
Committed: Thu May 16 16:00:02 2013 +0800

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiDispatcher.java        |    2 +-
 .../src/com/cloud/api/query/QueryManagerImpl.java  |    2 +-
 .../com/cloud/capacity/CapacityManagerImpl.java    |    2 +-
 .../AgentBasedStandaloneConsoleProxyManager.java   |    2 +-
 .../src/com/cloud/network/NetworkServiceImpl.java  |    2 +-
 .../cloud/network/vpc/NetworkACLServiceImpl.java   |    4 ++--
 .../src/com/cloud/server/ManagementServerImpl.java |    6 +++---
 .../com/cloud/template/TemplateManagerImpl.java    |    6 +++---
 server/src/com/cloud/vm/UserVmManagerImpl.java     |    2 +-
 .../com/cloud/vm/VirtualMachineManagerImpl.java    |    2 +-
 10 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java
index b4437ce..b7d08e2 100755
--- a/server/src/com/cloud/api/ApiDispatcher.java
+++ b/server/src/com/cloud/api/ApiDispatcher.java
@@ -168,7 +168,7 @@ public class ApiDispatcher {
                 pageSize = Long.valueOf((String) pageSizeObj);
             }
 
-            if ((unpackedParams.get(ApiConstants.PAGE) == null) && (pageSize != null
&& pageSize != BaseListCmd.PAGESIZE_UNLIMITED)) {
+            if ((unpackedParams.get(ApiConstants.PAGE) == null) && (pageSize != null
&& !pageSize.equals(BaseListCmd.PAGESIZE_UNLIMITED))) {
                 ServerApiException ex = new ServerApiException(ApiErrorCode.PARAM_ERROR,
"\"page\" parameter is required when \"pagesize\" is specified");
                 ex.setCSErrorCode(CSExceptionErrorCode.getCSErrCode(ex.getClass().getName()));
                 throw ex;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index 9872c3a..a126925 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -2346,7 +2346,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
     // offerings
     private boolean isPermissible(Long accountDomainId, Long offeringDomainId) {
 
-        if (accountDomainId == offeringDomainId) {
+        if (accountDomainId.equals(offeringDomainId)) {
             return true; // account and service offering in same domain
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/server/src/com/cloud/capacity/CapacityManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/capacity/CapacityManagerImpl.java b/server/src/com/cloud/capacity/CapacityManagerImpl.java
index 1eb2fa5..e7101c6 100755
--- a/server/src/com/cloud/capacity/CapacityManagerImpl.java
+++ b/server/src/com/cloud/capacity/CapacityManagerImpl.java
@@ -681,7 +681,7 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager,
 
         if ((newState == State.Starting || newState == State.Migrating || event == Event.AgentReportMigrated)
&& vm.getHostId() != null) {
             boolean fromLastHost = false;
-            if (vm.getLastHostId() == vm.getHostId()) {
+            if (vm.getLastHostId().equals(vm.getHostId())) {
                 s_logger.debug("VM starting again on the last host it was stopped on");
                 fromLastHost = true;
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/server/src/com/cloud/consoleproxy/AgentBasedStandaloneConsoleProxyManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/AgentBasedStandaloneConsoleProxyManager.java
b/server/src/com/cloud/consoleproxy/AgentBasedStandaloneConsoleProxyManager.java
index 3cfdf22..2366333 100644
--- a/server/src/com/cloud/consoleproxy/AgentBasedStandaloneConsoleProxyManager.java
+++ b/server/src/com/cloud/consoleproxy/AgentBasedStandaloneConsoleProxyManager.java
@@ -57,7 +57,7 @@ AgentBasedConsoleProxyManager {
 			if (allocatedHost == null) {
 				/*Is there a consoleproxy agent running in the same pod?*/
 				for (HostVO hv : hosts) {
-					if (hv.getType() == Host.Type.ConsoleProxy && hv.getPodId() == host.getPodId())
{
+					if (hv.getType() == Host.Type.ConsoleProxy && hv.getPodId().equals(host.getPodId()))
{
 						allocatedHost = hv;
 						break;
 					}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index 2bc3913..ed9a8c4 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -1264,7 +1264,7 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
                     throw new InvalidParameterValueException("Unable to find specified NetworkACL");
                 }
 
-                if(vpcId != acl.getVpcId()){
+                if(!vpcId.equals(acl.getVpcId())){
                     throw new InvalidParameterValueException("ACL: "+aclId+" do not belong
to the VPC");
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
index 00c90d5..4d5d981 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
@@ -182,7 +182,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
                 throw new InvalidParameterValueException("Unable to find Vpc associated with
the NetworkACL");
             }
             _accountMgr.checkAccess(caller, null, true, vpc);
-            if(gateway.getVpcId() != acl.getVpcId()){
+            if(!gateway.getVpcId().equals(acl.getVpcId())){
                 throw new InvalidParameterValueException("private gateway: "+privateGatewayId+"
and ACL: "+aclId+" do not belong to the same VPC");
             }
         }
@@ -225,7 +225,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
             }
 
             _accountMgr.checkAccess(caller, null, true, vpc);
-            if(network.getVpcId() != acl.getVpcId()){
+            if(!network.getVpcId().equals(acl.getVpcId())){
                 throw new InvalidParameterValueException("Network: "+networkId+" and ACL:
"+aclId+" do not belong to the same VPC");
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 137f07e..bc37282 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -1152,7 +1152,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
                 if (volumePools.isEmpty()) {
                     allHosts.remove(host);
                 } else {
-                    if (host.getClusterId() != srcHost.getClusterId() || usesLocal) {
+                    if (!host.getClusterId().equals(srcHost.getClusterId()) || usesLocal)
{
                         requiresStorageMotion.put(host, true);
                     }
                 }
@@ -1887,7 +1887,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         }
 
         // Don't allow to modify system template
-        if (id == Long.valueOf(1)) {
+        if (id.equals(Long.valueOf(1))) {
             InvalidParameterValueException ex = new InvalidParameterValueException("Unable
to update template/iso of specified id");
             ex.addProxyObject(template, id, "templateId");
             throw ex;
@@ -2414,7 +2414,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             public int compare(SummedCapacity arg0, SummedCapacity arg1) {
                 if (arg0.getPercentUsed() < arg1.getPercentUsed()) {
                     return 1;
-                } else if (arg0.getPercentUsed() == arg1.getPercentUsed()) {
+                } else if (arg0.getPercentUsed().equals(arg1.getPercentUsed())) {
                     return 0;
                 }
                 return -1;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index a8729e1..d4976cd 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -993,7 +993,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
         }
 
         //Verify parameters
-        if (sourceZoneId == destZoneId) {
+        if (sourceZoneId.equals(destZoneId)) {
             throw new InvalidParameterValueException("Please specify different source and
destination zones.");
         }
         
@@ -1522,7 +1522,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
         Account caller = UserContext.current().getCaller();
         Long id = cmd.getId();
 
-        if (id == Long.valueOf(1)) {
+        if (id.equals(Long.valueOf(1))) {
             throw new PermissionDeniedException("unable to list permissions for " + cmd.getMediaType()
+ " with id " + id);
         }
 
@@ -1614,7 +1614,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
             throw new InvalidParameterValueException("unable to update permissions for "
+ mediaType + " with id " + id + " as it is removed ");
         }
 
-        if (id == Long.valueOf(1)) {
+        if (id.equals(Long.valueOf(1))) {
             throw new InvalidParameterValueException("unable to update permissions for "
+ mediaType + " with id " + id);
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/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 f2c44a4..fe80d2c 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -3708,7 +3708,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
 
         List<VolumeVO> vmVolumes = _volsDao.findUsableVolumesForInstance(vm.getId());
         Map<VolumeVO, StoragePoolVO> volToPoolObjectMap = new HashMap<VolumeVO,
StoragePoolVO>();
-        if (!isVMUsingLocalStorage(vm) && destinationHost.getClusterId() == srcHost.getClusterId())
{
+        if (!isVMUsingLocalStorage(vm) && destinationHost.getClusterId().equals(srcHost.getClusterId()))
{
             if (volumeToPool.isEmpty()) {
                 // If the destination host is in the same cluster and volumes do not have
to be migrated across pools
                 // then fail the call. migrateVirtualMachine api should have been used.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d573936/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 521b5e0..d153bb2 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -1322,7 +1322,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
             if (migrationResult) {
                 //if the vm is migrated to different pod in basic mode, need to reallocate
ip
 
-                if (vm.getPodIdToDeployIn() != destPool.getPodId()) {
+                if (!vm.getPodIdToDeployIn().equals(destPool.getPodId())) {
                     DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(),
destPool.getPodId(), null, null, null, null);
                     VirtualMachineProfileImpl<T> vmProfile = new VirtualMachineProfileImpl<T>(vm,
null, null, null, null);
                     _networkMgr.reallocate(vmProfile, plan);


Mime
View raw message