changeset 13507:e4cc513c7a91

8030690: TEST_BUG java/nio/Buffer/Chars.java fails intermittently Reviewed-by: alanb Contributed-by: yiming.wang@oracle.com
author alanb
date Fri, 20 Dec 2013 09:58:03 +0000
parents 2e4283de3be9
children 2f6332c1e882
files test/java/nio/Buffer/Chars.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/nio/Buffer/Chars.java	Fri Jan 17 14:03:57 2014 +0000
+++ b/test/java/nio/Buffer/Chars.java	Fri Dec 20 09:58:03 2013 +0000
@@ -51,8 +51,8 @@
      */
     static CharBuffer randomizeRange(CharBuffer cb) {
         int mid = cb.capacity() >>> 1;
-        int start = RAND.nextInt(mid);
-        int end = mid + RAND.nextInt(mid);
+        int start = RAND.nextInt(mid + 1); // from 0 to mid
+        int end = mid + RAND.nextInt(cb.capacity() - mid + 1); // from mid to capacity
         cb.position(start);
         cb.limit(end);
         return cb;