8030690: TEST_BUG java/nio/Buffer/Chars.java fails intermittently
Reviewed-by: alanb
This commit is contained in:
parent
a46e0545ea
commit
3cb52c1acc
@ -51,8 +51,8 @@ public class Chars {
|
||||
*/
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user