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

Commit f5bbb572 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Use InetAddress.parseNumericAddress.

Bug: 3300307
Change-Id: I4ebfe533056e67931db1117e934596ba7b5c8b75
parent 6b5e5937
Loading
Loading
Loading
Loading
+1 −11
Original line number Original line Diff line number Diff line
@@ -159,17 +159,7 @@ public class NetworkUtils {
     */
     */
    public static InetAddress numericToInetAddress(String addrString)
    public static InetAddress numericToInetAddress(String addrString)
            throws IllegalArgumentException {
            throws IllegalArgumentException {
        // TODO - do this for real, using a hidden method on InetAddress that aborts
        return InetAddress.parseNumericAddress(addrString);
        // 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);
        }
    }
    }


    /**
    /**