Loading core/java/android/service/autofill/AutofillServiceHelper.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -26,7 +26,13 @@ final class AutofillServiceHelper { static AutofillId[] assertValid(@Nullable AutofillId[] ids) { static AutofillId[] assertValid(@Nullable AutofillId[] ids) { Preconditions.checkArgument(ids != null && ids.length > 0, "must have at least one id"); Preconditions.checkArgument(ids != null && ids.length > 0, "must have at least one id"); return Preconditions.checkArrayElementsNotNull(ids, "ids"); // Can't use Preconditions.checkArrayElementsNotNull() because it throws NPE instead of IAE for (int i = 0; i < ids.length; ++i) { if (ids[i] == null) { throw new IllegalArgumentException("ids[" + i + "] must not be null"); } } return ids; } } private AutofillServiceHelper() { private AutofillServiceHelper() { Loading Loading
core/java/android/service/autofill/AutofillServiceHelper.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -26,7 +26,13 @@ final class AutofillServiceHelper { static AutofillId[] assertValid(@Nullable AutofillId[] ids) { static AutofillId[] assertValid(@Nullable AutofillId[] ids) { Preconditions.checkArgument(ids != null && ids.length > 0, "must have at least one id"); Preconditions.checkArgument(ids != null && ids.length > 0, "must have at least one id"); return Preconditions.checkArrayElementsNotNull(ids, "ids"); // Can't use Preconditions.checkArrayElementsNotNull() because it throws NPE instead of IAE for (int i = 0; i < ids.length; ++i) { if (ids[i] == null) { throw new IllegalArgumentException("ids[" + i + "] must not be null"); } } return ids; } } private AutofillServiceHelper() { private AutofillServiceHelper() { Loading