Repository navigation
[Spotbugs] Enable spotbugs in pulsar-metadata - #9253
Conversation
| public class GetResult { | ||
|
|
||
| public GetResult(byte[] value, Stat stat){ | ||
| this.value = value.clone(); |
There was a problem hiding this comment.
While I understand the immutability aspect, making 2 extra copies and allocations of the value array it's overkill for this scenario.
There was a problem hiding this comment.
Maybe we could make the value public to solve this problem(EI_EXPOSE_REP) and avoid copy, even though that would sacrifice immutability. What do you think?
There was a problem hiding this comment.
I'm not super convinced in making the field public. GetResult class is part of API so I'd rather keep that behind a getter method. An implementation might not store it directly as a byte[] but instead convert that on demand.
There was a problem hiding this comment.
Can we instead ignore the warning for this case?
|
/pulsarbot run-failure-checks |
2 similar comments
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
a6097eb to
7613ed1
Compare
|
/pulsarbot run-failure-checks |
4 similar comments
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
Fixes streamnative/pulsar#1797
Motivation
Enable spotbugs in module pulsar-metadata.