mirror of https://github.com/apache/cloudstack.git
findbugs: assign result of string manipulations(cherry picked from
commit 20127e09dc)
This commit is contained in:
parent
fae0556021
commit
9edeb24f3f
|
|
@ -40,6 +40,9 @@ import javax.ejb.Local;
|
|||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.AuthorizeSecurityGroupEgressCmd;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.AuthorizeSecurityGroupIngressCmd;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.CreateSecurityGroupCmd;
|
||||
|
|
@ -51,8 +54,6 @@ import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationSe
|
|||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
|
||||
import org.apache.cloudstack.utils.identity.ManagementServerNode;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.api.NetworkRulesSystemVmCommand;
|
||||
|
|
@ -373,7 +374,7 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
|
|||
|
||||
protected String generateRulesetSignature(Map<PortAndProto, Set<String>> ingress, Map<PortAndProto, Set<String>> egress) {
|
||||
String ruleset = ingress.toString();
|
||||
ruleset.concat(egress.toString());
|
||||
ruleset = ruleset.concat(egress.toString());
|
||||
return DigestUtils.md5Hex(ruleset);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class IPRangeConfig {
|
|||
|
||||
long zoneId = PodZoneConfig.getZoneId(zone);
|
||||
result = changeRange(op, "public", -1, zoneId, startIP, endIP, null, -1);
|
||||
result.replaceAll("<br>", "/n");
|
||||
result = result.replaceAll("<br>", "/n");
|
||||
System.out.println(result);
|
||||
} else if (type.equals("private")) {
|
||||
if (args.length != 5 && args.length != 6) {
|
||||
|
|
@ -92,7 +92,7 @@ public class IPRangeConfig {
|
|||
long podId = PodZoneConfig.getPodId(pod, zone);
|
||||
long zoneId = PodZoneConfig.getZoneId(zone);
|
||||
result = changeRange(op, "private", podId, zoneId, startIP, endIP, null, -1);
|
||||
result.replaceAll("<br>", "/n");
|
||||
result = result.replaceAll("<br>", "/n");
|
||||
System.out.println(result);
|
||||
} else {
|
||||
printError(usage());
|
||||
|
|
@ -569,31 +569,6 @@ public class IPRangeConfig {
|
|||
"Unable to start DB connection to read guest cidr network. Please contact Cloud Support.");
|
||||
}
|
||||
|
||||
// public static String getGuestIpNetwork() {
|
||||
// return DatabaseConfig.getDatabaseValueString("SELECT * FROM `cloud`.`configuration` WHERE name = \"guest.ip.network\"", "value",
|
||||
// "Unable to start DB connection to read guest IP network. Please contact Cloud Support.");
|
||||
// }
|
||||
//
|
||||
// public static String getGuestNetmask() {
|
||||
// return DatabaseConfig.getDatabaseValueString("SELECT * FROM `cloud`.`configuration` WHERE name = \"guest.netmask\"", "value",
|
||||
// "Unable to start DB connection to read guest netmask. Please contact Cloud Support.");
|
||||
// }
|
||||
|
||||
// public static String getGuestSubnet() {
|
||||
// String guestIpNetwork = getGuestIpNetwork();
|
||||
// String guestNetmask = getGuestNetmask();
|
||||
//
|
||||
// if (guestIpNetwork == null || guestIpNetwork.isEmpty()) printError("Please enter a valid guest IP network address.");
|
||||
// if (guestNetmask == null || guestNetmask.isEmpty()) printError("Please enter a valid guest IP network netmask");
|
||||
//
|
||||
// return NetUtils.getSubNet(guestIpNetwork, guestNetmask);
|
||||
// }
|
||||
|
||||
// public static long getGuestCidrSize() {
|
||||
// String guestNetmask = getGuestNetmask();
|
||||
// return NetUtils.getCidrSize(guestNetmask);
|
||||
// }
|
||||
|
||||
public static boolean validCIDR(final String cidr) {
|
||||
if (cidr == null || cidr.isEmpty()) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue