vertx-jooq icon indicating copy to clipboard operation
vertx-jooq copied to clipboard

ReactiveRXGenericQueryExecutor's newInstance() returns wrong class type

Open ashertarno opened this issue 3 years ago • 2 comments

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.

ashertarno avatar May 24 '21 06:05 ashertarno

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?

jklingsporn avatar May 25 '21 08:05 jklingsporn

@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.

ashertarno avatar May 25 '21 09:05 ashertarno