Fix Automated API Review: InetAddresses

Add @NonNull annotations as required by the automated review.

Bug: 126702338
Test: make checkbuild
Change-Id: I9057f06de8d7ea846af00d5cefa744d4206b4b63
This commit is contained in:
Paul Duffin
2019-03-01 13:52:25 +00:00
parent f3fd8dd454
commit e59e8c6255

View File

@@ -16,6 +16,8 @@
package android.net; package android.net;
import android.annotation.NonNull;
import libcore.net.InetAddressUtils; import libcore.net.InetAddressUtils;
import java.net.InetAddress; import java.net.InetAddress;
@@ -40,7 +42,7 @@ public class InetAddresses {
* @param address the address to parse. * @param address the address to parse.
* @return true if the supplied address is numeric, false otherwise. * @return true if the supplied address is numeric, false otherwise.
*/ */
public static boolean isNumericAddress(String address) { public static boolean isNumericAddress(@NonNull String address) {
return InetAddressUtils.isNumericAddress(address); return InetAddressUtils.isNumericAddress(address);
} }
@@ -57,7 +59,7 @@ public class InetAddresses {
* @return an {@link InetAddress} instance corresponding to the address. * @return an {@link InetAddress} instance corresponding to the address.
* @throws IllegalArgumentException if {@code address} is not a numeric address. * @throws IllegalArgumentException if {@code address} is not a numeric address.
*/ */
public static InetAddress parseNumericAddress(String address) { public static @NonNull InetAddress parseNumericAddress(@NonNull String address) {
return InetAddressUtils.parseNumericAddress(address); return InetAddressUtils.parseNumericAddress(address);
} }
} }