jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-taglibs/string/src/org/apache/taglibs/string/util StringW.java
Date Tue, 28 Jan 2003 23:13:47 GMT
bayard      2003/01/28 15:13:46

  Modified:    string/src/org/apache/taglibs/string/util StringW.java
  Log:
  Made a fix to bug # 15321 that stops WordWrap falling over with an ArrayOutOf
  BoundsException when a newline falls in a particular place.
  
  Revision  Changes    Path
  1.15      +8 -6      jakarta-taglibs/string/src/org/apache/taglibs/string/util/StringW.java
  
  Index: StringW.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/string/src/org/apache/taglibs/string/util/StringW.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- StringW.java	10 Sep 2002 00:39:40 -0000	1.14
  +++ StringW.java	28 Jan 2003 23:13:45 -0000	1.15
  @@ -178,9 +178,11 @@
   //                System.err.println("loop[i] is now: "+i);
   //                System.err.println("ounfd-whitespace: '"+substr.charAt(idx+1)+"'.");
                   // Erase a space after a delim. Is this too obscure?
  -                if(substr.charAt(idx+1) != '\n') {
  -                    if(Character.isWhitespace(substr.charAt(idx+1))) {
  -                        i++;
  +                if(substr.length() > idx+1) {
  +                    if(substr.charAt(idx+1) != '\n') {
  +                        if(Character.isWhitespace(substr.charAt(idx+1))) {
  +                            i++;
  +                        }
                       }
                   }
   //                System.err.println("i -= "+width+"-"+idx);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message