Committed by
Ray Milkey
Add null check in the constructor
Change-Id: I5436324666a77c6c830a44b107eca65b4dea88bb
Showing
1 changed file
with
5 additions
and
4 deletions
... | @@ -19,6 +19,8 @@ import java.util.Objects; | ... | @@ -19,6 +19,8 @@ import java.util.Objects; |
19 | 19 | ||
20 | import com.google.common.base.MoreObjects; | 20 | import com.google.common.base.MoreObjects; |
21 | 21 | ||
22 | +import static com.google.common.base.Preconditions.checkNotNull; | ||
23 | + | ||
22 | /** | 24 | /** |
23 | * A super class for batch operation entry classes. | 25 | * A super class for batch operation entry classes. |
24 | * <p> | 26 | * <p> |
... | @@ -26,11 +28,10 @@ import com.google.common.base.MoreObjects; | ... | @@ -26,11 +28,10 @@ import com.google.common.base.MoreObjects; |
26 | * its entries. | 28 | * its entries. |
27 | */ | 29 | */ |
28 | public class BatchOperationEntry<T extends Enum<?>, U extends BatchOperationTarget> { | 30 | public class BatchOperationEntry<T extends Enum<?>, U extends BatchOperationTarget> { |
31 | + | ||
29 | private final T operator; | 32 | private final T operator; |
30 | private final U target; | 33 | private final U target; |
31 | 34 | ||
32 | - | ||
33 | - | ||
34 | /** | 35 | /** |
35 | * Constructs new instance for the entry of the BatchOperation. | 36 | * Constructs new instance for the entry of the BatchOperation. |
36 | * | 37 | * |
... | @@ -38,8 +39,8 @@ public class BatchOperationEntry<T extends Enum<?>, U extends BatchOperationTarg | ... | @@ -38,8 +39,8 @@ public class BatchOperationEntry<T extends Enum<?>, U extends BatchOperationTarg |
38 | * @param target the target object of this operation | 39 | * @param target the target object of this operation |
39 | */ | 40 | */ |
40 | public BatchOperationEntry(T operator, U target) { | 41 | public BatchOperationEntry(T operator, U target) { |
41 | - this.operator = operator; | 42 | + this.operator = checkNotNull(operator); |
42 | - this.target = target; | 43 | + this.target = checkNotNull(target); |
43 | } | 44 | } |
44 | 45 | ||
45 | /** | 46 | /** | ... | ... |
-
Please register or login to post a comment