]> source.dussan.org Git - aspectj.git/commitdiff
added some commented out debug code that is useful when you want
authoracolyer <acolyer>
Fri, 30 Jul 2004 18:09:51 +0000 (18:09 +0000)
committeracolyer <acolyer>
Fri, 30 Jul 2004 18:09:51 +0000 (18:09 +0000)
to get information on a failure in a forking task

taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java

index c049aee5f10711625b75e111bf26c847ee377abf..1cf3d11d33a3825f9b607cc4d40cbd22e86184c7 100644 (file)
@@ -1310,8 +1310,30 @@ public class AjcTask extends MatchingTask {
     protected int execInOtherVM(String[] args) {
         try {
             Project project = getProject();
-            LogStreamHandler handler = new LogStreamHandler(this,
-                                 Project.MSG_INFO, Project.MSG_WARN);
+          LogStreamHandler handler = new LogStreamHandler(this,
+          Project.MSG_INFO, Project.MSG_WARN);
+// replace above two lines with what follows as an aid to debugging when running the unit tests....
+//            LogStreamHandler handler = new LogStreamHandler(this,
+//                                 Project.MSG_INFO, Project.MSG_WARN) {
+//             
+//             ByteArrayOutputStream baos = new ByteArrayOutputStream();
+//             /* (non-Javadoc)
+//                              * @see org.apache.tools.ant.taskdefs.PumpStreamHandler#createProcessOutputPump(java.io.InputStream, java.io.OutputStream)
+//                              */
+//                             protected void createProcessErrorPump(InputStream is,
+//                                             OutputStream os) {
+//                                     super.createProcessErrorPump(is, baos);
+//                             }
+//                             
+//                             /* (non-Javadoc)
+//                              * @see org.apache.tools.ant.taskdefs.LogStreamHandler#stop()
+//                              */
+//                             public void stop() {
+//                                     byte[] written = baos.toByteArray();
+//                                     System.err.print(new String(written));
+//                                     super.stop();
+//                             }
+//            };
             Execute exe = new Execute(handler);
             exe.setAntRun(project);
             exe.setWorkingDirectory(project.getBaseDir());