Skip to content

Commit

Permalink
Bug/issue 631 (#632)
Browse files Browse the repository at this point in the history
* Android: create copy of items that will be removed. Fix ConcurrentModificationException. [#631]

* Update CHANGELOG.md
  • Loading branch information
dobromirdobrev committed May 7, 2021
1 parent 8c44b48 commit ffbb951
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed test result explanation disclaimers [#626](https://github.com/rokwire/safer-illinois-app/issues/626)
- Android: Fix crash in exposures - removeExpiredTime [#629](https://github.com/rokwire/safer-illinois-app/issues/629).
- Added Japanese language translation provided by @kamya-k
- Android: Fix crash in exposures - processExposures [#631](https://github.com/rokwire/safer-illinois-app/issues/631).

## [2.10.22] - 2021-04-27
### Fixed
Expand Down
Expand Up @@ -515,7 +515,9 @@ private void processExposures() {
}

if ((expiredPeripheralAddress != null) && !expiredPeripheralAddress.isEmpty()) {
for (String address : expiredPeripheralAddress) {
// Create copy so that to prevent crash with ConcurrentModificationException.
Set<String> expiredPeripheralAddressCopy = new HashSet<>(expiredPeripheralAddress);
for (String address : expiredPeripheralAddressCopy) {
// remove expired records from iosExposures
disconnectIosPeripheral(address);
}
Expand All @@ -540,8 +542,10 @@ private void processExposures() {
}

if (expiredRPIs != null) {
// Create copy so that to prevent crash with ConcurrentModificationException.
Set<String> expiredRPIsCopy = new HashSet<>(expiredRPIs);
// remove expired records from androidExposures
for (String encodedRpi : expiredRPIs) {
for (String encodedRpi : expiredRPIsCopy) {
removeAndroidRpi(encodedRpi);
}
}
Expand Down

0 comments on commit ffbb951

Please sign in to comment.