--- a/jdk/test/java/nio/Buffer/BasicDouble.java Thu Sep 20 13:01:01 2012 -0700
+++ b/jdk/test/java/nio/Buffer/BasicDouble.java Fri Sep 21 15:39:10 2012 +0100
@@ -335,7 +335,7 @@
fail(problem + String.format(": x=%s y=%s", x, y), xb, yb);
}
- private static void tryCatch(Buffer b, Class ex, Runnable thunk) {
+ private static void tryCatch(Buffer b, Class<?> ex, Runnable thunk) {
boolean caught = false;
try {
thunk.run();
@@ -350,7 +350,7 @@
fail(ex.getName() + " not thrown", b);
}
- private static void tryCatch(double [] t, Class ex, Runnable thunk) {
+ private static void tryCatch(double [] t, Class<?> ex, Runnable thunk) {
tryCatch(DoubleBuffer.wrap(t), ex, thunk);
}
@@ -681,6 +681,14 @@
bulkPutBuffer(rb);
}});
+ // put(DoubleBuffer) should not change source position
+ final DoubleBuffer src = DoubleBuffer.allocate(1);
+ tryCatch(b, ReadOnlyBufferException.class, new Runnable() {
+ public void run() {
+ rb.put(src);
+ }});
+ ck(src, src.position(), 0);
+
tryCatch(b, ReadOnlyBufferException.class, new Runnable() {
public void run() {
rb.compact();
@@ -744,6 +752,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
if (rb.getClass().getName().startsWith("java.nio.Heap")) {
tryCatch(b, ReadOnlyBufferException.class, new Runnable() {