Name: skT45625 Date: 12/18/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)
Get a MalformedURLException that says that a StringIndexOutOfBounds exception
were thrown when trying to add a directory or file entry in a jar URL.
Example code:
import java.net.*;
class UrlExample {
public static void main( String[] args ) {
try {
URL context = new URL( "jar:http://balloo.com/olle.jar!/" );
String spec = "p2";
URL p2Url = new URL( context, spec );
System.out.println( "p2Url = " + p2Url.toString() );
} catch( Exception e ) {
e.printStackTrace( System.err );
}
}
}
Executing a this class gives the following:
java.net.MalformedURLException: java.lang.StringIndexOutOfBoundsException:
String index out of range: 4
at java.net.URL.<init>(URL.java:496)
at java.net.URL.<init>(URL.java:376)
at UrlExample.main(UrlExample.java:11)
(Review ID: 113969)
======================================================================