Correct Preconditions.checkNotNull usage.

Reference to check should be first parameter. Since Preconditions
doesn't have the right overload using Objects.requireNonNull, transition
to which was already planned.

Bug: 146340409

Test: Treehugger
Change-Id: I77b8c1f247c2f6e9abdbfe3bc627be04bd4d407b
This commit is contained in:
Daulet Zhanguzin
2019-12-18 15:32:18 +00:00
parent a46c453773
commit aadf1b6670
2 changed files with 3 additions and 3 deletions

View File

@@ -969,7 +969,7 @@ public class CameraErrorCollector extends ErrorCollector {
*/
private static class IntInMatcher extends InMatcher<Integer> {
public IntInMatcher(int[] values) {
Preconditions.checkNotNull("values", values);
Objects.requireNonNull(values, "values");
mValues = new ArrayList<>(values.length);
for (int i : values) {
mValues.add(i);
@@ -1005,7 +1005,7 @@ public class CameraErrorCollector extends ErrorCollector {
*/
private static class BooleanInMatcher extends InMatcher<Boolean> {
public BooleanInMatcher(boolean[] values) {
Preconditions.checkNotNull("values", values);
Objects.requireNonNull(values, "values");
mValues = new ArrayList<>(values.length);
for (boolean i : values) {
mValues.add(i);

View File

@@ -36,7 +36,7 @@ public class InMatcher<T> extends BaseMatcher<T> {
protected Collection<T> mValues;
public InMatcher(Collection<T> values) {
Preconditions.checkNotNull("values", values);
Objects.requireNonNull(values, "values");
mValues = values;
}