Consider this snippet in java/io/CharArrayWriter.java:

        public void
        write(char[] buf, int offset, int len)
        {
          synchronized (lock) {

          int i = 0;
          while (i < (len / buffer_increment_size))
            {
              enlargeBuffer();
              System.arraycopy(buf, offset + (i * buffer_increment_size), this.buf, 
                               count, buffer_increment_size);

              count += buffer_increment_size;
              ++i;
            }

          if ((len % buffer_increment_size) != 0)
            { 
  -           if ((buf.length - count) < (len % buffer_increment_size))
 +                   if ((this.buf.length - count) < (len % buffer_increment_size))
                enlargeBuffer();

              System.arraycopy(buf, offset + (i * buffer_increment_size), this.buf,
                               count, len % buffer_increment_size);

              count += (len % buffer_increment_size);
            }

          } // synchronized
        }

        Obviously "this." should be added, there're two "buf" here incidently, one 
is input argument, the other is a field of this.


_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to