ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpfoe...@ThoughtWorks.com
Subject do we still need JikesOutputParser?
Date Mon, 07 Aug 2000 02:59:17 GMT
I recently started getting this error when using jikes 1.12:

Assertion failed: false && "Cannot compute system time stamp\n", file
../../../jikes-1.12/src/lookup.cpp, line 284

I have no idea what it means, but it always gets written to stderr, not
stdout, even if the -Xstdout flag is set. The JikesOutputParser class only
reads from stdout, however, so the jikes process never finishes, and ant
hangs as a result. Even worse, if I kill the jikes process, the
JikesOutputParser thinks everything is ok, since no errors were printed,
and ant continues building.

I guess my question is, why are we trying to parse the output stream from
jikes to determine if there were errors, instead of simply checking the
exit code from the jikes process? The patch below  uses the default
StreamHandler and checks the jikes exit code, and doesn't use
JikesOutputParser at all. It seems to work ok...

Matt Foemmel
ThoughtWorks, Inc.

Index: Jikes.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jikes.java,v
retrieving revision 1.5
diff -u -r1.5 Jikes.java
--- Jikes.java 2000/08/04 14:58:42 1.5
+++ Jikes.java 2000/08/06 23:49:46
@@ -67,17 +67,20 @@
                 commandArray[0] = command;
                 System.arraycopy(args,0,commandArray,1,args.length);
             }
-
+
             // We assume, that everything jikes writes goes to
             // standard output, not to standard error. The option
             // -Xstdout that is given to Jikes in Javac.doJikesCompile()
             // should guarantee this. At least I hope so. :)
             try {
-                Execute exe = new Execute(jop);
+                Execute exe = new Execute();
                 exe.setAntRun(project);
                 exe.setWorkingDirectory(project.getBaseDir());
                 exe.setCommandline(commandArray);
                 exe.execute();
+                if (exe.getExitValue() != 0) {
+                    throw new BuildException("Compile failed");
+                }
             } catch (IOException e) {
                 throw new BuildException("Error running Jikes compiler",
e);
             }


Mime
View raw message