Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32c3b81b authored by Elliott Hughes's avatar Elliott Hughes Committed by Android (Google) Code Review
Browse files

Merge "Use InetAddress.parseNumericAddress."

parents 94f40199 f5bbb572
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -159,17 +159,7 @@ public class NetworkUtils {
     */
    public static InetAddress numericToInetAddress(String addrString)
            throws IllegalArgumentException {
        // TODO - do this for real, using a hidden method on InetAddress that aborts
        // instead of doing dns step
        if (!InetAddress.isNumeric(addrString)) {
            throw new IllegalArgumentException("numericToInetAddress with non numeric: '" +
                    addrString + "'");
        }
        try {
            return InetAddress.getByName(addrString);
        } catch (UnknownHostException e) {
            throw new IllegalArgumentException(e);
        }
        return InetAddress.parseNumericAddress(addrString);
    }

    /**