# HG changeset patch # User alanb # Date 1387533483 0 # Node ID 29f58b0d4f78daf7f1e85f3c34152a4884f05a89 # Parent 89a7ce7fea7d56496d88c560a74027d42cd80e3c 8030690: TEST_BUG java/nio/Buffer/Chars.java fails intermittently Reviewed-by: alanb Contributed-by: yiming.wang@oracle.com diff -r 89a7ce7fea7d -r 29f58b0d4f78 jdk/test/java/nio/Buffer/Chars.java --- a/jdk/test/java/nio/Buffer/Chars.java Thu Dec 19 22:59:21 2013 -0800 +++ b/jdk/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;