Use @SuppressWarnings("NullAway.Init")`

This commit uses `@SuppressWarnings("NullAway.Init")` when
relevant.

See gh-34147
See gh-34151
This commit is contained in:
Sébastien Deleuze
2024-12-26 10:47:10 +01:00
parent f24f9a4ba4
commit 1c37e7092e
2 changed files with 6 additions and 8 deletions
@@ -178,7 +178,8 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
private ApplicationStartup applicationStartup = ApplicationStartup.DEFAULT;
private @Nullable List<PropertySourceDescriptor> propertySourceDescriptors;
@SuppressWarnings("NullAway.Init")
private List<PropertySourceDescriptor> propertySourceDescriptors;
@Override
@@ -319,7 +320,6 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
}
@Override
@SuppressWarnings("NullAway") // Lazy initialization
public @Nullable BeanFactoryInitializationAotContribution processAheadOfTime(ConfigurableListableBeanFactory beanFactory) {
boolean hasPropertySourceDescriptors = !CollectionUtils.isEmpty(this.propertySourceDescriptors);
boolean hasImportRegistry = beanFactory.containsBean(IMPORT_REGISTRY_BEAN_NAME);
@@ -18,8 +18,6 @@ package org.springframework.jdbc.support.incrementer;
import javax.sql.DataSource;
import org.jspecify.annotations.Nullable;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessException;
import org.springframework.util.Assert;
@@ -36,10 +34,12 @@ import org.springframework.util.Assert;
*/
public abstract class AbstractDataFieldMaxValueIncrementer implements DataFieldMaxValueIncrementer, InitializingBean {
private @Nullable DataSource dataSource;
@SuppressWarnings("NullAway.Init")
private DataSource dataSource;
/** The name of the sequence/table containing the sequence. */
private @Nullable String incrementerName;
@SuppressWarnings("NullAway.Init")
private String incrementerName;
/** The length to which a string result should be pre-pended with zeroes. */
protected int paddingLength = 0;
@@ -76,7 +76,6 @@ public abstract class AbstractDataFieldMaxValueIncrementer implements DataFieldM
/**
* Return the data source to retrieve the value from.
*/
@SuppressWarnings("NullAway") // Lazy initialization
public DataSource getDataSource() {
return this.dataSource;
}
@@ -91,7 +90,6 @@ public abstract class AbstractDataFieldMaxValueIncrementer implements DataFieldM
/**
* Return the name of the sequence/table.
*/
@SuppressWarnings("NullAway") // Lazy initialization
public String getIncrementerName() {
return this.incrementerName;
}