InputStreamSubscriber compiler issues
See gh-31677
This commit is contained in:
@@ -175,7 +175,7 @@ final class InputStreamSubscriber extends InputStream implements Subscriber<Data
|
||||
}
|
||||
catch (Throwable t) {
|
||||
this.closed = true;
|
||||
this.s.cancel();
|
||||
requiredSubscriber().cancel();
|
||||
cleanAndFinalize();
|
||||
throw Exceptions.propagate(t);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ final class InputStreamSubscriber extends InputStream implements Subscriber<Data
|
||||
return j;
|
||||
}
|
||||
} else if (bytes == CLOSED) {
|
||||
this.s.cancel();
|
||||
requiredSubscriber().cancel();
|
||||
cleanAndFinalize();
|
||||
return -1;
|
||||
}
|
||||
@@ -230,7 +230,7 @@ final class InputStreamSubscriber extends InputStream implements Subscriber<Data
|
||||
}
|
||||
catch (Throwable t) {
|
||||
this.closed = true;
|
||||
this.s.cancel();
|
||||
requiredSubscriber().cancel();
|
||||
cleanAndFinalize();
|
||||
throw Exceptions.propagate(t);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ final class InputStreamSubscriber extends InputStream implements Subscriber<Data
|
||||
this.available = t;
|
||||
if (consumed == this.limit) {
|
||||
this.consumed = 0;
|
||||
this.s.request(this.limit);
|
||||
requiredSubscriber().request(this.limit);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -315,7 +315,7 @@ final class InputStreamSubscriber extends InputStream implements Subscriber<Data
|
||||
}
|
||||
|
||||
try {
|
||||
this.s.cancel();
|
||||
requiredSubscriber().cancel();
|
||||
cleanAndFinalize();
|
||||
}
|
||||
finally {
|
||||
@@ -323,6 +323,11 @@ final class InputStreamSubscriber extends InputStream implements Subscriber<Data
|
||||
}
|
||||
}
|
||||
|
||||
private Subscription requiredSubscriber() {
|
||||
Assert.state(this.s != null, "Subscriber must be subscribed to use InputStream");
|
||||
return this.s;
|
||||
}
|
||||
|
||||
private void await() {
|
||||
Thread toUnpark = Thread.currentThread();
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.nio.channels.SeekableByteChannel;
|
||||
import java.nio.channels.WritableByteChannel;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
Reference in New Issue
Block a user