# HG changeset patch # User amlu # Date 1542853847 -28800 # Node ID 148124c951fd104d75eb0a80d8e8364ea83c446c # Parent 05e830a833f75d4cff5676a8f92de665c831b4e0 8211266: [TESTBUG] ZipFSTester.java failed intermittently in ZipFSTester.checkRead(): bound must be positive Reviewed-by: lancea diff -r 05e830a833f7 -r 148124c951fd test/jdk/jdk/nio/zipfs/ZipFSTester.java --- a/test/jdk/jdk/nio/zipfs/ZipFSTester.java Thu Nov 22 02:32:36 2018 +0100 +++ b/test/jdk/jdk/nio/zipfs/ZipFSTester.java Thu Nov 22 10:30:47 2018 +0800 @@ -484,8 +484,12 @@ byte[] buf = new byte[1024]; ByteBuffer bb = ByteBuffer.wrap(buf); for (int i = 0; i < 10; i++) { - int pos = rdm.nextInt((int)sbc.size()); - int len = rdm.nextInt(Math.min(buf.length, expected.length - pos)); + int pos = 0; + int len = 0; + if (expected.length > 0) { + pos = rdm.nextInt((int) sbc.size()); + len = rdm.nextInt(Math.min(buf.length, expected.length - pos)); + } // System.out.printf(" --> %d, %d%n", pos, len); bb.position(0).limit(len); // bb.flip().limit(len); if (sbc.position(pos).position() != pos ||