kinman      2002/09/11 14:07:53

  Modified:    jasper2/src/share/org/apache/jasper/compiler Compiler.java
  Log:
  - Applied Remy's fix from tomcat_4_branch.
  
  Revision  Changes    Path
  1.33      +13 -7     
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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- Compiler.java     11 Sep 2002 19:07:32 -0000      1.32
  +++ Compiler.java     11 Sep 2002 21:07:53 -0000      1.33
  @@ -74,6 +74,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;
  @@ -310,8 +311,8 @@
        * Compile the jsp file from the current engine context
        */
       public void generateClass()
  -        throws FileNotFoundException, JasperException, Exception
  -    {
  +        throws FileNotFoundException, JasperException, Exception {
  +
           long t1=System.currentTimeMillis();
        String javaEncoding = "UTF8"; 
           String javaFileName = ctxt.getServletJavaFileName();
  @@ -331,8 +332,13 @@
   
           // 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);
  +        }
   
           if( log.isDebugEnabled() )
               log.debug( "Using classpath: " + System.getProperty("java.class.path") 
+ sep
  @@ -340,12 +346,11 @@
           
           // 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() );
  @@ -356,7 +361,8 @@
           }
   
           // Build includes path
  -        javac.setIncludes(ctxt.getJspPath());
  +        PatternSet.NameEntry includes = javac.createInclude();
  +        includes.setName(ctxt.getJspPath());
   
           try {
               synchronized(javacLock) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to