In message "java.nio.CharBuffer should implement java.lang.CharSequence"
    on 02/11/22, Ito Kazumitsu <[EMAIL PROTECTED]> writes:

> I would like the following JDK 1.4 features to be added to
> classpath.   Thank you.

Thank you for your efforts on this,  and now java.nio.CharBuffer
works almost correctly fo me.

But, unfortunately, I found a case where position(int) of
java.nio.Buffer throws IllegalArgumentException when a new
CharBufferImpl is being created.  I am using the following patch
to avoid this.

--- gnu/java/nio/CharBufferImpl.java.orig       Sun Nov 24 07:54:29 2002
+++ gnu/java/nio/CharBufferImpl.java    Sun Nov 24 11:06:57 2002
@@ -55,24 +55,24 @@
   {
     this.backing_buffer = new char[cap];
     this.cap = cap;
-    this.position(off);
     this.limit(lim);
+    this.position(off);
   }
   
   public CharBufferImpl(char[] array, int off, int lim)
   {
     this.backing_buffer = array;
     this.cap = array.length;
-    this.position(off);
     this.limit(lim);
+    this.position(off);
   }
   
   public CharBufferImpl (CharBufferImpl copy)
   {
     backing_buffer = copy.backing_buffer;
     ro = copy.ro;
-    position (copy.position ());
     limit (copy.limit());
+    position (copy.position ());
   }
   
   void inc_pos (int a)
bash-2.02$ diff -u java/nio/CharBuffer.java.orig java/nio/CharBuffer.java
--- java/nio/CharBuffer.java.orig       Sun Nov 24 07:55:45 2002
+++ java/nio/CharBuffer.java    Sun Nov 24 10:42:01 2002
@@ -61,7 +61,7 @@
   
   final public static CharBuffer wrap (char[] array, int offset, int length)
   {
-    return new CharBufferImpl (array, offset, length);
+    return new CharBufferImpl (array, offset, offset + length);
   }
 
   final public static CharBuffer wrap (char[] array)




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

Reply via email to