Skip to content

Commit

Permalink
GEODE-6621: ensure that getBucketOwners result is modifiable (apache#…
Browse files Browse the repository at this point in the history
…3438)

A new HashSet is now created if we got back an empty set from adviseInitialized
  • Loading branch information
dschneider-pivotal authored Apr 10, 2019
1 parent c5e52ef commit 4ad95a5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,12 @@ public ProxyBucketRegion initialize() {
@Override
public Set<InternalDistributedMember> getBucketOwners() {
Set<InternalDistributedMember> s = this.advisor.adviseInitialized();
if (s.isEmpty()) {
// getBucketOwners needs to return a modifiable set.
// adviseInitialized returns an unmodifiable set when it is empty.
s = new HashSet<>();
}
if (isHosting()) {
if (s.isEmpty()) {
s = new HashSet<>();
}
s.add(this.partitionedRegion.getDistributionManager().getId());
}
return s;
Expand Down

0 comments on commit 4ad95a5

Please sign in to comment.