KEMBAR78
replace HashMap with ConcurrentHashMap to avoid ConcurrentModificatio… by oshai · Pull Request #883 · googleapis/java-storage-nio · GitHub
Skip to content

Conversation

@oshai
Copy link
Contributor

@oshai oshai commented Apr 10, 2022

replace HashMap with ConcurrentHashMap to avoid ConcurrentModificationException

avoids this exception:

Caused by: java.lang.RuntimeException: java.util.ConcurrentModificationException with message: null
	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1511)
	at java.util.HashMap$ValueIterator.next(HashMap.java:1539)
	at com.google.cloud.storage.contrib.nio.testing.FakeStorageRpc.list(FakeStorageRpc.java:153)
	at com.google.cloud.storage.StorageImpl.lambda$listBlobs$11(StorageImpl.java:391)
	at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105)
	at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
	at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
	at com.google.cloud.storage.Retrying.run(Retrying.java:51)

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

…nException

avoids this exception:
```
Caused by: java.lang.RuntimeException: java.util.ConcurrentModificationException with message: null
	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1511)
	at java.util.HashMap$ValueIterator.next(HashMap.java:1539)
	at com.google.cloud.storage.contrib.nio.testing.FakeStorageRpc.list(FakeStorageRpc.java:153)
	at com.google.cloud.storage.StorageImpl.lambda$listBlobs$11(StorageImpl.java:391)
	at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105)
	at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
	at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
	at com.google.cloud.storage.Retrying.run(Retrying.java:51)
```
@oshai oshai requested a review from a team as a code owner April 10, 2022 14:12
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: storage Issues related to the googleapis/java-storage-nio API. labels Apr 10, 2022
@BenWhitehead BenWhitehead added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 11, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 11, 2022
@BenWhitehead BenWhitehead added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 11, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 11, 2022
@BenWhitehead BenWhitehead added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 11, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 11, 2022
@BenWhitehead BenWhitehead merged commit d2fe2a0 into googleapis:main Apr 11, 2022
@oshai oshai deleted the patch-1 branch April 14, 2022 12:25
gcf-merge-on-green bot pushed a commit that referenced this pull request Apr 19, 2022
🤖 I have created a release *beep* *boop*
---


### [0.123.28](v0.123.27...v0.123.28) (2022-04-18)


### Bug Fixes

* **native:** initialize classes at build-time to fix Native Image compilation ([#874](#874)) ([df905cb](df905cb))
* **test:** replace HashMap with ConcurrentHashMap to avoid ConcurrentModificatio… ([#883](#883)) ([d2fe2a0](d2fe2a0))


### Dependencies

* update dependency com.google.apis:google-api-services-storage to v1-rev20220401-1.32.1 ([#881](#881)) ([a598199](a598199))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#884](#884)) ([c08f115](c08f115))
* update dependency com.google.cloud:google-cloud-storage to v2.6.0 ([#878](#878)) ([0bd1985](0bd1985))
* update dependency com.google.cloud:google-cloud-storage to v2.6.1 ([#885](#885)) ([cf24525](cf24525))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/java-storage-nio API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants