Skip to content

Commit

Permalink
Refine generic boundaries.
Browse files Browse the repository at this point in the history
Kotlin reacts to JSpecify with increased nullability requirements.

See #1980
  • Loading branch information
mp911de authored and schauder committed Feb 11, 2025
1 parent b808a15 commit cd7af73
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable
import org.springframework.data.domain.Sort
import org.springframework.data.relational.core.query.Query
import java.util.Optional
import java.util.*

/**
* Kotlin extensions for [JdbcAggregateOperations].
Expand Down Expand Up @@ -80,7 +80,7 @@ inline fun <reified T> JdbcAggregateOperations.findAll(sort: Sort): List<T> =
/**
* Extension for [JdbcAggregateOperations.findAll] with pagination.
*/
inline fun <reified T> JdbcAggregateOperations.findAll(pageable: Pageable): Page<T> =
inline fun <reified T : Any> JdbcAggregateOperations.findAll(pageable: Pageable): Page<T> =
findAll(T::class.java, pageable)

/**
Expand All @@ -98,7 +98,10 @@ inline fun <reified T> JdbcAggregateOperations.findAll(query: Query): List<T> =
/**
* Extension for [JdbcAggregateOperations.findAll] with query and pagination.
*/
inline fun <reified T> JdbcAggregateOperations.findAll(query: Query, pageable: Pageable): Page<T> =
inline fun <reified T : Any> JdbcAggregateOperations.findAll(
query: Query,
pageable: Pageable
): Page<T> =
findAll(query, T::class.java, pageable)

/**
Expand All @@ -117,4 +120,4 @@ inline fun <reified T> JdbcAggregateOperations.deleteAllById(ids: Iterable<*>):
* Extension for [JdbcAggregateOperations.deleteAll].
*/
inline fun <reified T> JdbcAggregateOperations.deleteAll(): Unit =
deleteAll(T::class.java)
deleteAll(T::class.java)

0 comments on commit cd7af73

Please sign in to comment.