Name: rlT66838 Date: 03/13/2000
Classic VM (build JDK-1.2.2-W, native threads, symcjit)
InetAddress.getByName doesn't throw UnknownHostException when it should. For
example, it happily accepts "999.999.999.999" as a valid IP address, although
it appears to store each byte modulo 256, in this case 231.231.231.231. The
following code can be used to verify this behavior.
import java.net.*;
import java.io.*;
public class InetTest
{
public static void main (String[] args)
{
try {
InetAddress ip = InetAddress.getByName (args[0]);
System.out.println ("IP address = " + ip.getHostAddress());
}
catch (UnknownHostException e) {
System.out.println ("Bad IP address");
}
}
}
(Review ID: 102411)
======================================================================