-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fixed withListener to make listenerSupplier lazy again #9173
Fixed withListener to make listenerSupplier lazy again #9173
Conversation
Resolves #9215 |
151a74c
to
6f0a36f
Compare
H @YanivKunda, can you share what are you trying to achieve? I'm just curious if your real life code will work with the fix submitted. Your fix is technically correct but just want to see if it will fix what you want to do (I have an idea). |
Actually I just encountered this code and considered it a bug without a real-life use case - |
@eddumelendez Do you think this is ready for review, or does it require any further work or discussion? |
Thanks @YanivKunda. Your reasoning with evaluating the supplier makes sense, but the example does not:
The configured listeners are evaluated in the I also don't understand, why we need to make changes to a deprecated method. This issue is not present in the other |
@kiview you're right about my example, and I'm not sure I would be able to come up with a better one. And obviously, unless it's a critical fix, there's no need to change a deprecated method. |
.withListener
accepted aSupplier<String>
that immediately got its value - defeating the purpose of using a supplier.This change (and accompanying test) fixes it, and parses the entire listener lazily.