ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide VAJAntToolGUI.java VAJToolsServlet.java
Date Sat, 15 Dec 2001 00:29:43 GMT
sbailliez    01/12/14 16:29:43

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/ide
                        VAJAntToolGUI.java VAJToolsServlet.java
  Log:
  Take advantage of StringUtils
  
  Revision  Changes    Path
  1.4       +3 -4      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java
  
  Index: VAJAntToolGUI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- VAJAntToolGUI.java	2001/11/27 18:04:52	1.3
  +++ VAJAntToolGUI.java	2001/12/15 00:29:43	1.4
  @@ -93,6 +93,7 @@
   import org.apache.tools.ant.BuildListener;
   import org.apache.tools.ant.BuildEvent;
   import org.apache.tools.ant.Project;
  +import org.apache.tools.ant.util.StringUtils;
   
   /**
    * This is a simple grafical user interface to provide the information needed
  @@ -114,7 +115,7 @@
        * Members
        */
       private VAJBuildLogger logger = new VAJBuildLogger();
  -    private String lineSeparator = "\r\n";
  +    private final static String lineSeparator = "\r\n";
       private PrivateEventHandler iEventHandler = new PrivateEventHandler();
   
       /**
  @@ -1287,9 +1288,7 @@
        */
       private void handleException(Throwable exception) {
           // Write exceptions to the log-window
  -        StringWriter sw = new StringWriter();
  -        exception.printStackTrace(new PrintWriter(sw));
  -        String trace = new String( sw.getBuffer() );
  +        String trace = StringUtils.getStackTrace(exception);
   
           getMessageTextArea().append(lineSeparator + lineSeparator + trace);
           getMessageFrame().show();
  
  
  
  1.4       +2 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJToolsServlet.java
  
  Index: VAJToolsServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJToolsServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- VAJToolsServlet.java	2001/11/27 18:04:52	1.3
  +++ VAJToolsServlet.java	2001/12/15 00:29:43	1.4
  @@ -66,6 +66,7 @@
   import javax.servlet.ServletException;
   
   import org.apache.tools.ant.BuildException;
  +import org.apache.tools.ant.util.StringUtils;
   
   /**
    * Abstract base class to provide common services for the
  @@ -145,9 +146,7 @@
           } catch( Exception e ) {
               try {
                   if ( ! (e instanceof BuildException) ) {
  -                    StringWriter sw = new StringWriter();
  -                    e.printStackTrace(new PrintWriter(sw));
  -                    String trace = new String( sw.getBuffer() );
  +                    String trace = StringUtils.getStackTrace(e);
                       util.log("Program error in " + this.getClass().getName()
                                + ":\n" + trace, VAJUtil.MSG_ERR);
                   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message