ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util DOMElementWriter.java
Date Sun, 30 Dec 2001 09:25:51 GMT
donaldp     01/12/30 01:25:51

  Modified:    proposal/myrmidon/src/java/org/apache/antlib/cvslib
                        CVSPass.java
               proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec
                        Environment.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        AntStructure.java Available.java Replace.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers
                        DefaultCompilerAdapter.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec
                        ExecTask.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
                        Javah.java ManifestFile.java NetRexxC.java
                        PropertyFile.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers
                        DefaultCompilerAdapter.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
                        BriefJUnitResultFormatter.java
                        PlainJUnitResultFormatter.java
                        SummaryJUnitResultFormatter.java
               proposal/myrmidon/src/main/org/apache/tools/ant/util
                        DOMElementWriter.java
  Log:
  Replace all different occurences of grabbing line separator with StringUtil.LINE_SEPARATOR
  
  Revision  Changes    Path
  1.5       +3 -7      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/cvslib/CVSPass.java
  
  Index: CVSPass.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/cvslib/CVSPass.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CVSPass.java	23 Dec 2001 06:24:52 -0000	1.4
  +++ CVSPass.java	30 Dec 2001 09:25:50 -0000	1.5
  @@ -15,22 +15,18 @@
   import java.io.PrintWriter;
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
    * CVSLogin Adds an new entry to a CVS password file
    *
    * @author <a href="jeff@custommonkey.org">Jeff Martin</a>
  - * @version $Revision: 1.4 $ $Date: 2001/12/23 06:24:52 $
  + * @version $Revision: 1.5 $ $Date: 2001/12/30 09:25:50 $
    */
   public class CVSPass
       extends AbstractTask
   {
       /**
  -     * End of line character
  -     */
  -    private static final String EOL = System.getProperty( "line.separator" );
  -
  -    /**
        * CVS Root
        */
       private String m_cvsRoot;
  @@ -141,7 +137,7 @@
                   {
                       if( !line.startsWith( m_cvsRoot ) )
                       {
  -                        sb.append( line + EOL );
  +                        sb.append( line + StringUtil.LINE_SEPARATOR );
                       }
                   }
   
  
  
  
  1.5       +4 -5      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/Environment.java
  
  Index: Environment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/Environment.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Environment.java	30 Dec 2001 06:47:13 -0000	1.4
  +++ Environment.java	30 Dec 2001 09:25:50 -0000	1.5
  @@ -18,6 +18,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.Os;
   import org.apache.tools.ant.taskdefs.exec.Execute;
  +import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
    * This is the class that can be used to retrieve the environment
  @@ -25,12 +26,10 @@
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    * @author <a href="mailto:thomas.haas@softwired-inc.com">Thomas Haas</a>
  - * @version $Revision: 1.4 $ $Date: 2001/12/30 06:47:13 $
  + * @version $Revision: 1.5 $ $Date: 2001/12/30 09:25:50 $
    */
   public final class Environment
   {
  -    private static final String LINE_SEP = System.getProperty( "line.separator" );
  -
       private static final String[] COMMAND_COM = new String[]{"command.com", "/c", "set"};
       private static final String[] CMD_EXE = new String[]{"cmd", "/c", "set"};
   
  @@ -134,11 +133,11 @@
                   // contain embedded new lines).
                   if( var == null )
                   {
  -                    var = LINE_SEP + line;
  +                    var = StringUtil.LINE_SEPARATOR + line;
                   }
                   else
                   {
  -                    var += LINE_SEP + line;
  +                    var += StringUtil.LINE_SEPARATOR + line;
                   }
               }
               else
  
  
  
  1.9       +4 -4      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/AntStructure.java
  
  Index: AntStructure.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/AntStructure.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AntStructure.java	23 Dec 2001 06:33:35 -0000	1.8
  +++ AntStructure.java	30 Dec 2001 09:25:50 -0000	1.9
  @@ -18,18 +18,18 @@
   import java.util.Hashtable;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Task;
  +import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
    * Creates a partial DTD for Ant from the currently known tasks.
    *
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   
  -public class AntStructure extends Task
  +public class AntStructure
  +    extends Task
   {
  -    private final String lSep = System.getProperty( "line.separator" );
  -
       private final String BOOLEAN = "%boolean;";
       private final String TASKS = "%tasks;";
       private final String TYPES = "%types;";
  
  
  
  1.13      +0 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java
  
  Index: Available.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Available.java	30 Dec 2001 03:33:58 -0000	1.12
  +++ Available.java	30 Dec 2001 09:25:50 -0000	1.13
  @@ -172,7 +172,6 @@
   
           if( eval() )
           {
  -            String lSep = System.getProperty( "line.separator" );
               if( null == getProject().getProperty( m_property ) )
               {
                   setProperty( m_property, m_value );
  
  
  
  1.11      +3 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Replace.java
  
  Index: Replace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Replace.java	30 Dec 2001 00:38:44 -0000	1.10
  +++ Replace.java	30 Dec 2001 09:25:50 -0000	1.11
  @@ -24,6 +24,7 @@
   import java.util.Properties;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
  +import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
    * Replaces all occurrences of one or more string tokens with given values in
  @@ -344,9 +345,8 @@
                   // line separators in values and tokens are "\n"
                   // in order to compare with the file contents, replace them
                   // as needed
  -                String linesep = System.getProperty( "line.separator" );
  -                String val = stringReplace( value.getText(), "\n", linesep );
  -                String tok = stringReplace( token.getText(), "\n", linesep );
  +                final String val = stringReplace( value.getText(), "\n", StringUtil.LINE_SEPARATOR
);
  +                final String tok = stringReplace( token.getText(), "\n", StringUtil.LINE_SEPARATOR
);
   
                   // for each found token, replace with value
                   getLogger().debug( "Replacing in " + src.getPath() + ": " + token.getText()
+ " --> " + value.getText() );
  
  
  
  1.20      +3 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultCompilerAdapter.java	30 Dec 2001 06:35:32 -0000	1.19
  +++ DefaultCompilerAdapter.java	30 Dec 2001 09:25:51 -0000	1.20
  @@ -12,6 +12,7 @@
   import java.io.IOException;
   import java.io.PrintWriter;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.excalibur.util.StringUtil;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.Javac;
  @@ -34,7 +35,6 @@
       extends AbstractLogEnabled
       implements CompilerAdapter
   {
  -    protected static String LINE_SEP = System.getProperty( "line.separator" );
       protected boolean m_debug;
       protected boolean m_optimize;
       protected boolean m_deprecation;
  @@ -429,13 +429,13 @@
           }
           niceSourceList.append( " to be compiled:" );
   
  -        niceSourceList.append( LINE_SEP );
  +        niceSourceList.append( StringUtil.LINE_SEPARATOR );
   
           for( int i = 0; i < m_compileList.length; i++ )
           {
               String arg = m_compileList[ i ].getAbsolutePath();
               cmd.createArgument().setValue( arg );
  -            niceSourceList.append( "    " + arg + LINE_SEP );
  +            niceSourceList.append( "    " + arg + StringUtil.LINE_SEPARATOR );
           }
   
           getLogger().debug( niceSourceList.toString() );
  
  
  
  1.13      +4 -4      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ExecTask.java
  
  Index: ExecTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/ExecTask.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ExecTask.java	30 Dec 2001 00:02:36 -0000	1.12
  +++ ExecTask.java	30 Dec 2001 09:25:51 -0000	1.13
  @@ -23,6 +23,7 @@
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.EnvironmentData;
   import org.apache.tools.ant.types.EnvironmentVariable;
  +import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
    * Executes a given command if the os platform is appropriate.
  @@ -33,10 +34,9 @@
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    * @author <a href="mailto:mariusz@rakiura.org">Mariusz Nowostawski</a>
    */
  -public class ExecTask extends Task
  +public class ExecTask
  +    extends Task
   {
  -    private static String LINE_SEP = System.getProperty( "line.separator" );
  -
       private boolean m_newEnvironment;
       private Integer m_timeout;
       private EnvironmentData m_env = new EnvironmentData();
  @@ -241,7 +241,7 @@
           {
               if( val.length() != 0 )
               {
  -                val.append( LINE_SEP );
  +                val.append( StringUtil.LINE_SEPARATOR );
               }
               val.append( line );
           }
  
  
  
  1.14      +4 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
  
  Index: Javah.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Javah.java	30 Dec 2001 06:14:21 -0000	1.13
  +++ Javah.java	30 Dec 2001 09:25:51 -0000	1.14
  @@ -18,6 +18,7 @@
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.Reference;
  +import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
    * Task to generate JNI header files using javah. This task can take the
  @@ -57,8 +58,6 @@
   {
   
       private final static String FAIL_MSG = "Compile failed, messages should have been provided.";
  -    //private Path extdirs;
  -    private static String lSep = System.getProperty( "line.separator" );
   
       private ArrayList classes = new ArrayList( 2 );
       private Path classpath = null;
  @@ -300,7 +299,7 @@
               {
                   String aClass = tok.nextToken().trim();
                   cmd.createArgument().setValue( aClass );
  -                niceClassList.append( "    " + aClass + lSep );
  +                niceClassList.append( "    " + aClass + StringUtil.LINE_SEPARATOR );
                   n++;
               }
           }
  @@ -311,7 +310,7 @@
               ClassArgument arg = (ClassArgument)enum.next();
               String aClass = arg.getName();
               cmd.createArgument().setValue( aClass );
  -            niceClassList.append( "    " + aClass + lSep );
  +            niceClassList.append( "    " + aClass + StringUtil.LINE_SEPARATOR );
               n++;
           }
   
  @@ -321,7 +320,7 @@
               prefix.append( "es" );
           }
           prefix.append( " to be compiled:" );
  -        prefix.append( lSep );
  +        prefix.append( StringUtil.LINE_SEPARATOR );
   
           getLogger().debug( prefix.toString() + niceClassList.toString() );
       }
  
  
  
  1.8       +7 -9      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ManifestFile.java
  
  Index: ManifestFile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ManifestFile.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ManifestFile.java	23 Dec 2001 06:31:14 -0000	1.7
  +++ ManifestFile.java	30 Dec 2001 09:25:51 -0000	1.8
  @@ -17,6 +17,7 @@
   import java.util.Iterator;
   import java.util.ListIterator;
   import java.util.StringTokenizer;
  +import org.apache.avalon.excalibur.util.StringUtil;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Task;
   
  @@ -29,12 +30,9 @@
    *     </manifest> </target> </pre>
    *
    * @author Thomas Kerle
  - * @version 1.0 2001-10-11
    */
   public class ManifestFile extends Task
   {
  -
  -    private final static String newLine = System.getProperty( "line.separator" );
       private final static String keyValueSeparator = ":";
       private final static String UPDATE_ = "update";
       private final static String REPLACEALL_ = "replaceAll";
  @@ -101,7 +99,7 @@
       private StringTokenizer getLineTokens( StringBuffer buffer )
       {
           String manifests = buffer.toString();
  -        StringTokenizer strTokens = new StringTokenizer( manifests, newLine );
  +        StringTokenizer strTokens = new StringTokenizer( manifests, StringUtil.LINE_SEPARATOR
);
           return strTokens;
       }
   
  @@ -137,7 +135,7 @@
               String value = (String)entry.getValue();
               String entry_string = key + keyValueSeparator + value;
   
  -            buffer.append( entry_string + this.newLine );
  +            buffer.append( entry_string + StringUtil.LINE_SEPARATOR );
           }
   
           return buffer;
  @@ -208,9 +206,9 @@
                       }
                       fis.close();
                       StringTokenizer lineTokens = getLineTokens( buffer );
  -                    while( lineTokens.hasNext() )
  +                    while( lineTokens.hasMoreElements() )
                       {
  -                        String currentLine = (String)lineTokens.next();
  +                        String currentLine = (String)lineTokens.nextElement();
                           addLine( currentLine );
                       }
                   }
  @@ -351,8 +349,8 @@
           private void split()
           {
               StringTokenizer st = new StringTokenizer( value, ManifestFile.keyValueSeparator
);
  -            key = (String)st.next();
  -            val = (String)st.next();
  +            key = (String)st.nextElement();
  +            val = (String)st.nextElement();
           }
   
       }
  
  
  
  1.11      +3 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java
  
  Index: NetRexxC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- NetRexxC.java	29 Dec 2001 23:59:37 -0000	1.10
  +++ NetRexxC.java	30 Dec 2001 09:25:51 -0000	1.11
  @@ -18,6 +18,7 @@
   import java.util.StringTokenizer;
   import netrexx.lang.Rexx;
   import org.apache.avalon.excalibur.io.FileUtil;
  +import org.apache.avalon.excalibur.util.StringUtil;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.taskdefs.MatchingTask;
  @@ -675,14 +676,13 @@
           }
           getLogger().debug( compileOptions.toString() );
   
  -        String eol = System.getProperty( "line.separator" );
  -        StringBuffer niceSourceList = new StringBuffer( "Files to be compiled:" + eol );
  +        StringBuffer niceSourceList = new StringBuffer( "Files to be compiled:" + StringUtil.LINE_SEPARATOR
);
   
           for( int i = 0; i < compileList.size(); i++ )
           {
               niceSourceList.append( "    " );
               niceSourceList.append( compileList.get( i ).toString() );
  -            niceSourceList.append( eol );
  +            niceSourceList.append( StringUtil.LINE_SEPARATOR );
           }
   
           getLogger().debug( niceSourceList.toString() );
  
  
  
  1.8       +3 -14     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
  
  Index: PropertyFile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PropertyFile.java	23 Dec 2001 06:31:14 -0000	1.7
  +++ PropertyFile.java	30 Dec 2001 09:25:51 -0000	1.8
  @@ -29,6 +29,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.EnumeratedAttribute;
  +import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
    * PropertyFile task uses java.util.Properties to modify integer, String and
  @@ -128,23 +129,11 @@
    * @author Jeremy Mawson <a href="mailto:jem@loftinspace.com.au">
    *      jem@loftinspace.com.au</a>
    */
  -public class PropertyFile extends Task
  +public class PropertyFile
  +    extends Task
   {
  -
  -    /*
  -     * ========================================================================
  -     *
  -     * Static variables.
  -     */
  -    private final static String NEWLINE = System.getProperty( "line.separator" );
  -
       private ArrayList entries = new ArrayList();
   
  -    /*
  -     * ========================================================================
  -     *
  -     * Instance variables.
  -     */
       // Use this to prepend a message to the properties file
       private String m_comment;
   
  
  
  
  1.7       +7 -13     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultCompilerAdapter.java	23 Dec 2001 14:22:46 -0000	1.6
  +++ DefaultCompilerAdapter.java	30 Dec 2001 09:25:51 -0000	1.7
  @@ -10,6 +10,7 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.excalibur.util.StringUtil;
   import org.apache.tools.ant.taskdefs.optional.jsp.JspC;
   import org.apache.tools.ant.types.Commandline;
   
  @@ -23,23 +24,16 @@
       extends AbstractLogEnabled
       implements CompilerAdapter
   {
  -    /*
  -     * ------------------------------------------------------------
  -     */
  -    private static String lSep = System.getProperty( "line.separator" );
  -    /*
  -     * ------------------------------------------------------------
  -     */
  -    protected JspC attributes;
  +    private JspC m_attributes;
   
  -    public void setJspc( JspC attributes )
  +    public void setJspc( final JspC attributes )
       {
  -        this.attributes = attributes;
  +        this.m_attributes = attributes;
       }
   
       public JspC getJspc()
       {
  -        return attributes;
  +        return m_attributes;
       }
   
       /*
  @@ -66,14 +60,14 @@
           }
           niceSourceList.append( " to be compiled:" );
   
  -        niceSourceList.append( lSep );
  +        niceSourceList.append( StringUtil.LINE_SEPARATOR );
   
           Iterator enum = compileList.iterator();
           while( enum.hasNext() )
           {
               String arg = (String)enum.next();
               cmd.createArgument().setValue( arg );
  -            niceSourceList.append( "    " + arg + lSep );
  +            niceSourceList.append( "    " + arg + StringUtil.LINE_SEPARATOR );
           }
   
           getLogger().debug( niceSourceList.toString() );
  
  
  
  1.4       +9 -9      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/BriefJUnitResultFormatter.java
  
  Index: BriefJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/BriefJUnitResultFormatter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BriefJUnitResultFormatter.java	23 Dec 2001 06:31:58 -0000	1.3
  +++ BriefJUnitResultFormatter.java	30 Dec 2001 09:25:51 -0000	1.4
  @@ -10,6 +10,7 @@
   import junit.framework.AssertionFailedError;
   import junit.framework.Test;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
    * Prints plain text output of the test to a specified Writer. Inspired by the
  @@ -139,10 +140,9 @@
       public void endTestSuite( JUnitTest suite )
           throws TaskException
       {
  -        String newLine = System.getProperty( "line.separator" );
  -        StringBuffer sb = new StringBuffer( "Testsuite: " );
  +        final StringBuffer sb = new StringBuffer( "Testsuite: " );
           sb.append( suite.getName() );
  -        sb.append( newLine );
  +        sb.append( StringUtil.LINE_SEPARATOR );
           sb.append( "Tests run: " );
           sb.append( suite.runCount() );
           sb.append( ", Failures: " );
  @@ -152,26 +152,26 @@
           sb.append( ", Time elapsed: " );
           sb.append( m_numberFormat.format( suite.getRunTime() / 1000.0 ) );
           sb.append( " sec" );
  -        sb.append( newLine );
  -        sb.append( newLine );
  +        sb.append( StringUtil.LINE_SEPARATOR );
  +        sb.append( StringUtil.LINE_SEPARATOR );
   
           // append the err and output streams to the log
           if( systemOutput != null && systemOutput.length() > 0 )
           {
               sb.append( "------------- Standard Output ---------------" )
  -                .append( newLine )
  +                .append( StringUtil.LINE_SEPARATOR )
                   .append( systemOutput )
                   .append( "------------- ---------------- ---------------" )
  -                .append( newLine );
  +                .append( StringUtil.LINE_SEPARATOR );
           }
   
           if( systemError != null && systemError.length() > 0 )
           {
               sb.append( "------------- Standard Error -----------------" )
  -                .append( newLine )
  +                .append( StringUtil.LINE_SEPARATOR )
                   .append( systemError )
                   .append( "------------- ---------------- ---------------" )
  -                .append( newLine );
  +                .append( StringUtil.LINE_SEPARATOR );
           }
   
           if( output() != null )
  
  
  
  1.4       +8 -11     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java
  
  Index: PlainJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PlainJUnitResultFormatter.java	23 Dec 2001 06:31:58 -0000	1.3
  +++ PlainJUnitResultFormatter.java	30 Dec 2001 09:25:51 -0000	1.4
  @@ -16,6 +16,7 @@
   import junit.framework.AssertionFailedError;
   import junit.framework.Test;
   import junit.framework.TestCase;
  +import org.apache.avalon.excalibur.util.StringUtil;
   import org.apache.myrmidon.api.TaskException;
   
   /**
  @@ -142,17 +143,13 @@
   
       /**
        * The whole testsuite ended.
  -     *
  -     * @param suite Description of Parameter
  -     * @exception TaskException Description of Exception
        */
       public void endTestSuite( JUnitTest suite )
           throws TaskException
       {
  -        String newLine = System.getProperty( "line.separator" );
           StringBuffer sb = new StringBuffer( "Testsuite: " );
           sb.append( suite.getName() );
  -        sb.append( newLine );
  +        sb.append( StringUtil.LINE_SEPARATOR );
           sb.append( "Tests run: " );
           sb.append( suite.runCount() );
           sb.append( ", Failures: " );
  @@ -162,28 +159,28 @@
           sb.append( ", Time elapsed: " );
           sb.append( nf.format( suite.getRunTime() / 1000.0 ) );
           sb.append( " sec" );
  -        sb.append( newLine );
  +        sb.append( StringUtil.LINE_SEPARATOR );
   
           // append the err and output streams to the log
           if( systemOutput != null && systemOutput.length() > 0 )
           {
               sb.append( "------------- Standard Output ---------------" )
  -                .append( newLine )
  +                .append( StringUtil.LINE_SEPARATOR )
                   .append( systemOutput )
                   .append( "------------- ---------------- ---------------" )
  -                .append( newLine );
  +                .append( StringUtil.LINE_SEPARATOR );
           }
   
           if( systemError != null && systemError.length() > 0 )
           {
               sb.append( "------------- Standard Error -----------------" )
  -                .append( newLine )
  +                .append( StringUtil.LINE_SEPARATOR )
                   .append( systemError )
                   .append( "------------- ---------------- ---------------" )
  -                .append( newLine );
  +                .append( StringUtil.LINE_SEPARATOR );
           }
   
  -        sb.append( newLine );
  +        sb.append( StringUtil.LINE_SEPARATOR );
   
           if( out != null )
           {
  
  
  
  1.4       +6 -6      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java
  
  Index: SummaryJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SummaryJUnitResultFormatter.java	23 Dec 2001 06:31:58 -0000	1.3
  +++ SummaryJUnitResultFormatter.java	30 Dec 2001 09:25:51 -0000	1.4
  @@ -13,6 +13,7 @@
   import junit.framework.AssertionFailedError;
   import junit.framework.Test;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.avalon.excalibur.util.StringUtil;
   
   /**
    * Prints short summary output of the test to Ant's logging system.
  @@ -119,7 +120,6 @@
       public void endTestSuite( JUnitTest suite )
           throws TaskException
       {
  -        String newLine = System.getProperty( "line.separator" );
           StringBuffer sb = new StringBuffer( "Tests run: " );
           sb.append( suite.runCount() );
           sb.append( ", Failures: " );
  @@ -129,20 +129,20 @@
           sb.append( ", Time elapsed: " );
           sb.append( nf.format( suite.getRunTime() / 1000.0 ) );
           sb.append( " sec" );
  -        sb.append( newLine );
  +        sb.append( StringUtil.LINE_SEPARATOR );
   
           if( withOutAndErr )
           {
               if( systemOutput != null && systemOutput.length() > 0 )
               {
  -                sb.append( "Output:" ).append( newLine ).append( systemOutput )
  -                    .append( newLine );
  +                sb.append( "Output:" ).append( StringUtil.LINE_SEPARATOR ).append( systemOutput
)
  +                    .append( StringUtil.LINE_SEPARATOR );
               }
   
               if( systemError != null && systemError.length() > 0 )
               {
  -                sb.append( "Error: " ).append( newLine ).append( systemError )
  -                    .append( newLine );
  +                sb.append( "Error: " ).append( StringUtil.LINE_SEPARATOR ).append( systemError
)
  +                    .append( StringUtil.LINE_SEPARATOR );
               }
           }
   
  
  
  
  1.4       +3 -4      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/DOMElementWriter.java
  
  Index: DOMElementWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/util/DOMElementWriter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DOMElementWriter.java	23 Dec 2001 06:32:30 -0000	1.3
  +++ DOMElementWriter.java	30 Dec 2001 09:25:51 -0000	1.4
  @@ -9,6 +9,7 @@
   
   import java.io.IOException;
   import java.io.Writer;
  +import org.apache.avalon.excalibur.util.StringUtil;
   import org.w3c.dom.Attr;
   import org.w3c.dom.Element;
   import org.w3c.dom.NamedNodeMap;
  @@ -29,8 +30,6 @@
    */
   public class DOMElementWriter
   {
  -
  -    private static String lSep = System.getProperty( "line.separator" );
       private StringBuffer sb = new StringBuffer();
   
       /**
  @@ -187,7 +186,7 @@
                   case Node.ELEMENT_NODE:
                       if( !hasChildren )
                       {
  -                        out.write( lSep );
  +                        out.write( StringUtil.LINE_SEPARATOR );
                           hasChildren = true;
                       }
                       write( (Element)child, out, indent + 1, indentWith );
  @@ -234,7 +233,7 @@
           out.write( "</" );
           out.write( element.getTagName() );
           out.write( ">" );
  -        out.write( lSep );
  +        out.write( StringUtil.LINE_SEPARATOR );
           out.flush();
       }
   }
  
  
  

--
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