garyp       01/03/07 00:06:08

  Modified:    java/src/org/apache/xml/utils FastStringBuffer.java
  Log:
  Correct operation when length of content to be appended is zero.
  
  Revision  Changes    Path
  1.6       +8 -0      
xml-xalan/java/src/org/apache/xml/utils/FastStringBuffer.java
  
  Index: FastStringBuffer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/utils/FastStringBuffer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FastStringBuffer.java     2001/03/05 19:54:58     1.5
  +++ FastStringBuffer.java     2001/03/07 08:06:05     1.6
  @@ -356,6 +356,8 @@
     public final void append(String value)
     {
       int strlen=value.length();
  +    if (0 == strlen)
  +      return;
       int copyfrom=0;
       char[] chunk=m_array[m_lastChunk];
       int available=m_lastChunkSize-m_firstFree;
  @@ -432,6 +434,8 @@
     public final void append(StringBuffer value)
     {
       int strlen=value.length();
  +    if (0 == strlen)
  +      return;
       int copyfrom=0;
       char[] chunk=m_array[m_lastChunk];
       int available=m_lastChunkSize-m_firstFree;
  @@ -511,6 +515,8 @@
     public final void append(char[] chars, int start, int length)
     {
       int strlen=length;
  +    if (0 == strlen)
  +      return;
       int copyfrom=start;
       char[] chunk=m_array[m_lastChunk];
       int available=m_lastChunkSize-m_firstFree;
  @@ -592,6 +598,8 @@
       // probably on a different alignment due to previously appended
       // data. We have to work through the source in bite-sized chunks.
       int strlen=value.length();
  +    if (0 == strlen)
  +      return;
       int copyfrom=0;
       char[] chunk=m_array[m_lastChunk];
       int available=m_lastChunkSize-m_firstFree;
  
  
  

Reply via email to