mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fixed coveirty defects for concurrency, variable comparison etc
Signed-off-by: Santhosh Edukulla <santhosh.edukulla@gmail.com>
This commit is contained in:
parent
c90bf1231f
commit
4825017cc7
@ -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());
|
||||
|
||||
@ -165,7 +165,7 @@ public class RegisterIsoCmd extends BaseCmd {
|
||||
}
|
||||
|
||||
public Boolean isDynamicallyScalable() {
|
||||
return isDynamicallyScalable == null ? false : isDynamicallyScalable;
|
||||
return isDynamicallyScalable == null ? Boolean.FALSE : isDynamicallyScalable;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user