bayard      01/12/18 10:53:25

  Modified:    util/src/java/org/apache/commons/util StringUtils.java
  Log:
  Changed implementation of isLine so it doesn't try to goto the
  n+1th element of an array. Was a missing -1 in the algorithm's
  max value.
  
  Bug reported by Janek Bogucki <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.21      +2 -2      
jakarta-commons-sandbox/util/src/java/org/apache/commons/util/StringUtils.java
  
  Index: StringUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/util/src/java/org/apache/commons/util/StringUtils.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- StringUtils.java  2001/12/18 18:44:09     1.20
  +++ StringUtils.java  2001/12/18 18:53:25     1.21
  @@ -81,7 +81,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Rall</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Greg Coladonato</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Bayard</a>
  - * @version $Id: StringUtils.java,v 1.20 2001/12/18 18:44:09 bayard Exp $
  + * @version $Id: StringUtils.java,v 1.21 2001/12/18 18:53:25 bayard Exp $
    */
   public class StringUtils
   {
  @@ -1551,7 +1551,7 @@
       static public boolean isLine(String str) {
           char ch = 0;
           char[] chrs = str.toCharArray();
  -        int sz = chrs.length;
  +        int sz = chrs.length-1;
           for(int i=0; i<sz-2; i++) {
               if(!Character.isLetterOrDigit(chrs[i])) {
                   if(!Character.isWhitespace(chrs[i])) {
  
  
  

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

Reply via email to