Committed by
Jonathan Hart
Null check at the head of the constructor of IntentOperation
Change-Id: Iaa25c6c7e49cf1c629687b0ba95b548fad4f7d71
Showing
1 changed file
with
3 additions
and
2 deletions
| ... | @@ -19,6 +19,7 @@ package org.onosproject.net.intent; | ... | @@ -19,6 +19,7 @@ package org.onosproject.net.intent; |
| 19 | import java.util.Objects; | 19 | import java.util.Objects; |
| 20 | 20 | ||
| 21 | import static com.google.common.base.MoreObjects.toStringHelper; | 21 | import static com.google.common.base.MoreObjects.toStringHelper; |
| 22 | +import static com.google.common.base.Preconditions.checkNotNull; | ||
| 22 | 23 | ||
| 23 | /** | 24 | /** |
| 24 | * Abstraction of an intent-related operation, e.g. add, remove, replace. | 25 | * Abstraction of an intent-related operation, e.g. add, remove, replace. |
| ... | @@ -62,8 +63,8 @@ public final class IntentOperation { | ... | @@ -62,8 +63,8 @@ public final class IntentOperation { |
| 62 | * @param intent intent subject | 63 | * @param intent intent subject |
| 63 | */ | 64 | */ |
| 64 | IntentOperation(Type type, IntentId intentId, Intent intent) { | 65 | IntentOperation(Type type, IntentId intentId, Intent intent) { |
| 65 | - this.type = type; | 66 | + this.type = checkNotNull(type); |
| 66 | - this.intentId = intentId; | 67 | + this.intentId = checkNotNull(intentId); |
| 67 | this.intent = intent; | 68 | this.intent = intent; |
| 68 | } | 69 | } |
| 69 | 70 | ... | ... |
-
Please register or login to post a comment