3838import org .flywaydb .database .oracle .OracleConfigurationExtension ;
3939import org .flywaydb .database .postgresql .PostgreSQLConfigurationExtension ;
4040import org .flywaydb .database .sqlserver .SQLServerConfigurationExtension ;
41+ import org .jspecify .annotations .Nullable ;
4142
4243import org .springframework .aot .hint .RuntimeHints ;
4344import org .springframework .aot .hint .RuntimeHintsRegistrar ;
@@ -177,14 +178,14 @@ Flyway flyway(FlywayConnectionDetails connectionDetails, ResourceLoader resource
177178 return configuration .load ();
178179 }
179180
180- private void configureDataSource (FluentConfiguration configuration , DataSource flywayDataSource ,
181- DataSource dataSource , FlywayConnectionDetails connectionDetails ) {
181+ private void configureDataSource (FluentConfiguration configuration , @ Nullable DataSource flywayDataSource ,
182+ @ Nullable DataSource dataSource , FlywayConnectionDetails connectionDetails ) {
182183 DataSource migrationDataSource = getMigrationDataSource (flywayDataSource , dataSource , connectionDetails );
183184 configuration .dataSource (migrationDataSource );
184185 }
185186
186- private DataSource getMigrationDataSource (DataSource flywayDataSource , DataSource dataSource ,
187- FlywayConnectionDetails connectionDetails ) {
187+ private DataSource getMigrationDataSource (@ Nullable DataSource flywayDataSource ,
188+ @ Nullable DataSource dataSource , FlywayConnectionDetails connectionDetails ) {
188189 if (flywayDataSource != null ) {
189190 return flywayDataSource ;
190191 }
@@ -424,7 +425,7 @@ public Set<ConvertiblePair> getConvertibleTypes() {
424425 }
425426
426427 @ Override
427- public Object convert (Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) {
428+ public Object convert (@ Nullable Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) {
428429 String value = ObjectUtils .nullSafeToString (source );
429430 return MigrationVersion .fromVersion (value );
430431 }
@@ -457,7 +458,7 @@ private static final class FlywayUrlCondition {
457458 static class FlywayAutoConfigurationRuntimeHints implements RuntimeHintsRegistrar {
458459
459460 @ Override
460- public void registerHints (RuntimeHints hints , ClassLoader classLoader ) {
461+ public void registerHints (RuntimeHints hints , @ Nullable ClassLoader classLoader ) {
461462 hints .resources ().registerPattern ("db/migration/*" );
462463 }
463464
@@ -475,22 +476,22 @@ static final class PropertiesFlywayConnectionDetails implements FlywayConnection
475476 }
476477
477478 @ Override
478- public String getUsername () {
479+ public @ Nullable String getUsername () {
479480 return this .properties .getUser ();
480481 }
481482
482483 @ Override
483- public String getPassword () {
484+ public @ Nullable String getPassword () {
484485 return this .properties .getPassword ();
485486 }
486487
487488 @ Override
488- public String getJdbcUrl () {
489+ public @ Nullable String getJdbcUrl () {
489490 return this .properties .getUrl ();
490491 }
491492
492493 @ Override
493- public String getDriverClassName () {
494+ public @ Nullable String getDriverClassName () {
494495 return this .properties .getDriverClassName ();
495496 }
496497
@@ -574,7 +575,7 @@ private void setKerberosLoginFile(SQLServerConfigurationExtension configuration,
574575 */
575576 static class Extension <E extends ConfigurationExtension > {
576577
577- private SingletonSupplier <E > extension ;
578+ private final SingletonSupplier <E > extension ;
578579
579580 Extension (FluentConfiguration configuration , Class <E > type , String name ) {
580581 this .extension = SingletonSupplier .of (() -> {
0 commit comments