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 4825017
Date Thu, 14 Aug 2014 16:25:34 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master c90bf1231 -> 4825017cc


Fixed coveirty defects for concurrency, variable comparison etc

Signed-off-by: Santhosh Edukulla <santhosh.edukulla@gmail.com>


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

Branch: refs/heads/master
Commit: 4825017cc75c6a5b20e317b8036dfff1effec68f
Parents: c90bf12
Author: Santhosh Edukulla <santhosh.edukulla@gmail.com>
Authored: Thu Aug 14 18:31:11 2014 +0530
Committer: Santhosh Edukulla <santhosh.edukulla@gmail.com>
Committed: Thu Aug 14 21:54:46 2014 +0530

----------------------------------------------------------------------
 agent/src/com/cloud/agent/Agent.java                     | 11 ++++++-----
 .../cloudstack/api/command/user/iso/RegisterIsoCmd.java  |  2 +-
 awsapi/src/com/cloud/bridge/model/MHostVO.java           |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4825017c/agent/src/com/cloud/agent/Agent.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/Agent.java b/agent/src/com/cloud/agent/Agent.java
index 2b33f5c..8a34333 100755
--- a/agent/src/com/cloud/agent/Agent.java
+++ b/agent/src/com/cloud/agent/Agent.java
@@ -294,6 +294,11 @@ public class Agent implements HandlerFactory, IAgentControl {
             _watchList.clear();
         }
     }
+    public synchronized void lockStartupTask(Link link)
+    {
+        _startup = new StartupTask(link);
+        _timer.schedule(_startup, _startupWait);
+    }
 
     public void sendStartup(Link link) {
         final StartupCommand[] startup = _resource.initialize();
@@ -309,10 +314,7 @@ public class Agent implements HandlerFactory, IAgentControl {
             if (s_logger.isDebugEnabled()) {
                 s_logger.debug("Sending Startup: " + request.toString());
             }
-            synchronized (this) {
-                _startup = new StartupTask(link);
-                _timer.schedule(_startup, _startupWait);
-            }
+            lockStartupTask(link);
             try {
                 link.send(request.toBytes());
             } catch (final ClosedChannelException e) {
@@ -411,7 +413,6 @@ public class Agent implements HandlerFactory, IAgentControl {
                 cancelled = true;
             }
         }
-
         final StartupAnswer startup = (StartupAnswer)answer;
         if (!startup.getResult()) {
             s_logger.error("Not allowed to connect to the server: " + answer.getDetails());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4825017c/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
index 37f294c..453b4b6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
@@ -165,7 +165,7 @@ public class RegisterIsoCmd extends BaseCmd {
     }
 
     public Boolean isDynamicallyScalable() {
-        return isDynamicallyScalable ==  null ? false : isDynamicallyScalable;
+        return isDynamicallyScalable ==  null ? Boolean.FALSE : isDynamicallyScalable;
     }
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4825017c/awsapi/src/com/cloud/bridge/model/MHostVO.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/model/MHostVO.java b/awsapi/src/com/cloud/bridge/model/MHostVO.java
index a15063d..9fdbde3 100644
--- a/awsapi/src/com/cloud/bridge/model/MHostVO.java
+++ b/awsapi/src/com/cloud/bridge/model/MHostVO.java
@@ -127,7 +127,7 @@ public class MHostVO implements Serializable {
         if (!(other instanceof MHostVO))
             return false;
 
-        return hostKey == ((MHostVO)other).getHostKey();
+        return hostKey.equals(((MHostVO)other).getHostKey());
     }
 
     @Override


Mime
View raw message