From 6c40e0ca77d68418106ebd401936949e61e152bd Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 5 Oct 2000 07:58:06 +0000 Subject: [PATCH] Let jikes use the temporary file solution if the total length of the command line exceeds 4k. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268058 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/Javac.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Javac.java b/src/main/org/apache/tools/ant/taskdefs/Javac.java index 3a089cfff..1eb0b07ac 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Javac.java +++ b/src/main/org/apache/tools/ant/taskdefs/Javac.java @@ -747,15 +747,14 @@ public class Javac extends MatchingTask { 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());