Description
TestDFSIO -read -random throws IllegalArgumentException on 4GB file. The cause is:
private long nextOffset(long current) { if(skipSize == 0) return rnd.nextInt((int)(fileSize)); if(skipSize > 0) return (current < 0) ? 0 : (current + bufferSize + skipSize); // skipSize < 0 return (current < 0) ? Math.max(0, fileSize - bufferSize) : Math.max(0, current + skipSize); } }
When filesize exceeds signed int, (int)(filesize) will be negative and cause Random.nextInt throws IllegalArgumentException("n must be positive").