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

Refactor simplify lazy to use existing OnceProvider #542

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

rbygrave
Copy link
Contributor

Extracted this refactoring from #540

The existing .registerProvider() without a leading .asPrototype() is already a "lazy only once" style provider. This change uses that and then removes the LazyProvider and registerLazy() as they are no longer needed or used.

This also changes the synchronized block to use a ReentrantLock in OnceProvider just in case the provider invocation does something interesting and using Java 21+ Virtual Threads.

Extracted this refactoring from #540

The existing .registerProvider() without a leading .asPrototype() is already a "lazy only once" style provider. This change uses that and then removes the LazyProvider and registerLazy() as they are no longer needed or used.

This also changes the synchronized block to use a ReentrantLock in OnceProvider just in case the provider invocation does something interesting and using Java 21+ Virtual Threads.
@rbygrave rbygrave requested a review from SentryMan April 14, 2024 10:00
@rbygrave rbygrave self-assigned this Apr 14, 2024
@rbygrave rbygrave added this to the 9.13 milestone Apr 14, 2024
@rbygrave rbygrave merged commit 9149273 into master Apr 14, 2024
7 checks passed
@rbygrave rbygrave deleted the feature/refactor-lazy-provider branch April 14, 2024 10:05
@rbygrave rbygrave modified the milestones: 9.13, 10.0 Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant