Skip to content

Commit 1c37e70

Browse files
committed
Use @SuppressWarnings("NullAway.Init")`
This commit uses `@SuppressWarnings("NullAway.Init")` when relevant. See gh-34147 See gh-34151
1 parent f24f9a4 commit 1c37e70

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
178178

179179
private ApplicationStartup applicationStartup = ApplicationStartup.DEFAULT;
180180

181-
private @Nullable List<PropertySourceDescriptor> propertySourceDescriptors;
181+
@SuppressWarnings("NullAway.Init")
182+
private List<PropertySourceDescriptor> propertySourceDescriptors;
182183

183184

184185
@Override
@@ -319,7 +320,6 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
319320
}
320321

321322
@Override
322-
@SuppressWarnings("NullAway") // Lazy initialization
323323
public @Nullable BeanFactoryInitializationAotContribution processAheadOfTime(ConfigurableListableBeanFactory beanFactory) {
324324
boolean hasPropertySourceDescriptors = !CollectionUtils.isEmpty(this.propertySourceDescriptors);
325325
boolean hasImportRegistry = beanFactory.containsBean(IMPORT_REGISTRY_BEAN_NAME);

spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/AbstractDataFieldMaxValueIncrementer.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
import javax.sql.DataSource;
2020

21-
import org.jspecify.annotations.Nullable;
22-
2321
import org.springframework.beans.factory.InitializingBean;
2422
import org.springframework.dao.DataAccessException;
2523
import org.springframework.util.Assert;
@@ -36,10 +34,12 @@
3634
*/
3735
public abstract class AbstractDataFieldMaxValueIncrementer implements DataFieldMaxValueIncrementer, InitializingBean {
3836

39-
private @Nullable DataSource dataSource;
37+
@SuppressWarnings("NullAway.Init")
38+
private DataSource dataSource;
4039

4140
/** The name of the sequence/table containing the sequence. */
42-
private @Nullable String incrementerName;
41+
@SuppressWarnings("NullAway.Init")
42+
private String incrementerName;
4343

4444
/** The length to which a string result should be pre-pended with zeroes. */
4545
protected int paddingLength = 0;
@@ -76,7 +76,6 @@ public void setDataSource(DataSource dataSource) {
7676
/**
7777
* Return the data source to retrieve the value from.
7878
*/
79-
@SuppressWarnings("NullAway") // Lazy initialization
8079
public DataSource getDataSource() {
8180
return this.dataSource;
8281
}
@@ -91,7 +90,6 @@ public void setIncrementerName(String incrementerName) {
9190
/**
9291
* Return the name of the sequence/table.
9392
*/
94-
@SuppressWarnings("NullAway") // Lazy initialization
9593
public String getIncrementerName() {
9694
return this.incrementerName;
9795
}

0 commit comments

Comments
 (0)