From 54b56c89e0ac748cf76d0246eb1c96f7f010fb0c Mon Sep 17 00:00:00 2001 From: Antoine Levy-Lambert Date: Wed, 23 Nov 2005 20:53:49 +0000 Subject: [PATCH] make bootstrap on JDK 1.2 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@348558 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/AntClassLoader.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/AntClassLoader.java b/src/main/org/apache/tools/ant/AntClassLoader.java index 5a19bd761..ac3f6dffc 100644 --- a/src/main/org/apache/tools/ant/AntClassLoader.java +++ b/src/main/org/apache/tools/ant/AntClassLoader.java @@ -500,7 +500,15 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { + " loader", Project.MSG_VERBOSE); continue; } - File libraryFile = new File(URLDecoder.decode(libraryURL.getFile())); + String decodedPath = null; + // try catch block required because URLDecoder.decode throws + // exception on JDK 1.2 + try { + decodedPath = URLDecoder.decode(libraryURL.getFile()); + } catch (Exception exc) { + throw new BuildException(exc); + } + File libraryFile = new File(decodedPath); if (libraryFile.exists() && !isInPath(libraryFile)) { addPathFile(libraryFile); }