cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From santhosheduku...@apache.org
Subject git commit: updated refs/heads/master to 5ee9a3c
Date Fri, 25 Jul 2014 11:14:40 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 3f6d5e392 -> 5ee9a3cc8


Fixed Coverity Issues Reported


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

Branch: refs/heads/master
Commit: 5ee9a3cc8addc5403ffaae486525859ba1a73bb7
Parents: 3f6d5e3
Author: Santhosh Edukulla <santhosh.edukulla@gmail.com>
Authored: Fri Jul 25 16:44:18 2014 +0530
Committer: Santhosh Edukulla <santhosh.edukulla@gmail.com>
Committed: Fri Jul 25 16:44:18 2014 +0530

----------------------------------------------------------------------
 .../com/cloud/resource/ResourceManagerImpl.java | 21 ++++++++++----------
 1 file changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5ee9a3cc/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 68c9286..6f089af 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -136,7 +136,6 @@ import com.cloud.storage.dao.StoragePoolHostDao;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
-import com.cloud.user.User;
 import com.cloud.utils.StringUtils;
 import com.cloud.utils.UriUtils;
 import com.cloud.utils.component.Manager;
@@ -323,29 +322,29 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
 
         String eventName;
         for (ResourceListener l : lst) {
-            if (event == ResourceListener.EVENT_DISCOVER_BEFORE) {
+            if (event.equals(ResourceListener.EVENT_DISCOVER_BEFORE)) {
                 l.processDiscoverEventBefore((Long)params[0], (Long)params[1], (Long)params[2],
(URI)params[3], (String)params[4], (String)params[5],
                     (List<String>)params[6]);
                 eventName = "EVENT_DISCOVER_BEFORE";
-            } else if (event == ResourceListener.EVENT_DISCOVER_AFTER) {
+            } else if (event.equals(ResourceListener.EVENT_DISCOVER_AFTER)) {
                 l.processDiscoverEventAfter((Map<? extends ServerResource, Map<String,
String>>)params[0]);
                 eventName = "EVENT_DISCOVER_AFTER";
-            } else if (event == ResourceListener.EVENT_DELETE_HOST_BEFORE) {
+            } else if (event.equals(ResourceListener.EVENT_DELETE_HOST_BEFORE)) {
                 l.processDeleteHostEventBefore((HostVO)params[0]);
                 eventName = "EVENT_DELETE_HOST_BEFORE";
-            } else if (event == ResourceListener.EVENT_DELETE_HOST_AFTER) {
+            } else if (event.equals(ResourceListener.EVENT_DELETE_HOST_AFTER)) {
                 l.processDeletHostEventAfter((HostVO)params[0]);
                 eventName = "EVENT_DELETE_HOST_AFTER";
-            } else if (event == ResourceListener.EVENT_CANCEL_MAINTENANCE_BEFORE) {
+            } else if (event.equals(ResourceListener.EVENT_CANCEL_MAINTENANCE_BEFORE)) {
                 l.processCancelMaintenaceEventBefore((Long)params[0]);
                 eventName = "EVENT_CANCEL_MAINTENANCE_BEFORE";
-            } else if (event == ResourceListener.EVENT_CANCEL_MAINTENANCE_AFTER) {
+            } else if (event.equals(ResourceListener.EVENT_CANCEL_MAINTENANCE_AFTER)) {
                 l.processCancelMaintenaceEventAfter((Long)params[0]);
                 eventName = "EVENT_CANCEL_MAINTENANCE_AFTER";
-            } else if (event == ResourceListener.EVENT_PREPARE_MAINTENANCE_BEFORE) {
+            } else if (event.equals(ResourceListener.EVENT_PREPARE_MAINTENANCE_BEFORE)) {
                 l.processPrepareMaintenaceEventBefore((Long)params[0]);
                 eventName = "EVENT_PREPARE_MAINTENANCE_BEFORE";
-            } else if (event == ResourceListener.EVENT_PREPARE_MAINTENANCE_AFTER) {
+            } else if (event.equals(ResourceListener.EVENT_PREPARE_MAINTENANCE_AFTER)) {
                 l.processPrepareMaintenaceEventAfter((Long)params[0]);
                 eventName = "EVENT_PREPARE_MAINTENANCE_AFTER";
             } else {
@@ -798,7 +797,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
 
     @DB
     protected boolean doDeleteHost(final long hostId, boolean isForced, final boolean isForceDeleteStorage)
{
-        User caller = _accountMgr.getActiveUser(CallContext.current().getCallingUserId());
+        _accountMgr.getActiveUser(CallContext.current().getCallingUserId());
         // Verify that host exists
         final HostVO host = _hostDao.findById(hostId);
         if (host == null) {
@@ -1463,7 +1462,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
                 Map.Entry<String, ResourceStateAdapter> item = it.next();
                 ResourceStateAdapter adapter = item.getValue();
 
-                String msg = new String("Dispatching resource state event " + event + " to
" + item.getKey());
+                String msg = "Dispatching resource state event " + event + " to " + item.getKey();
                 s_logger.debug(msg);
 
                 if (event == ResourceStateAdapter.Event.CREATE_HOST_VO_FOR_CONNECTED) {


Mime
View raw message