From 6c80c45e3010bfe992b41dd8800d2c4b65e0d5ef Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 19 May 2000 17:55:34 +0000 Subject: Jumbo patch: * Imported beans and serialization * Updated IA-64 port * Miscellaneous bug fixes From-SVN: r34028 --- libjava/java/net/URL.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libjava/java/net/URL.java') diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java index f80a52f5878..5931eefa3fb 100644 --- a/libjava/java/net/URL.java +++ b/libjava/java/net/URL.java @@ -329,6 +329,20 @@ public final class URL implements Serializable // If a non-default factory has been set, use it to find the protocol. if (factory != null) handler = factory.createURLStreamHandler(protocol); + else if (protocol.equals ("file")) + { + // This is an interesting case. It's tempting to think that we + // could call Class.forName ("gnu.gcj.protocol.file.Handler") to + // get the appropriate class. Unfortunately, if we do that the + // program will never terminate, because setURLStreamHandler is + // eventually called by Class.forName. + // + // Treating "file" as a special case is the minimum that will + // fix this problem. If other protocols are required in a + // statically linked application they will need to be handled in + // the same way as "file". + handler = new gnu.gcj.protocol.file.Handler (); + } // Non-default factory may have returned null or a factory wasn't set. // Use the default search algorithm to find a handler for this protocol. -- cgit v1.2.3