Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove blocking ClassInfo.of #643

Merged
merged 2 commits into from
May 17, 2019
Merged

Remove blocking ClassInfo.of #643

merged 2 commits into from
May 17, 2019

Conversation

edalquist
Copy link
Contributor

Replaces blocking logic in ClassInfo.of with ConcurrentMap.computeIfAbsent.

Also removes WeakHashMap as it wasn't actually doing the intended operation. The ClassInfo value has a strong reference to the Class which prevents the weak key reference from ever being collected.

Fixes #642

Replaces blocking logic in ClassInfo.of with ConcurrentMap.computeIfAbsent.

Also removes WeakHashMap as it wasn't actually doing the intended operation. The ClassInfo value has a strong reference to the Class which prevents the weak key reference from ever being collected.
@edalquist edalquist requested a review from a team as a code owner May 17, 2019 04:35
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 17, 2019
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 17, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 17, 2019
computeIfAbsent isn't available in all supported environments. Replace with the same logic as the default computeIfAbsent implementation.
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 17, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 17, 2019
@chingor13 chingor13 merged commit 249ddec into googleapis:master May 17, 2019
clundin25 pushed a commit to clundin25/google-http-java-client that referenced this pull request Aug 11, 2022
Co-authored-by: google-cloud-policy-bot[bot] <80869356+google-cloud-policy-bot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Ching <chingor@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

High contention in com/google/api/client/util/ClassInfo.of
4 participants