openstack-nova: allowing 'null' ipProtocols returned by hpcloud-compute

This commit is contained in:
Adam Lowe 2012-07-04 18:27:05 +01:00
parent a88bf65134
commit 228e3facfa
1 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,8 @@ import java.beans.ConstructorProperties;
import javax.inject.Named;
import org.jclouds.javax.annotation.Nullable;
import com.google.common.annotations.Beta;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -104,8 +106,8 @@ public class Ingress {
@ConstructorProperties({
"ip_protocol", "from_port", "to_port"
})
protected Ingress(IpProtocol ipProtocol, int fromPort, int toPort) {
this.ipProtocol = checkNotNull(ipProtocol, "ipProtocol");
protected Ingress(@Nullable IpProtocol ipProtocol, int fromPort, int toPort) {
this.ipProtocol = ipProtocol == null ? IpProtocol.UNRECOGNIZED : ipProtocol;
this.fromPort = fromPort;
this.toPort = toPort;
}