instead of '==', use equals() to compare two strings in cloud-server

This commit is contained in:
Mice Xia 2013-05-16 16:18:53 +08:00
parent 6d57393629
commit e26442f7d0
3 changed files with 4 additions and 4 deletions

View File

@ -2491,7 +2491,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
if ( vlans != null && vlans.size() > 0 ) {
if ( vlanId == null ) {
vlanId = vlan.getVlanTag();
} else if ( vlan.getVlanTag() != vlanId ) {
} else if (!vlan.getVlanTag().equals(vlanId)) {
throw new InvalidParameterValueException("there is already one vlan " + vlan.getVlanTag() + " on network :" +
+ network.getId() + ", only one vlan is allowed on guest network");
}

View File

@ -792,14 +792,14 @@ public class DatabaseConfig {
}
// If a netmask was provided, check that the startIP, endIP, and gateway all belong to the same subnet
if (netmask != null && netmask != "") {
if (netmask != null && !netmask.equals("")) {
if (endIP != null) {
if (!IPRangeConfig.sameSubnet(startIP, endIP, netmask)) {
printError("Start and end IPs for the public IP range must be in the same subnet, as per the provided netmask.");
}
}
if (gateway != null && gateway != "") {
if (gateway != null && !gateway.equals("")) {
if (!IPRangeConfig.sameSubnet(startIP, gateway, netmask)) {
printError("The start IP for the public IP range must be in the same subnet as the gateway, as per the provided netmask.");
}

View File

@ -1673,7 +1673,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
String description = "";
if (displayName != vmInstance.getDisplayName()) {
if (!displayName.equals(vmInstance.getDisplayName())) {
description += "New display name: " + displayName + ". ";
}