commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject cvs commit: jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/builder SqlBuilder.java
Date Sat, 16 Oct 2004 10:30:33 GMT
tomdz       2004/10/16 03:30:33

  Modified:    sql/src/java/org/apache/commons/sql/builder SqlBuilder.java
  Log:
  Fixed bug 31307 (StringIndexOutOfBoundsException in SqlBuilder.shortenName when desiredLength
<= name.length()/2)
  
  Revision  Changes    Path
  1.26      +2 -2      jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/builder/SqlBuilder.java
  
  Index: SqlBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/builder/SqlBuilder.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- SqlBuilder.java	16 Oct 2004 10:16:33 -0000	1.25
  +++ SqlBuilder.java	16 Oct 2004 10:30:33 -0000	1.26
  @@ -1080,13 +1080,13 @@
           // TODO: Find an algorithm that generates unique names
           int originalLength = name.length();
   
  -        if ((desiredLength < 0) || (originalLength <= desiredLength))
  +        if ((desiredLength <= 0) || (originalLength <= desiredLength))
           {
               return name;
           }
   
           int delta    = originalLength - desiredLength;
  -        int startCut = originalLength / 2;
  +        int startCut = desiredLength / 2;
   
           StringBuffer result = new StringBuffer();
   
  
  
  

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


Mime
View raw message