From b327df0b7d83f079856304830ff4da92b4a5ea1f Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Wed, 21 May 2014 17:31:32 +0100 Subject: Change exception priority for ByteBuffer.put(null) Commit 7e02765b7ada4e85f941f0a6b0fc60a8a76301f3 made ByteBuffer.put(null) throw a NullPointerException if the ByteBuffer was read only. Previously it would throw a ReadOnlyBufferException. The priority of exceptions is unclear, but this returns the behavior to what it was before and fixes 3 CTS tests: ReadOnlyWrappedByteBufferTest.testPutByteBuffer ReadOnlyHeapByteBufferTest.testPutByteBuffer ReadOnlyDirectByteBufferTest.testPutByteBuffer Change-Id: I90dd4b6969a4f31a26651d7b35758f899cc020b4 --- luni/src/main/java/java/nio/ByteBuffer.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/luni/src/main/java/java/nio/ByteBuffer.java b/luni/src/main/java/java/nio/ByteBuffer.java index 4c0f4a6..31bf481 100644 --- a/luni/src/main/java/java/nio/ByteBuffer.java +++ b/luni/src/main/java/java/nio/ByteBuffer.java @@ -766,16 +766,15 @@ public abstract class ByteBuffer extends Buffer implements Comparable remaining()) { throw new BufferOverflowException(); -- cgit v1.1