Improve null-safety of module/spring-boot-flyway

See gh-46926
This commit is contained in:
Moritz Halbritter 2025-08-20 14:34:13 +02:00
parent d9750462bc
commit 5f5443ea67
1 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ public class FlywayEndpoint {
@ReadOperation
public FlywayBeansDescriptor flywayBeans() {
ApplicationContext target = this.context;
Map<String, ContextFlywayBeansDescriptor> contextFlywayBeans = new HashMap<>();
Map<@Nullable String, ContextFlywayBeansDescriptor> contextFlywayBeans = new HashMap<>();
while (target != null) {
Map<String, FlywayDescriptor> flywayBeans = new HashMap<>();
target.getBeansOfType(Flyway.class)
@ -72,13 +72,13 @@ public class FlywayEndpoint {
*/
public static final class FlywayBeansDescriptor implements OperationResponseBody {
private final Map<String, ContextFlywayBeansDescriptor> contexts;
private final Map<@Nullable String, ContextFlywayBeansDescriptor> contexts;
private FlywayBeansDescriptor(Map<String, ContextFlywayBeansDescriptor> contexts) {
private FlywayBeansDescriptor(Map<@Nullable String, ContextFlywayBeansDescriptor> contexts) {
this.contexts = contexts;
}
public Map<String, ContextFlywayBeansDescriptor> getContexts() {
public Map<@Nullable String, ContextFlywayBeansDescriptor> getContexts() {
return this.contexts;
}