eolivelli commented on a change in pull request #657: DistributionSchedule uses
int[] rather than HashSet
URL: https://github.com/apache/bookkeeper/pull/657#discussion_r147050890
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingAddOp.java
##########
@@ -92,7 +93,8 @@ PendingAddOp enableRecoveryAdd() {
void setEntryId(long entryId) {
this.entryId = entryId;
- writeSet = new
HashSet<Integer>(lh.distributionSchedule.getWriteSet(entryId));
Review comment:
If you move the allocation to the constructor w will have a write set full
of zeroes which could appear valid.
In previous code an NPE would occur in case of missed call to setentryid.
Recently I caught such kind of error while playing with ledger handleadv.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services