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

ReactiveRXGenericQueryExecutor's newInstance() returns wrong class type #185

Open
ashertarno opened this issue May 24, 2021 · 2 comments
Open

Comments

@ashertarno
Copy link

ashertarno commented May 24, 2021

In ReactiveRXGenericQueryExecutor the following method is creating a new instance once a new transaction is created:

protected io.reactivex.functions.Function<Transaction, ? extends ReactiveRXGenericQueryExecutor> newInstance(SqlConnection conn) { return transaction -> new ReactiveRXGenericQueryExecutor(configuration(),conn,transaction); }

While the function in method's return type should return <? extends ReactiveRXGenericQueryExecutor> the method returns ReactiveRXGenericQueryExecutor which breaks an option to subclass ReactiveRXGenericQueryExecutor.

@jklingsporn
Copy link
Owner

Thank you for pointing that out. Changing the API to what you suggested would break the current contract and thus I am a bit reluctant to do it right away. Have you tried to use delegation instead of inheritance to reach your goal?

@ashertarno
Copy link
Author

@jklingsporn thanks for the prompt response. unfortunately delegation doesn't solve my need to customize some things. this is also an old code that used a previous version (vertx3 based). i do have a workaround, but it's pretty awkward.

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

No branches or pull requests

2 participants