summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--luni/src/main/java/java/nio/ByteBuffer.java7
1 files 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<ByteBuffer
* if no changes may be made to the contents of this buffer.
*/
public ByteBuffer put(ByteBuffer src) {
- if (!src.isAccessible() || !isAccessible()) {
- throw new IllegalStateException("buffer is inaccessible");
- }
-
if (isReadOnly()) {
throw new ReadOnlyBufferException();
}
if (src == this) {
throw new IllegalArgumentException("src == this");
}
+ if (!src.isAccessible() || !isAccessible()) {
+ throw new IllegalStateException("buffer is inaccessible");
+ }
int srcByteCount = src.remaining();
if (srcByteCount > remaining()) {
throw new BufferOverflowException();