donaldp     2002/09/26 05:52:40

  Modified:    event/src/java/org/apache/excalibur/util SystemUtil.java
  Removed:     event/src/java/org/apache/excalibur/util StringUtil.java
               event/src/test/org/apache/excalibur/util/test
                        StringUtilTestCase.java
  Log:
  Remove StringUtil from event.
  
  Revision  Changes    Path
  1.2       +26 -2     
jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/util/SystemUtil.java
  
  Index: SystemUtil.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/util/SystemUtil.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SystemUtil.java   25 Sep 2002 14:52:28 -0000      1.1
  +++ SystemUtil.java   26 Sep 2002 12:52:40 -0000      1.2
  @@ -36,7 +36,7 @@
           try
           {
               String name = "org.apache.excalibur.util.system." +
  -                StringUtil.stripWhitespace( m_osName );
  +                stripWhitespace( m_osName );
               Class klass = Class.forName( name );
               CPUParser parser = (CPUParser)klass.newInstance();
   
  @@ -57,6 +57,30 @@
   
           m_processors = procs;
           m_cpuInfo = info;
  +    }
  +
  +    /**
  +     * Utility method to strip whitespace from specified name.
  +     *
  +     * @param mosname the name
  +     * @return the whitespace stripped version
  +     */
  +    private static String stripWhitespace( String mosname )
  +    {
  +        final StringBuffer sb = new StringBuffer();
  +
  +        final int size = mosname.length();
  +        for( int i =0; i < size; i++ )
  +        {
  +            final char ch = mosname.charAt( i );
  +            if( ch != '\t' && ch != '\r' &&
  +                ch != '\n' && ch != '\b' )
  +            {
  +                sb.append( ch );
  +            }
  +        }
  +
  +        return sb.toString();
       }
   
       /** keep utility from being instantiated */
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to