Fix string comparsion issue

This commit is contained in:
Frank 2011-05-06 10:24:32 -07:00
parent d077caa0d2
commit d43e6fef9c
3 changed files with 3 additions and 3 deletions

View File

@ -4325,7 +4325,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
"remoteIP", cmd.getRemoteIp(), "greKey", cmd.getKey(), "from",
Long.toString(cmd.getFrom()), "to", Long.toString(cmd.getTo()));
String[] res = result.split(":");
if (res.length != 2 || (res.length == 2 && res[1] == "[]")) {
if (res.length != 2 || (res.length == 2 && res[1].equalsIgnoreCase("[]"))) {
return new OvsCreateGreTunnelAnswer(cmd, false, result,
_host.ip, bridge);
} else {

View File

@ -395,7 +395,7 @@ public class ConfigurationServerImpl implements ConfigurationServer {
String already = _configDao.getValue("ssh.privatekey");
String homeDir = Script.runSimpleBashScript("echo ~");
String userid = System.getProperty("user.name");
if (homeDir == "~") {
if (homeDir != null && homeDir.equalsIgnoreCase("~")) {
s_logger.error("No home directory was detected. Set the HOME environment variable to point to your user profile or home directory.");
throw new CloudRuntimeException("No home directory was detected. Set the HOME environment variable to point to your user profile or home directory.");
}

View File

@ -1399,7 +1399,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
throw new CloudRuntimeException("Unable to find storage pools in zone " + zoneId);
}
pool = storagePools.get(0);
if ( snapshot.getVersion() == "2.1" ) {
if (snapshot.getVersion() != null && snapshot.getVersion().equalsIgnoreCase("2.1")) {
VolumeVO volume = _volsDao.findByIdIncludingRemoved(volumeId);
if ( volume == null ) {
throw new CloudRuntimeException("failed to upgrade snapshot " + snapshotId + " due to unable to find orignal volume:" + volumeId + ", try it later ");