changeset 277:5578f6fee3c7 cacao

* patches/icedtea-bytebuffer-compact.patch: New file. * Makefile.am (ICEDTEA_PATCHES): Add above patch. * Makefile.in: Regenerated.
author Keith Seitz <keiths@redhat.com>
date Wed, 03 Oct 2007 15:44:35 -0700
parents eceb31c1c47a
children 2956bd6e839d
files ChangeLog Makefile.am patches/icedtea-bytebuffer-compact.patch
diffstat 3 files changed, 88 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 03 15:38:04 2007 -0700
+++ b/ChangeLog	Wed Oct 03 15:44:35 2007 -0700
@@ -1,3 +1,9 @@
+2007-10-03  Keith Seitz  <keiths@redhat.com>
+
+	* patches/icedtea-bytebuffer-compact.patch: New file.
+	* Makefile.am (ICEDTEA_PATCHES): Add above patch.
+	* Makefile.in: Regenerated.
+
 2007-10-03  Keith Seitz  <keiths@redhat.com>
 
 	* patches/icedtea-use-system-tzdata.patch: Use AccessController
--- a/Makefile.am	Wed Oct 03 15:38:04 2007 -0700
+++ b/Makefile.am	Wed Oct 03 15:44:35 2007 -0700
@@ -143,6 +143,7 @@
 	patches/icedtea-headers.patch \
 	patches/icedtea-ant.patch \
 	patches/icedtea-gcc-suffix.patch \
+	patches/icedtea-bytebuffer-compact.patch \
 	$(FAST_BUILD_PATCH) \
 	$(DISTRIBUTION_PATCHES)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-bytebuffer-compact.patch	Wed Oct 03 15:44:35 2007 -0700
@@ -0,0 +1,81 @@
+diff -r 317d604b4da9 j2se/src/share/classes/java/nio/Buffer.java
+--- openjdk/j2se/src/share/classes/java/nio/Buffer.java	Tue Sep 25 12:45:52 2007 -0700
++++ openjdk/j2se/src/share/classes/java/nio/Buffer.java	Tue Sep 25 12:47:10 2007 -0700
+@@ -235,7 +235,7 @@ public abstract class Buffer {
+ 	if ((newPosition > limit) || (newPosition < 0))
+ 	    throw new IllegalArgumentException();
+ 	position = newPosition;
+-	if (mark > position) mark = -1;
++	if (mark > position) clearMark();
+ 	return this;
+     }
+ 
+@@ -267,7 +267,7 @@ public abstract class Buffer {
+ 	    throw new IllegalArgumentException();
+ 	limit = newLimit;
+ 	if (position > limit) position = limit;
+-	if (mark > limit) mark = -1;
++	if (mark > limit) clearMark();
+ 	return this;
+     }
+ 
+@@ -320,7 +320,7 @@ public abstract class Buffer {
+     public final Buffer clear() {
+ 	position = 0;
+ 	limit = capacity;
+-	mark = -1;
++	clearMark();
+ 	return this;
+     }
+ 
+@@ -348,7 +348,7 @@ public abstract class Buffer {
+     public final Buffer flip() {
+ 	limit = position;
+ 	position = 0;
+-	mark = -1;
++	clearMark();
+ 	return this;
+     }
+ 
+@@ -369,7 +369,7 @@ public abstract class Buffer {
+      */
+     public final Buffer rewind() {
+ 	position = 0;
+-	mark = -1;
++	clearMark();
+ 	return this;
+     }
+ 
+@@ -543,6 +543,10 @@ public abstract class Buffer {
+ 	return mark;
+     }
+ 
++    final void clearMark() {                            // package-private
++        mark = -1;
++    }
++
+     static void checkBounds(int off, int len, int size) { // package-private
+         if ((off | len | (off + len) | (size - (off + len))) < 0)
+ 	    throw new IndexOutOfBoundsException();
+diff -r 317d604b4da9 j2se/src/share/classes/java/nio/Direct-X-Buffer.java
+--- openjdk/j2se/src/share/classes/java/nio/Direct-X-Buffer.java	Tue Sep 25 12:45:52 2007 -0700
++++ openjdk/j2se/src/share/classes/java/nio/Direct-X-Buffer.java	Tue Sep 25 12:47:10 2007 -0700
+@@ -354,6 +354,7 @@ class Direct$Type$Buffer$RW$$BO$
+  	unsafe.copyMemory(ix(pos), ix(0), rem << $LG_BYTES_PER_VALUE$);
+  	position(rem);
+ 	limit(capacity());
++	clearMark();
+ 	return this;
+ #else[rw]
+ 	throw new ReadOnlyBufferException();
+diff -r 317d604b4da9 j2se/src/share/classes/java/nio/Heap-X-Buffer.java
+--- openjdk/j2se/src/share/classes/java/nio/Heap-X-Buffer.java	Tue Sep 25 12:45:52 2007 -0700
++++ openjdk/j2se/src/share/classes/java/nio/Heap-X-Buffer.java	Tue Sep 25 12:47:10 2007 -0700
+@@ -222,6 +222,7 @@ class Heap$Type$Buffer$RW$
+ 	System.arraycopy(hb, ix(position()), hb, ix(0), remaining());
+ 	position(remaining());
+ 	limit(capacity());
++	clearMark();
+ 	return this;
+ #else[rw]
+ 	throw new ReadOnlyBufferException();