bodewig 00/10/05 00:58:06
Modified: src/main/org/apache/tools/ant/taskdefs Javac.java
Log:
Let jikes use the temporary file solution if the total length of the
command line exceeds 4k.
Revision Changes Path
1.46 +8 -9
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
Index: Javac.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- Javac.java 2000/09/29 15:40:33 1.45
+++ Javac.java 2000/10/05 07:58:06 1.46
@@ -747,15 +747,14 @@
File tmpFile = null;
try {
- String myos = System.getProperty("os.name");
-
- // Windows has a 32k limit on total arg size, so
- // create a temporary file to store all the arguments
-
- // There have been reports that 300 files could be compiled
- // so 250 is a conservative approach
- if (myos.toLowerCase().indexOf("windows") >= 0
- && args.length > 250) {
+ /*
+ * Many system have been reported to get into trouble with
+ * long command lines - no, not only Windows 8^).
+ *
+ * POSIX seems to define a lower limit of 4k, so use a temporary
+ * file if the total length of the command line exceeds this
limit.
+ */
+ if (Commandline.toString(args).length() > 4096) {
PrintWriter out = null;
try {
tmpFile = new File("jikes"+(new
Random(System.currentTimeMillis())).nextLong());