mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-10 15:08:43 +00:00
remove duplicate code in current()
This commit is contained in:
parent
52230a4858
commit
4ffa3e48c6
@ -301,27 +301,16 @@ final class Http3ServerStreamImpl {
|
||||
ByteBuffer current;
|
||||
|
||||
ByteBuffer current() throws IOException {
|
||||
Object reason = closeReason.get();
|
||||
if (reason != null) {
|
||||
if (reason == Boolean.TRUE) {
|
||||
throw new IOException("Stream is closed");
|
||||
} else {
|
||||
throw new IOException((IOException)reason);
|
||||
}
|
||||
}
|
||||
while (true) {
|
||||
if (current != null && current.hasRemaining()) {
|
||||
return current;
|
||||
}
|
||||
if (current == QuicStreamReader.EOF) {
|
||||
reason = closeReason.get();
|
||||
if (reason != null) {
|
||||
if (reason == Boolean.TRUE) {
|
||||
throw new IOException("Stream is closed");
|
||||
} else {
|
||||
throw new IOException((IOException)reason);
|
||||
}
|
||||
Object reason = closeReason.get();
|
||||
if (reason != null) {
|
||||
if (reason == Boolean.TRUE) {
|
||||
throw new IOException("Stream is closed");
|
||||
} else {
|
||||
throw new IOException((IOException)reason);
|
||||
}
|
||||
}
|
||||
if (current != null && (current.hasRemaining() || current == QuicStreamReader.EOF)) {
|
||||
return current;
|
||||
}
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user