Skip to content

Commit 0510cfa

Browse files
snicollphilwebb
authored andcommitted
Refine '?' use in Kotlin code
1 parent 7035c0f commit 0510cfa

File tree

15 files changed

+21
-21
lines changed

15 files changed

+21
-21
lines changed

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/data/nosql/mongodb/repositories/CityRepository.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import org.springframework.data.domain.Pageable
2121
import org.springframework.data.repository.Repository
2222

2323
interface CityRepository :
24-
Repository<City?, Long?> {
25-
fun findAll(pageable: Pageable?): Page<City?>?
26-
fun findByNameAndStateAllIgnoringCase(name: String?, state: String?): City?
24+
Repository<City, Long> {
25+
fun findAll(pageable: Pageable?): Page<City>
26+
fun findByNameAndStateAllIgnoringCase(name: String, state: String): City?
2727
}

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/data/sql/jpaandspringdata/enversrepositories/CountryRepository.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import org.springframework.data.repository.Repository
2323
import org.springframework.data.repository.history.RevisionRepository
2424

2525
interface CountryRepository :
26-
RevisionRepository<Country?, Long?, Int>,
27-
Repository<Country?, Long?> {
26+
RevisionRepository<Country, Long, Int>,
27+
Repository<Country, Long> {
2828

29-
fun findAll(pageable: Pageable?): Page<Country?>?
29+
fun findAll(pageable: Pageable?): Page<Country>?
3030

3131
}

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/data/sql/jpaandspringdata/repositories/CityRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import org.springframework.data.domain.Page
2121
import org.springframework.data.domain.Pageable
2222
import org.springframework.data.repository.Repository
2323

24-
interface CityRepository : Repository<City?, Long?> {
24+
interface CityRepository : Repository<City, Long> {
2525

26-
fun findAll(pageable: Pageable?): Page<City?>?
26+
fun findAll(pageable: Pageable?): Page<City>?
2727

2828
fun findByNameAndStateAllIgnoringCase(name: String?, state: String?): City?
2929

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/data/sql/r2dbc/repositories/CityRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ package org.springframework.boot.docs.data.sql.r2dbc.repositories
1919
import org.springframework.data.repository.Repository
2020
import reactor.core.publisher.Mono
2121

22-
interface CityRepository : Repository<City?, Long?> {
22+
interface CityRepository : Repository<City, Long> {
2323

24-
fun findByNameAndStateAllIgnoringCase(name: String?, state: String?): Mono<City?>?
24+
fun findByNameAndStateAllIgnoringCase(name: String, state: String): Mono<City?>
2525

2626
}

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/restclient/MyService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MyService(restClientBuilder: RestClient.Builder) {
2929
restClient = restClientBuilder.baseUrl("https://example.org").build()
3030
}
3131

32-
fun someRestCall(name: String?): Details {
32+
fun someRestCall(name: String): Details {
3333
return restClient.get().uri("/{name}/details", name)
3434
.retrieve().body(Details::class.java)!!
3535
}

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/restclient/ssl/MyService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MyService(restClientBuilder: RestClient.Builder, ssl: RestClientSsl) {
3131
.apply(ssl.fromBundle("mybundle")).build()
3232
}
3333

34-
fun someRestCall(name: String?): Details {
34+
fun someRestCall(name: String): Details {
3535
return restClient.get().uri("/{name}/details", name)
3636
.retrieve().body(Details::class.java)!!
3737
}

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/restclient/ssl/settings/MyService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class MyService(restClientBuilder: RestClient.Builder, sslBundles: SslBundles) {
3838
.requestFactory(requestFactory).build()
3939
}
4040

41-
fun someRestCall(name: String?): Details {
41+
fun someRestCall(name: String): Details {
4242
return restClient.get().uri("/{name}/details", name).retrieve().body(Details::class.java)!!
4343
}
4444

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/MyService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MyService(webClientBuilder: WebClient.Builder) {
2929
webClient = webClientBuilder.baseUrl("https://example.org").build()
3030
}
3131

32-
fun someRestCall(name: String?): Mono<Details> {
32+
fun someRestCall(name: String): Mono<Details> {
3333
return webClient.get().uri("/{name}/details", name)
3434
.retrieve().bodyToMono(Details::class.java)
3535
}

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/io/restclient/webclient/ssl/MyService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MyService(webClientBuilder: WebClient.Builder, ssl: WebClientSsl) {
3131
.apply(ssl.fromBundle("mybundle")).build()
3232
}
3333

34-
fun someRestCall(name: String?): Mono<Details> {
34+
fun someRestCall(name: String): Mono<Details> {
3535
return webClient.get().uri("/{name}/details", name)
3636
.retrieve().bodyToMono(Details::class.java)
3737
}

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/messaging/kafka/streams/MyKafkaStreamsConfiguration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class MyKafkaStreamsConfiguration {
3838
return stream
3939
}
4040

41-
private fun uppercaseValue(key: Int, value: String): KeyValue<Int?, String?> {
41+
private fun uppercaseValue(key: Int, value: String): KeyValue<Int, String> {
4242
return KeyValue(key, value.uppercase())
4343
}
4444

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/reactive/webflux/CustomerRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package org.springframework.boot.docs.web.reactive.webflux
1919
import org.springframework.data.repository.reactive.ReactiveCrudRepository
2020
import reactor.core.publisher.Flux
2121

22-
interface CustomerRepository : ReactiveCrudRepository<Customer?, Long?> {
22+
interface CustomerRepository : ReactiveCrudRepository<Customer, Long> {
2323

2424
fun findByUser(user: User?): Flux<Customer?>?
2525

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/reactive/webflux/MyRestController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import reactor.core.publisher.Mono
2929
class MyRestController(private val userRepository: UserRepository, private val customerRepository: CustomerRepository) {
3030

3131
@GetMapping("/{userId}")
32-
fun getUser(@PathVariable userId: Long): Mono<User?> {
32+
fun getUser(@PathVariable userId: Long): Mono<User> {
3333
return userRepository.findById(userId)
3434
}
3535

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/reactive/webflux/UserRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ package org.springframework.boot.docs.web.reactive.webflux
1818

1919
import org.springframework.data.repository.reactive.ReactiveCrudRepository
2020

21-
interface UserRepository : ReactiveCrudRepository<User?, Long?>
21+
interface UserRepository : ReactiveCrudRepository<User, Long>

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/CustomerRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package org.springframework.boot.docs.web.servlet.springmvc
1818

1919
import org.springframework.data.repository.CrudRepository
2020

21-
interface CustomerRepository : CrudRepository<Customer?, Long?> {
21+
interface CustomerRepository : CrudRepository<Customer, Long> {
2222

2323
fun findByUser(user: User?): List<Customer>?
2424

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/UserRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ package org.springframework.boot.docs.web.servlet.springmvc
1818

1919
import org.springframework.data.repository.CrudRepository
2020

21-
interface UserRepository : CrudRepository<User?, Long?>
21+
interface UserRepository : CrudRepository<User, Long>

0 commit comments

Comments
 (0)