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

Introduce ReversedRedisListView for Java 21 compatibility #2602

Closed
jxblum opened this issue Jun 13, 2023 · 2 comments
Closed

Introduce ReversedRedisListView for Java 21 compatibility #2602

jxblum opened this issue Jun 13, 2023 · 2 comments
Assignees
Labels
type: dependency-upgrade A dependency upgrade type: enhancement A general enhancement

Comments

@jxblum
Copy link
Contributor

jxblum commented Jun 13, 2023

Builds Spring Data Redis on JDK 21 (EA).

@jxblum jxblum added type: dependency-upgrade A dependency upgrade type: task A general task labels Jun 13, 2023
@jxblum
Copy link
Contributor Author

jxblum commented Jun 13, 2023

Seems the List interface and Deque interface in Java 21 have incompatible APIs in Java 21. Both interfaces defined reversed() method.

However, in the List interface, reversed() returns a List<E> and in Deque, reversed() returns a Deque<E>.

This means types like RedisList cannot implement both List and Deque.

@jxblum
Copy link
Contributor Author

jxblum commented Jun 13, 2023

In addition, RedisList must also override and provide default implementations for the following List / Deque interface methods:

  • addFirst(:E)
  • addLast(:E)
  • getFirst():E
  • getLast():E
  • removeFirst():E
  • removeLast():E

@jxblum jxblum changed the title Build on JDK 21 Build with JDK 21 Jun 13, 2023
@jxblum jxblum self-assigned this Jun 14, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 6, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 6, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 6, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 6, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 7, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 7, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 7, 2023
jxblum pushed a commit to jxblum/spring-data-redis that referenced this issue Jul 11, 2023
…versed().

* Add delegate methods to avoid using Java 21 API.
* Rename ReversedRedisList to ReversedRedisListView to express its view aspect.
* Refine tests.

Closes spring-projects#2602
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 11, 2023
@mp911de mp911de added type: enhancement A general enhancement and removed type: task A general task labels Jul 12, 2023
@mp911de mp911de changed the title Build with JDK 21 Introduce ReversedRedisListView for Java 21 compatibility Jul 12, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 12, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Jul 12, 2023
mp911de pushed a commit that referenced this issue Jul 13, 2023
See #2602
Original pull request: #2608
mp911de added a commit that referenced this issue Jul 13, 2023
Add documentation for generics. Fix remove() and element() methods to adhere to their contract.

See #2602
Original pull request: #2608
@mp911de mp911de added this to the 3.2 M1 (2023.1.0) milestone Jul 13, 2023
@mp911de mp911de linked a pull request Jul 13, 2023 that will close this issue
mp911de pushed a commit that referenced this issue Jul 13, 2023
See #2602
Original pull request: #2608
mp911de pushed a commit that referenced this issue Jul 13, 2023
mp911de added a commit that referenced this issue Jul 13, 2023
Add documentation for generics. Fix remove() and element() methods to adhere to their contract.

See #2602
Original pull request: #2608
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Sep 7, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Sep 7, 2023
jxblum pushed a commit to jxblum/spring-data-redis that referenced this issue Sep 7, 2023
…versed().

* Add delegate methods to avoid using Java 21 API.
* Rename ReversedRedisList to ReversedRedisListView to express its view aspect.
* Refine tests.

Closes spring-projects#2602
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Sep 7, 2023
jxblum added a commit to jxblum/spring-data-redis that referenced this issue Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: dependency-upgrade A dependency upgrade type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants