From 219460a65a64d1dea353cb30a9ba2ecf2d8d4a65 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Sun, 23 Dec 2001 00:10:10 +0000 Subject: [PATCH] Task never used watchdog so why fake it ? git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270336 13f79535-47bb-0310-9956-ffa450edef68 --- .../optional/jdepend/JDependTask.java | 34 +++---------------- .../optional/jdepend/JDependTask.java | 34 +++---------------- 2 files changed, 10 insertions(+), 58 deletions(-) diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java index fa5bc118f..4c544d5ba 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java @@ -16,7 +16,7 @@ import org.apache.tools.ant.PathTokenizer; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.taskdefs.exec.Execute; -import org.apache.tools.ant.taskdefs.exec.ExecuteWatchdog; +import org.apache.myrmidon.framework.exec.ExecuteWatchdog; import org.apache.tools.ant.taskdefs.exec.LogStreamHandler; import org.apache.tools.ant.types.Commandline; import org.apache.tools.ant.types.CommandlineJava; @@ -265,14 +265,7 @@ public class JDependTask extends Task } else { - ExecuteWatchdog watchdog = createWatchdog(); - exitValue = executeAsForked( commandline, watchdog ); - // null watchdog means no timeout, you'd better not check with null - if( watchdog != null ) - { - //info will be used in later version do nothing for now - //wasKilled = watchdog.killedProcess(); - } + exitValue = executeAsForked( commandline ); } // if there is an error/failure and that it should halt, stop everything otherwise @@ -302,7 +295,7 @@ public class JDependTask extends Task * @exception TaskException Description of Exception */ // JL: comment extracted from JUnitTask (and slightly modified) - public int executeAsForked( CommandlineJava commandline, ExecuteWatchdog watchdog ) + public int executeAsForked( CommandlineJava commandline ) throws TaskException { // if not set, auto-create the ClassPath from the project @@ -336,7 +329,8 @@ public class JDependTask extends Task commandline.createArgument().setValue( f.getPath() ); } - Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); + Execute execute = + new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); execute.setCommandline( commandline.getCommandline() ); if( getDir() != null ) { @@ -423,24 +417,6 @@ public class JDependTask extends Task return SUCCESS; } - /** - * @return null if there is a timeout value, otherwise the watchdog - * instance. - * @exception TaskException Description of Exception - */ - protected ExecuteWatchdog createWatchdog() - throws TaskException - { - - return null; - /* - * if (getTimeout() == null){ - * return null; - * } - * return new ExecuteWatchdog(getTimeout().intValue()); - */ - } - public static class FormatAttribute extends EnumeratedAttribute { private String[] formats = new String[]{"xml", "text"}; diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java index fa5bc118f..4c544d5ba 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java @@ -16,7 +16,7 @@ import org.apache.tools.ant.PathTokenizer; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.apache.tools.ant.taskdefs.exec.Execute; -import org.apache.tools.ant.taskdefs.exec.ExecuteWatchdog; +import org.apache.myrmidon.framework.exec.ExecuteWatchdog; import org.apache.tools.ant.taskdefs.exec.LogStreamHandler; import org.apache.tools.ant.types.Commandline; import org.apache.tools.ant.types.CommandlineJava; @@ -265,14 +265,7 @@ public class JDependTask extends Task } else { - ExecuteWatchdog watchdog = createWatchdog(); - exitValue = executeAsForked( commandline, watchdog ); - // null watchdog means no timeout, you'd better not check with null - if( watchdog != null ) - { - //info will be used in later version do nothing for now - //wasKilled = watchdog.killedProcess(); - } + exitValue = executeAsForked( commandline ); } // if there is an error/failure and that it should halt, stop everything otherwise @@ -302,7 +295,7 @@ public class JDependTask extends Task * @exception TaskException Description of Exception */ // JL: comment extracted from JUnitTask (and slightly modified) - public int executeAsForked( CommandlineJava commandline, ExecuteWatchdog watchdog ) + public int executeAsForked( CommandlineJava commandline ) throws TaskException { // if not set, auto-create the ClassPath from the project @@ -336,7 +329,8 @@ public class JDependTask extends Task commandline.createArgument().setValue( f.getPath() ); } - Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); + Execute execute = + new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); execute.setCommandline( commandline.getCommandline() ); if( getDir() != null ) { @@ -423,24 +417,6 @@ public class JDependTask extends Task return SUCCESS; } - /** - * @return null if there is a timeout value, otherwise the watchdog - * instance. - * @exception TaskException Description of Exception - */ - protected ExecuteWatchdog createWatchdog() - throws TaskException - { - - return null; - /* - * if (getTimeout() == null){ - * return null; - * } - * return new ExecuteWatchdog(getTimeout().intValue()); - */ - } - public static class FormatAttribute extends EnumeratedAttribute { private String[] formats = new String[]{"xml", "text"};