-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FilterOutputStreamSlowMultibyteWrite #2024
Add FilterOutputStreamSlowMultibyteWrite #2024
Conversation
If a subclass of FilterOutputStream implements `void write(int)`, they should also override `void write(byte[], int, int)`, otherwise the performance of the stream is likely to be slow. See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/FilterOutputStream.html#write(byte%5B%5D,int,int) > Subclasses of FilterOutputStream should provide a more efficient implementation of this method. Similar in concept to https://errorprone.info/bugpattern/InputStreamSlowMultibyteRead
Generate changelog in
|
...eline-java/src/main/groovy/com/palantir/baseline/extensions/BaselineErrorProneExtension.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise lgtm, thanks! Feel free to re-add merge-when-ready after fixing the BaselineErrorProneExtension.
…ensions/BaselineErrorProneExtension.java Co-authored-by: Carter Kozak <ckozak@ckozak.net>
Released 4.54.0 |
###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. # Release Notes ## 4.54.0 | Type | Description | Link | | ---- | ----------- | ---- | | Improvement | If a subclass of FilterOutputStream implements `void write(int)`, they<br>should also override `void write(byte[], int, int)`, otherwise the<br>performance of the stream is likely to be slow.<br><br>See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/FilterOutputStream.html#write(byte%5B%5D,int,int)<br>> Subclasses of FilterOutputStream should provide a more efficient implementation of this method.<br><br>Similar in concept to https://errorprone.info/bugpattern/InputStreamSlowMultibyteRead | palantir/gradle-baseline#2024 | To enable or disable this check, please contact the maintainers of Excavator.
Before this PR
Subtypes of
FilterOutputStream
that do not implementwrite(byte[], int, int)
would be inefficient and fall back to single byte writes.After this PR
==COMMIT_MSG==
If a subclass of FilterOutputStream implements
void write(int)
, theyshould also override
void write(byte[], int, int)
, otherwise theperformance of the stream is likely to be slow.
See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/FilterOutputStream.html#write(byte%5B%5D,int,int)
Similar in concept to https://errorprone.info/bugpattern/InputStreamSlowMultibyteRead
==COMMIT_MSG==
An example of this being fixed: palantir/hadoop-crypto#42
Possible downsides?