seguin 01/08/14 13:52:43
Modified: jasper/src/share/org/apache/jasper/compiler
JikesJavaCompiler.java
Log:
two fixes:
1) normalize the classpath jikes is invoked with so that it
doesn't contain file urls like "/c:/tomcat/webapps/..."
on windows, which makes jikes barf.
2) add +E option to jikes command line so that error output
parsing works.
Revision Changes Path
1.5 +30 -4
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java
Index: JikesJavaCompiler.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JikesJavaCompiler.java 2001/02/08 13:37:54 1.4
+++ JikesJavaCompiler.java 2001/08/14 20:52:43 1.5
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java,v
1.4 2001/02/08 13:37:54 glenn Exp $
- * $Revision: 1.4 $
- * $Date: 2001/02/08 13:37:54 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JikesJavaCompiler.java,v
1.5 2001/08/14 20:52:43 seguin Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/08/14 20:52:43 $
*
* ====================================================================
*
@@ -66,6 +66,7 @@
import java.io.IOException;
import java.io.File;
import java.io.ByteArrayOutputStream;
+import java.util.StringTokenizer;
/**
* A Plug-in class for specifying a 'jikes' compile.
@@ -110,7 +111,30 @@
* Set the class path for the compiler
*/
public void setClasspath(String classpath) {
- this.classpath = classpath;
+ //
+ // normalize the paths in the classpath. this
+ // is really only an issue with jikes on windows.
+ //
+ // sometimes a path the looks like this:
+ // /c:/tomcat/webapps/WEB-INF/classes
+ // will show up in the classpath. in fact, this
+ // *always* happens with tomcat4. jikes on windows
+ // will barf on this. the following code will normalize
+ // paths like this (all paths, actually) so that jikes
+ // is happy :)
+ //
+
+ StringBuffer buf = new StringBuffer(classpath.length());
+ StringTokenizer tok = new StringTokenizer(classpath,
+ File.pathSeparator);
+ while (tok.hasMoreTokens()) {
+ String token = tok.nextToken();
+ File file = new File(token);
+ buf.append(file.toString());
+ buf.append(File.pathSeparator);
+ }
+
+ this.classpath = buf.toString();
}
/**
@@ -162,6 +186,7 @@
"-classpath", quote + classpath + MicrosoftClasspath + quote,
"-d", quote + outdir + quote,
"-nowarn",
+ "+E",
quote + source + quote
};
} else {
@@ -170,6 +195,7 @@
//XXX - add encoding once Jikes supports it
"-classpath", quote + classpath + MicrosoftClasspath + quote,
"-nowarn",
+ "+E",
quote + source + quote
};
}