Add more nullability annotations to module/spring-boot-amqp
See gh-46587
This commit is contained in:
parent
81c0bfb048
commit
3afbe84bbd
|
|
@ -26,15 +26,15 @@ class MyReactiveHealthIndicator : ReactiveHealthIndicator {
|
|||
|
||||
override fun health(): Mono<Health> {
|
||||
// @formatter:off
|
||||
return doHealthCheck()!!.onErrorResume { exception: Throwable? ->
|
||||
return doHealthCheck().onErrorResume { exception: Throwable ->
|
||||
Mono.just(Health.Builder().down(exception).build())
|
||||
}
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
private fun doHealthCheck(): Mono<Health>? {
|
||||
private fun doHealthCheck(): Mono<Health> {
|
||||
// perform some specific health check
|
||||
return /**/ null
|
||||
return /**/ Mono.empty()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,11 @@ public class RabbitHealthIndicator extends AbstractHealthIndicator {
|
|||
|
||||
@Override
|
||||
protected void doHealthCheck(Health.Builder builder) throws Exception {
|
||||
builder.up().withDetail("version", getVersion());
|
||||
builder.up();
|
||||
String version = getVersion();
|
||||
if (version != null) {
|
||||
builder.withDetail("version", version);
|
||||
}
|
||||
}
|
||||
|
||||
private @Nullable String getVersion() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue