--- a/o.apache.tools.ant.module/src/org/apache/tools/ant/module/bridge/AntBridge.java +++ a/o.apache.tools.ant.module/src/org/apache/tools/ant/module/bridge/AntBridge.java @@ -56,8 +56,13 @@ import java.lang.ref.Reference; import java.lang.ref.SoftReference; import java.lang.reflect.Method; +import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.CharacterCodingException; +import java.nio.charset.Charset; import java.security.AllPermission; import java.security.CodeSource; import java.security.PermissionCollection; @@ -80,6 +85,7 @@ import org.openide.modules.InstalledFileLocator; import org.openide.modules.ModuleInfo; import org.openide.util.ChangeSupport; +import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.util.LookupEvent; import org.openide.util.LookupListener; @@ -573,7 +579,7 @@ } public AllPermissionURLClassLoader(URL[] urls, ClassLoader parent) { - super(urls, parent); + super(sanitize(urls), parent); } @Override @@ -609,6 +615,49 @@ throw e; } } + + private static URL sanitize (URL url) { + final String surl = url.toExternalForm(); + boolean changed = false; + final StringBuilder sb = new StringBuilder(); + final CharBuffer cb = CharBuffer.allocate(1); + final Charset cs = Charset.forName("UTF-8"); + try { + for (int i=0; i