38
38
import org .flywaydb .database .oracle .OracleConfigurationExtension ;
39
39
import org .flywaydb .database .postgresql .PostgreSQLConfigurationExtension ;
40
40
import org .flywaydb .database .sqlserver .SQLServerConfigurationExtension ;
41
+ import org .jspecify .annotations .Nullable ;
41
42
42
43
import org .springframework .aot .hint .RuntimeHints ;
43
44
import org .springframework .aot .hint .RuntimeHintsRegistrar ;
@@ -177,14 +178,14 @@ Flyway flyway(FlywayConnectionDetails connectionDetails, ResourceLoader resource
177
178
return configuration .load ();
178
179
}
179
180
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 ) {
182
183
DataSource migrationDataSource = getMigrationDataSource (flywayDataSource , dataSource , connectionDetails );
183
184
configuration .dataSource (migrationDataSource );
184
185
}
185
186
186
- private DataSource getMigrationDataSource (DataSource flywayDataSource , DataSource dataSource ,
187
- FlywayConnectionDetails connectionDetails ) {
187
+ private DataSource getMigrationDataSource (@ Nullable DataSource flywayDataSource ,
188
+ @ Nullable DataSource dataSource , FlywayConnectionDetails connectionDetails ) {
188
189
if (flywayDataSource != null ) {
189
190
return flywayDataSource ;
190
191
}
@@ -424,7 +425,7 @@ public Set<ConvertiblePair> getConvertibleTypes() {
424
425
}
425
426
426
427
@ Override
427
- public Object convert (Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) {
428
+ public Object convert (@ Nullable Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) {
428
429
String value = ObjectUtils .nullSafeToString (source );
429
430
return MigrationVersion .fromVersion (value );
430
431
}
@@ -457,7 +458,7 @@ private static final class FlywayUrlCondition {
457
458
static class FlywayAutoConfigurationRuntimeHints implements RuntimeHintsRegistrar {
458
459
459
460
@ Override
460
- public void registerHints (RuntimeHints hints , ClassLoader classLoader ) {
461
+ public void registerHints (RuntimeHints hints , @ Nullable ClassLoader classLoader ) {
461
462
hints .resources ().registerPattern ("db/migration/*" );
462
463
}
463
464
@@ -475,22 +476,22 @@ static final class PropertiesFlywayConnectionDetails implements FlywayConnection
475
476
}
476
477
477
478
@ Override
478
- public String getUsername () {
479
+ public @ Nullable String getUsername () {
479
480
return this .properties .getUser ();
480
481
}
481
482
482
483
@ Override
483
- public String getPassword () {
484
+ public @ Nullable String getPassword () {
484
485
return this .properties .getPassword ();
485
486
}
486
487
487
488
@ Override
488
- public String getJdbcUrl () {
489
+ public @ Nullable String getJdbcUrl () {
489
490
return this .properties .getUrl ();
490
491
}
491
492
492
493
@ Override
493
- public String getDriverClassName () {
494
+ public @ Nullable String getDriverClassName () {
494
495
return this .properties .getDriverClassName ();
495
496
}
496
497
@@ -574,7 +575,7 @@ private void setKerberosLoginFile(SQLServerConfigurationExtension configuration,
574
575
*/
575
576
static class Extension <E extends ConfigurationExtension > {
576
577
577
- private SingletonSupplier <E > extension ;
578
+ private final SingletonSupplier <E > extension ;
578
579
579
580
Extension (FluentConfiguration configuration , Class <E > type , String name ) {
580
581
this .extension = SingletonSupplier .of (() -> {
0 commit comments