git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270285 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -22,6 +22,10 @@ import org.apache.tools.ant.util.StringUtils; | |||||
| */ | */ | ||||
| public class RecorderEntry implements BuildLogger | public class RecorderEntry implements BuildLogger | ||||
| { | { | ||||
| /** | |||||
| * the line separator for this OS | |||||
| */ | |||||
| private final static String LINE_SEP = System.getProperty( "line.separator" ); | |||||
| ////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////// | ||||
| // ATTRIBUTES | // ATTRIBUTES | ||||
| @@ -128,11 +132,11 @@ public class RecorderEntry implements BuildLogger | |||||
| Throwable error = event.getException(); | Throwable error = event.getException(); | ||||
| if( error == null ) | if( error == null ) | ||||
| { | { | ||||
| out.println( StringUtils.LINE_SEP + "BUILD SUCCESSFUL" ); | |||||
| out.println( LINE_SEP + "BUILD SUCCESSFUL" ); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| out.println( StringUtils.LINE_SEP + "BUILD FAILED" + StringUtils.LINE_SEP ); | |||||
| out.println( LINE_SEP + "BUILD FAILED" + LINE_SEP ); | |||||
| error.printStackTrace( out ); | error.printStackTrace( out ); | ||||
| } | } | ||||
| out.flush(); | out.flush(); | ||||
| @@ -177,7 +181,7 @@ public class RecorderEntry implements BuildLogger | |||||
| public void targetStarted( BuildEvent event ) | public void targetStarted( BuildEvent event ) | ||||
| { | { | ||||
| log( ">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG ); | log( ">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG ); | ||||
| log( StringUtils.LINE_SEP + event.getTarget().getName() + ":", Project.MSG_INFO ); | |||||
| log( LINE_SEP + event.getTarget().getName() + ":", Project.MSG_INFO ); | |||||
| targetStartTime = System.currentTimeMillis(); | targetStartTime = System.currentTimeMillis(); | ||||
| } | } | ||||
| @@ -43,6 +43,7 @@ import org.apache.tools.ant.BuildEvent; | |||||
| import org.apache.tools.ant.BuildListener; | import org.apache.tools.ant.BuildListener; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| /** | /** | ||||
| * This is a simple grafical user interface to provide the information needed by | * This is a simple grafical user interface to provide the information needed by | ||||
| @@ -1403,7 +1404,7 @@ public class VAJAntToolGUI extends Frame | |||||
| private void handleException( Throwable exception ) | private void handleException( Throwable exception ) | ||||
| { | { | ||||
| // Write exceptions to the log-window | // Write exceptions to the log-window | ||||
| String trace = StringUtils.getStackTrace( exception ); | |||||
| String trace = ExceptionUtil.printStackTrace( exception ); | |||||
| getMessageTextArea().append( lineSeparator + lineSeparator + trace ); | getMessageTextArea().append( lineSeparator + lineSeparator + trace ); | ||||
| getMessageFrame().show(); | getMessageFrame().show(); | ||||
| @@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| /** | /** | ||||
| * Abstract base class to provide common services for the VAJ tool API servlets | * Abstract base class to provide common services for the VAJ tool API servlets | ||||
| @@ -72,7 +73,7 @@ public abstract class VAJToolsServlet extends HttpServlet | |||||
| { | { | ||||
| if( !( e instanceof TaskException ) ) | if( !( e instanceof TaskException ) ) | ||||
| { | { | ||||
| String trace = StringUtils.getStackTrace( e ); | |||||
| String trace = ExceptionUtil.printStackTrace( e ); | |||||
| util.log( "Program error in " + this.getClass().getName() | util.log( "Program error in " + this.getClass().getName() | ||||
| + ":\n" + trace, VAJUtil.MSG_ERR ); | + ":\n" + trace, VAJUtil.MSG_ERR ); | ||||
| } | } | ||||
| @@ -30,6 +30,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
| import org.apache.tools.ant.AntClassLoader; | import org.apache.tools.ant.AntClassLoader; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| /** | /** | ||||
| * Simple Testrunner for JUnit that runs all tests of a testsuite. <p> | * Simple Testrunner for JUnit that runs all tests of a testsuite. <p> | ||||
| @@ -225,7 +226,7 @@ public class JUnitTestRunner implements TestListener | |||||
| */ | */ | ||||
| public static String getFilteredTrace( Throwable t ) | public static String getFilteredTrace( Throwable t ) | ||||
| { | { | ||||
| String trace = StringUtils.getStackTrace( t ); | |||||
| final String trace = ExceptionUtil.printStackTrace( t ); | |||||
| return JUnitTestRunner.filterStack( trace ); | return JUnitTestRunner.filterStack( trace ); | ||||
| } | } | ||||
| @@ -18,6 +18,7 @@ import java.util.Vector; | |||||
| import javax.xml.parsers.DocumentBuilder; | import javax.xml.parsers.DocumentBuilder; | ||||
| import javax.xml.parsers.DocumentBuilderFactory; | import javax.xml.parsers.DocumentBuilderFactory; | ||||
| import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| @@ -296,7 +297,7 @@ public class XMLResultAggregator extends Task implements XMLConstants | |||||
| // a testcase might have failed and write a zero-length document, | // a testcase might have failed and write a zero-length document, | ||||
| // It has already failed, but hey.... mm. just put a warning | // It has already failed, but hey.... mm. just put a warning | ||||
| log( "The file " + files[ i ] + " is not a valid XML document. It is possibly corrupted.", Project.MSG_WARN ); | log( "The file " + files[ i ] + " is not a valid XML document. It is possibly corrupted.", Project.MSG_WARN ); | ||||
| log( StringUtils.getStackTrace( e ), Project.MSG_DEBUG ); | |||||
| log( ExceptionUtil.printStackTrace( e ), Project.MSG_DEBUG ); | |||||
| } | } | ||||
| catch( IOException e ) | catch( IOException e ) | ||||
| { | { | ||||
| @@ -22,6 +22,10 @@ import org.apache.tools.ant.util.StringUtils; | |||||
| */ | */ | ||||
| public class RecorderEntry implements BuildLogger | public class RecorderEntry implements BuildLogger | ||||
| { | { | ||||
| /** | |||||
| * the line separator for this OS | |||||
| */ | |||||
| private final static String LINE_SEP = System.getProperty( "line.separator" ); | |||||
| ////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////// | ||||
| // ATTRIBUTES | // ATTRIBUTES | ||||
| @@ -128,11 +132,11 @@ public class RecorderEntry implements BuildLogger | |||||
| Throwable error = event.getException(); | Throwable error = event.getException(); | ||||
| if( error == null ) | if( error == null ) | ||||
| { | { | ||||
| out.println( StringUtils.LINE_SEP + "BUILD SUCCESSFUL" ); | |||||
| out.println( LINE_SEP + "BUILD SUCCESSFUL" ); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| out.println( StringUtils.LINE_SEP + "BUILD FAILED" + StringUtils.LINE_SEP ); | |||||
| out.println( LINE_SEP + "BUILD FAILED" + LINE_SEP ); | |||||
| error.printStackTrace( out ); | error.printStackTrace( out ); | ||||
| } | } | ||||
| out.flush(); | out.flush(); | ||||
| @@ -177,7 +181,7 @@ public class RecorderEntry implements BuildLogger | |||||
| public void targetStarted( BuildEvent event ) | public void targetStarted( BuildEvent event ) | ||||
| { | { | ||||
| log( ">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG ); | log( ">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG ); | ||||
| log( StringUtils.LINE_SEP + event.getTarget().getName() + ":", Project.MSG_INFO ); | |||||
| log( LINE_SEP + event.getTarget().getName() + ":", Project.MSG_INFO ); | |||||
| targetStartTime = System.currentTimeMillis(); | targetStartTime = System.currentTimeMillis(); | ||||
| } | } | ||||
| @@ -43,6 +43,7 @@ import org.apache.tools.ant.BuildEvent; | |||||
| import org.apache.tools.ant.BuildListener; | import org.apache.tools.ant.BuildListener; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| /** | /** | ||||
| * This is a simple grafical user interface to provide the information needed by | * This is a simple grafical user interface to provide the information needed by | ||||
| @@ -1403,7 +1404,7 @@ public class VAJAntToolGUI extends Frame | |||||
| private void handleException( Throwable exception ) | private void handleException( Throwable exception ) | ||||
| { | { | ||||
| // Write exceptions to the log-window | // Write exceptions to the log-window | ||||
| String trace = StringUtils.getStackTrace( exception ); | |||||
| String trace = ExceptionUtil.printStackTrace( exception ); | |||||
| getMessageTextArea().append( lineSeparator + lineSeparator + trace ); | getMessageTextArea().append( lineSeparator + lineSeparator + trace ); | ||||
| getMessageFrame().show(); | getMessageFrame().show(); | ||||
| @@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| /** | /** | ||||
| * Abstract base class to provide common services for the VAJ tool API servlets | * Abstract base class to provide common services for the VAJ tool API servlets | ||||
| @@ -72,7 +73,7 @@ public abstract class VAJToolsServlet extends HttpServlet | |||||
| { | { | ||||
| if( !( e instanceof TaskException ) ) | if( !( e instanceof TaskException ) ) | ||||
| { | { | ||||
| String trace = StringUtils.getStackTrace( e ); | |||||
| String trace = ExceptionUtil.printStackTrace( e ); | |||||
| util.log( "Program error in " + this.getClass().getName() | util.log( "Program error in " + this.getClass().getName() | ||||
| + ":\n" + trace, VAJUtil.MSG_ERR ); | + ":\n" + trace, VAJUtil.MSG_ERR ); | ||||
| } | } | ||||
| @@ -30,6 +30,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
| import org.apache.tools.ant.AntClassLoader; | import org.apache.tools.ant.AntClassLoader; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| /** | /** | ||||
| * Simple Testrunner for JUnit that runs all tests of a testsuite. <p> | * Simple Testrunner for JUnit that runs all tests of a testsuite. <p> | ||||
| @@ -225,7 +226,7 @@ public class JUnitTestRunner implements TestListener | |||||
| */ | */ | ||||
| public static String getFilteredTrace( Throwable t ) | public static String getFilteredTrace( Throwable t ) | ||||
| { | { | ||||
| String trace = StringUtils.getStackTrace( t ); | |||||
| final String trace = ExceptionUtil.printStackTrace( t ); | |||||
| return JUnitTestRunner.filterStack( trace ); | return JUnitTestRunner.filterStack( trace ); | ||||
| } | } | ||||
| @@ -18,6 +18,7 @@ import java.util.Vector; | |||||
| import javax.xml.parsers.DocumentBuilder; | import javax.xml.parsers.DocumentBuilder; | ||||
| import javax.xml.parsers.DocumentBuilderFactory; | import javax.xml.parsers.DocumentBuilderFactory; | ||||
| import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| @@ -296,7 +297,7 @@ public class XMLResultAggregator extends Task implements XMLConstants | |||||
| // a testcase might have failed and write a zero-length document, | // a testcase might have failed and write a zero-length document, | ||||
| // It has already failed, but hey.... mm. just put a warning | // It has already failed, but hey.... mm. just put a warning | ||||
| log( "The file " + files[ i ] + " is not a valid XML document. It is possibly corrupted.", Project.MSG_WARN ); | log( "The file " + files[ i ] + " is not a valid XML document. It is possibly corrupted.", Project.MSG_WARN ); | ||||
| log( StringUtils.getStackTrace( e ), Project.MSG_DEBUG ); | |||||
| log( ExceptionUtil.printStackTrace( e ), Project.MSG_DEBUG ); | |||||
| } | } | ||||
| catch( IOException e ) | catch( IOException e ) | ||||
| { | { | ||||