commit | 55feeeb0c6f9571166b760a76d24cb8179fbdb41 | [log] [tgz] |
---|---|---|
author | Narayan Kamath <narayan@google.com> | Thu Dec 17 15:53:35 2015 +0000 |
committer | Narayan Kamath <narayan@google.com> | Fri Dec 18 11:30:39 2015 +0000 |
tree | 91ed1d96e2229bfdea98e4ef3fb1c9a75baec227 | |
parent | 551112f15a648b739f842b2466b5fdae3e80d6de [diff] |
Consistent exception ordering in SourceChannelImpl. Always throw an NPE before ensuring the channel's option. bug: 26141154 Change-Id: I851716dac1679a3ef687c471b79249094e36da62
diff --git a/ojluni/src/main/java/sun/nio/ch/SourceChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/SourceChannelImpl.java index 284f126..99b9dda 100755 --- a/ojluni/src/main/java/sun/nio/ch/SourceChannelImpl.java +++ b/ojluni/src/main/java/sun/nio/ch/SourceChannelImpl.java
@@ -156,12 +156,10 @@ } public int read(ByteBuffer dst) throws IOException { - ensureOpen(); - // ----- BEGIN android ----- if (dst == null) { - throw new NullPointerException(); + throw new NullPointerException(); } - // ----- END android ----- + ensureOpen(); synchronized (lock) { int n = 0; try {