Skip to content

Commit cefb46d

Browse files
authored
Throw UOE from compressible bytes stream reset
A compressible bytes output stream is a stream output which supports a reset method. However, compressible bytes output streams are unusual in that the current implementation sometimes supports a reset (if the stream is not compressed) and sometimes does not support a rest (if the stream is compressed). This inconsistent behavior is puzzling and instead we should simply always throw an unsupported operation exception. Relates #27564
1 parent 37653c9 commit cefb46d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/elasticsearch/transport/CompressibleBytesOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ public void close() throws IOException {
104104

105105
@Override
106106
public void reset() throws IOException {
107-
stream.reset();
107+
throw new UnsupportedOperationException();
108108
}
109109
}

0 commit comments

Comments
 (0)