From fe38d35ba7a78bd2a3ab7b89ddbfbe4af62a0619 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 1 Mar 2019 13:52:25 +0000 Subject: [PATCH] Fix Automated API Review: InetAddresses Add @NonNull annotations as required by the automated review. Bug: 126702338 Test: make checkbuild Change-Id: I9057f06de8d7ea846af00d5cefa744d4206b4b63 --- api/current.txt | 4 ++-- core/java/android/net/InetAddresses.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/current.txt b/api/current.txt index dd265898dbe2a..c3e3b344e9c31 100755 --- a/api/current.txt +++ b/api/current.txt @@ -27249,8 +27249,8 @@ package android.net { } public class InetAddresses { - method public static boolean isNumericAddress(String); - method public static java.net.InetAddress parseNumericAddress(String); + method public static boolean isNumericAddress(@NonNull String); + method @NonNull public static java.net.InetAddress parseNumericAddress(@NonNull String); } public final class IpPrefix implements android.os.Parcelable { diff --git a/core/java/android/net/InetAddresses.java b/core/java/android/net/InetAddresses.java index 8e6c69a97edb6..01b795e456fae 100644 --- a/core/java/android/net/InetAddresses.java +++ b/core/java/android/net/InetAddresses.java @@ -16,6 +16,8 @@ package android.net; +import android.annotation.NonNull; + import libcore.net.InetAddressUtils; import java.net.InetAddress; @@ -40,7 +42,7 @@ public class InetAddresses { * @param address the address to parse. * @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); } @@ -57,7 +59,7 @@ public class InetAddresses { * @return an {@link InetAddress} instance corresponding to the 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); } }