fixing the nullpointer on type which is null

This commit is contained in:
Sander Botman 2014-08-12 18:54:42 +02:00 committed by wilderrodrigues
parent 680454dfdf
commit 9b40f3d379
3 changed files with 7 additions and 16 deletions

View File

@ -23,10 +23,6 @@ import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.cloud.agent.api.BumpUpPriorityCommand;
import com.cloud.agent.api.SetupGuestNetworkCommand;
import com.cloud.agent.api.routing.CreateIpAliasCommand;
@ -92,6 +88,10 @@ import com.cloud.network.LoadBalancerConfigurator;
import com.cloud.network.vpc.StaticRouteProfile;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.net.NetUtils;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
public class ConfigHelper {
private final static Gson gson;
@ -174,7 +174,7 @@ public class ConfigHelper {
for (FirewallRuleTO rule : cmd.getRules()) {
FirewallRule fwRule = new FirewallRule(rule.getId(), rule.getSrcVlanTag(), rule.getSrcIp(), rule.getProtocol(), rule.getSrcPortRange(), rule.revoked(),
rule.isAlreadyAdded(), rule.getSourceCidrList(), rule.getPurpose().toString(), rule.getIcmpType(), rule.getIcmpCode(), rule.getTrafficType().toString(),
rule.getGuestCidr(), rule.isDefaultEgressPolicy(), rule.getType().toString());
rule.getGuestCidr(), rule.isDefaultEgressPolicy());
rules.add(fwRule);
}

View File

@ -43,7 +43,7 @@ public class FirewallRule {
}
public FirewallRule(long id, String srcVlanTag, String srcIp, String protocol, int[] srcPortRange, boolean revoked, boolean alreadyAdded, List<String> sourceCidrList,
String purpose, Integer icmpType, Integer icmpCode, String trafficType, String guestCidr, boolean defaultEgressPolicy, String type) {
String purpose, Integer icmpType, Integer icmpCode, String trafficType, String guestCidr, boolean defaultEgressPolicy) {
this.id = id;
this.srcVlanTag = srcVlanTag;
this.srcIp = srcIp;
@ -58,7 +58,6 @@ public class FirewallRule {
this.trafficType = trafficType;
this.guestCidr = guestCidr;
this.defaultEgressPolicy = defaultEgressPolicy;
this.type = type;
}
public long getId() {
@ -173,12 +172,4 @@ public class FirewallRule {
this.defaultEgressPolicy = defaultEgressPolicy;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -39,4 +39,4 @@ public class FirewallRules extends ConfigBase {
this.rules = rules;
}
}
}