Committed by
Yuta HIGUCHI
[ONOS-3717] Add checkNotNull for the parameters of the constructors of OchPort, …
…OduCltPort and OmsPort. Change-Id: I48a5735b3b421d7bbcd91e318ae7bb090d914cbc
Showing
3 changed files
with
7 additions
and
5 deletions
| ... | @@ -45,7 +45,7 @@ public class OchPort extends DefaultPort { | ... | @@ -45,7 +45,7 @@ public class OchPort extends DefaultPort { |
| 45 | public OchPort(Element element, PortNumber number, boolean isEnabled, OduSignalType signalType, | 45 | public OchPort(Element element, PortNumber number, boolean isEnabled, OduSignalType signalType, |
| 46 | boolean isTunable, OchSignal lambda, Annotations... annotations) { | 46 | boolean isTunable, OchSignal lambda, Annotations... annotations) { |
| 47 | super(element, number, isEnabled, Type.OCH, 0, annotations); | 47 | super(element, number, isEnabled, Type.OCH, 0, annotations); |
| 48 | - this.signalType = signalType; | 48 | + this.signalType = checkNotNull(signalType); |
| 49 | this.isTunable = isTunable; | 49 | this.isTunable = isTunable; |
| 50 | this.lambda = checkNotNull(lambda); | 50 | this.lambda = checkNotNull(lambda); |
| 51 | } | 51 | } | ... | ... |
| ... | @@ -18,6 +18,7 @@ package org.onosproject.net; | ... | @@ -18,6 +18,7 @@ package org.onosproject.net; |
| 18 | import java.util.Objects; | 18 | import java.util.Objects; |
| 19 | 19 | ||
| 20 | import static com.google.common.base.MoreObjects.toStringHelper; | 20 | import static com.google.common.base.MoreObjects.toStringHelper; |
| 21 | +import static com.google.common.base.Preconditions.checkNotNull; | ||
| 21 | 22 | ||
| 22 | /** | 23 | /** |
| 23 | * Implementation of ODU client port (Optical channel Data Unit). | 24 | * Implementation of ODU client port (Optical channel Data Unit). |
| ... | @@ -49,7 +50,7 @@ public class OduCltPort extends DefaultPort { | ... | @@ -49,7 +50,7 @@ public class OduCltPort extends DefaultPort { |
| 49 | public OduCltPort(Element element, PortNumber number, boolean isEnabled, | 50 | public OduCltPort(Element element, PortNumber number, boolean isEnabled, |
| 50 | SignalType signalType, Annotations... annotations) { | 51 | SignalType signalType, Annotations... annotations) { |
| 51 | super(element, number, isEnabled, Type.ODUCLT, 0, annotations); | 52 | super(element, number, isEnabled, Type.ODUCLT, 0, annotations); |
| 52 | - this.signalType = signalType; | 53 | + this.signalType = checkNotNull(signalType); |
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | /** | 56 | /** | ... | ... |
| ... | @@ -20,6 +20,7 @@ import org.onlab.util.Frequency; | ... | @@ -20,6 +20,7 @@ import org.onlab.util.Frequency; |
| 20 | import java.util.Objects; | 20 | import java.util.Objects; |
| 21 | 21 | ||
| 22 | import static com.google.common.base.MoreObjects.toStringHelper; | 22 | import static com.google.common.base.MoreObjects.toStringHelper; |
| 23 | +import static com.google.common.base.Preconditions.checkNotNull; | ||
| 23 | 24 | ||
| 24 | /** | 25 | /** |
| 25 | * Implementation of OMS port (Optical Multiplexing Section). | 26 | * Implementation of OMS port (Optical Multiplexing Section). |
| ... | @@ -49,9 +50,9 @@ public class OmsPort extends DefaultPort { | ... | @@ -49,9 +50,9 @@ public class OmsPort extends DefaultPort { |
| 49 | public OmsPort(Element element, PortNumber number, boolean isEnabled, | 50 | public OmsPort(Element element, PortNumber number, boolean isEnabled, |
| 50 | Frequency minFrequency, Frequency maxFrequency, Frequency grid, Annotations... annotations) { | 51 | Frequency minFrequency, Frequency maxFrequency, Frequency grid, Annotations... annotations) { |
| 51 | super(element, number, isEnabled, Type.OMS, 0, annotations); | 52 | super(element, number, isEnabled, Type.OMS, 0, annotations); |
| 52 | - this.minFrequency = minFrequency; | 53 | + this.minFrequency = checkNotNull(minFrequency); |
| 53 | - this.maxFrequency = maxFrequency; | 54 | + this.maxFrequency = checkNotNull(maxFrequency); |
| 54 | - this.grid = grid; | 55 | + this.grid = checkNotNull(grid); |
| 55 | } | 56 | } |
| 56 | 57 | ||
| 57 | /** | 58 | /** | ... | ... |
-
Please register or login to post a comment