diff options
author | Jose <jose@zeroc.com> | 2012-02-13 22:08:51 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-02-13 22:08:51 +0100 |
commit | cce2eff99acdc3a2b88e7211f714c3af3fc54d32 (patch) | |
tree | 65fad6c2ce73ae1919cd067f24bb0c9463488b9e /java/src/IceInternal/Util.java | |
parent | ICE-4590 - map structs that include default values to a class (diff) | |
download | ice-cce2eff99acdc3a2b88e7211f714c3af3fc54d32.tar.bz2 ice-cce2eff99acdc3a2b88e7211f714c3af3fc54d32.tar.xz ice-cce2eff99acdc3a2b88e7211f714c3af3fc54d32.zip |
ICE-4792 - Fix IllegalArgumentException on Windows
Diffstat (limited to 'java/src/IceInternal/Util.java')
-rw-r--r-- | java/src/IceInternal/Util.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/java/src/IceInternal/Util.java b/java/src/IceInternal/Util.java index c19e3702e01..352c304b206 100644 --- a/java/src/IceInternal/Util.java +++ b/java/src/IceInternal/Util.java @@ -40,7 +40,22 @@ public final class Util // // getResourceAsStream returns null if the resource can't be found. // - java.io.InputStream stream = cl.getResourceAsStream(path); + java.io.InputStream stream = null; + try + { + stream = cl.getResourceAsStream(path); + } + catch(IllegalArgumentException ex) + { + // + // With JDK-7 this can happen if the result url (base url + path) produces a + // malformed url for an URLClassLoader. For example the code in following + // comment will produce this exception under Windows. + // + // URLClassLoader cl = new URLClassLoader(new URL[] {new URL("http://localhost:8080/")}); + // java.io.InputStream in = IceInternal.Util.openResource(cl, "c:\\foo.txt"); + // + } if(stream == null) { try |