Commit dc5090e9 authored by Shubham Ajmera's avatar Shubham Ajmera
Browse files

Enable BufferTest#testAccess

The test was disabled because accessible flag was not supported by
OpenJDK buffers. The test pointed out new issues with DirectByteBuffers.

- No exception is expected with #duplicate and #asReadOnlyBuffer even
 when isAccessible flag is set to false
- IllegalStateException should be thrown before ReadOnlyException.
- ByteBufferAs*Buffer which wrapped DirectByteBuffer should also
  respect the isAccessible flag of the underlying buffer.
- There are two state - isFreed and isAccessible.
  The implementation was only depending upon the isAccessible flag.
  There is a subtle difference between the two flags, i.e.,
  isAccessible can be set and unset, however, freed is non
  reversible and can only be set by calling #free.

Bug: 35629232
Test: Run all the harmony and luni Buffer tests on vogar.
Change-Id: I265499ca06826b256ffa426814b6d7af73a378d0
parent b8806fa2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment