Skip to content

Store.getOrComputeIfAbsent() shadows values from parent store #349

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

Closed
1 task done
sbrannen opened this issue Jun 23, 2016 · 0 comments
Closed
1 task done

Store.getOrComputeIfAbsent() shadows values from parent store #349

sbrannen opened this issue Jun 23, 2016 · 0 comments

Comments

@sbrannen
Copy link
Member

sbrannen commented Jun 23, 2016

Status Quo

In direct contrast to the get() methods in ExtensionContext.Store, the getOrComputeIfAbsent() methods in ExtensionContext.Store only perform a local lookup before invoking the supplied Function<K, V> defaultCreator. Consequently, even if a value has been stored under the supplied key in the parent Store, the getOrComputeIfAbsent() methods will always create a new default value and store it locally, thereby shadowing the desired, existing value from the parent.

Deliverables

  • Ensure that getOrComputeIfAbsent() methods in ExtensionContext.Store do not shadow values from parent stores.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant