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

Consider making Row and Record generic: Row<R extends Record<R>> and Record<R extends Record<R>> #2570

Closed
lukaseder opened this issue Jun 29, 2013 · 1 comment

Comments

@lukaseder
Copy link
Member

There are various places throughout the jOOQ API, where the <R> type cannot be accessed because Row and Record are not generic.

In other places, the resulting API is subtly wrong, as can be seen in Record.map(RecordMapper<Record, E>) (#2465). Without any recursive type definition on Record itself, there is no way to solve this through the Record type hierarchy using covariance or contravariance.

Alternatively, if we embrace using Java 8's Optional<R> as a result, we could leverage Optional.map(), which doesn't have this restriction...


See also:

@lukaseder
Copy link
Member Author

There have been very few cases where this would have been useful, but many cases, where it would have been a pain, especially for users. In addition to being a backwards incompatible change with tons of compiler regressions in user code due to the new generics semantics and the hard to capture recursive type variable, let's just reject this.

3.17 Other improvements automation moved this from To do to Done May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

1 participant