-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 1.4.0
-
Component/s: core-libs
-
hopper
-
generic
-
generic
-
Verified
Running the following code results in an unexpected exception:
public class Test {
public static void main(String args[]) throws Exception {
InetAddress[] l = InetAddress.getAllByName(args[0]);
System.err.println("l.length = " + l.length);
System.err.println(l[0]);
}
}
$ java Test "[]"
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:438)
at java.net.InetAddress.getAllByName(InetAddress.java:868)
at Test.main(Test.java:5)
public class Test {
public static void main(String args[]) throws Exception {
InetAddress[] l = InetAddress.getAllByName(args[0]);
System.err.println("l.length = " + l.length);
System.err.println(l[0]);
}
}
$ java Test "[]"
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:438)
at java.net.InetAddress.getAllByName(InetAddress.java:868)
at Test.main(Test.java:5)