mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Fix NullAway suppression in PulsarConfiguration
See gh-46587
This commit is contained in:
+4
-2
@@ -53,6 +53,7 @@ import org.springframework.pulsar.function.PulsarFunction;
|
||||
import org.springframework.pulsar.function.PulsarFunctionAdministration;
|
||||
import org.springframework.pulsar.function.PulsarSink;
|
||||
import org.springframework.pulsar.function.PulsarSource;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Common configuration used by both {@link PulsarAutoConfiguration} and
|
||||
@@ -146,10 +147,11 @@ class PulsarConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("NullAway") // Resolved.orElseThrow() doesn't return nullable
|
||||
private Schema<Object> getSchema(DefaultSchemaResolver schemaResolver, SchemaType schemaType, Class<?> messageType,
|
||||
@Nullable Class<?> messageKeyType) {
|
||||
return schemaResolver.resolveSchema(schemaType, messageType, messageKeyType).orElseThrow();
|
||||
Schema<Object> schema = schemaResolver.resolveSchema(schemaType, messageType, messageKeyType).orElseThrow();
|
||||
Assert.state(schema != null, "'schema' must not be null");
|
||||
return schema;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user