Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 46176 invoked from network); 9 Sep 2002 10:58:21 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 Sep 2002 10:58:21 -0000 Received: (qmail 14902 invoked by uid 97); 9 Sep 2002 10:58:31 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 14796 invoked by uid 97); 9 Sep 2002 10:58:30 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 14712 invoked by uid 97); 9 Sep 2002 10:58:29 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 9 Sep 2002 10:57:50 -0000 Message-ID: <20020909105750.12769.qmail@icarus.apache.org> From: remm@apache.org To: jakarta-tomcat-jasper-cvs@apache.org Subject: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Compiler.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N remm 2002/09/09 03:57:50 Modified: jasper2/src/share/org/apache/jasper/compiler Tag: tomcat_4_branch Compiler.java Log: - Cleanup Ant path generation, as using Strings doesn't work correctly. This is more resources intensive than before, but at least it now works fine on Windows. - Provides a workaround for bug 12387. - Fixes problems if path contains spaces (may affect Unix also). Revision Changes Path No revision No revision 1.18.2.5 +16 -10 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.18.2.4 retrieving revision 1.18.2.5 diff -u -r1.18.2.4 -r1.18.2.5 --- Compiler.java 8 Sep 2002 05:45:59 -0000 1.18.2.4 +++ Compiler.java 9 Sep 2002 10:57:50 -0000 1.18.2.5 @@ -77,6 +77,7 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Javac; import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.PatternSet; import org.apache.jasper.JspCompilationContext; import org.apache.jasper.Constants; @@ -238,8 +239,8 @@ * Compile the jsp file from the current engine context */ public void generateClass() - throws FileNotFoundException, JasperException, Exception - { + throws FileNotFoundException, JasperException, Exception { + String javaEncoding = ctxt.getOptions().getJavaEncoding(); String javaFileName = ctxt.getServletJavaFileName(); String classpath = ctxt.getClassPath(); @@ -258,17 +259,21 @@ // Initializing classpath Path path = new Path(project); - path.setPath(System.getProperty("java.class.path") + sep - + classpath); + path.setPath(System.getProperty("java.class.path")); + StringTokenizer tokenizer = new StringTokenizer(classpath, sep); + while (tokenizer.hasMoreElements()) { + String pathElement = tokenizer.nextToken(); + File repository = new File(pathElement); + path.setLocation(repository); + } // Initializing sourcepath Path srcPath = new Path(project); - srcPath.setPath(options.getScratchDir().getAbsolutePath()); + srcPath.setLocation(options.getScratchDir()); // Configure the compiler object javac.setEncoding(javaEncoding); javac.setClasspath(path); - //javac.setDestdir(new File(options.getScratchDir().getAbsolutePath())); javac.setDebug(ctxt.getOptions().getClassDebugInfo()); javac.setSrcdir(srcPath); javac.setOptimize(! ctxt.getOptions().getClassDebugInfo() ); @@ -279,7 +284,8 @@ } // Build includes path - javac.setIncludes(ctxt.getJspPath()); + PatternSet.NameEntry includes = javac.createInclude(); + includes.setName(ctxt.getJspPath()); try { javac.execute(); -- To unsubscribe, e-mail: For additional commands, e-mail: