Merge branch '4.0.x' into 4.1.x

Closes gh-51599
This commit is contained in:
Andy Wilkinson
2026-09-07 08:26:42 +01:00
149 changed files with 5 additions and 243 deletions
@@ -38,7 +38,6 @@ import static org.assertj.core.api.Assertions.assertThat;
class SpringBootPluginTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Test
@@ -43,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThatException;
class BuildInfoTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Test
@@ -80,7 +80,6 @@ import static org.mockito.Mockito.mock;
abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
private final Class<T> taskClass;
@@ -38,7 +38,6 @@ class RunArguments {
this(parseArgs(arguments));
}
@SuppressWarnings("NullAway") // Maven can't handle nullable arrays
RunArguments(@Nullable String[] args) {
this((args != null) ? Arrays.asList(args) : null);
}
@@ -57,11 +57,9 @@ import static org.mockito.Mockito.times;
class ArtifactsLibrariesTests {
@Mock
@SuppressWarnings("NullAway.Init")
private Artifact artifact;
@Mock
@SuppressWarnings("NullAway.Init")
private ArtifactHandler artifactHandler;
private Set<Artifact> artifacts;
@@ -71,11 +69,9 @@ class ArtifactsLibrariesTests {
private ArtifactsLibraries libs;
@Mock
@SuppressWarnings("NullAway.Init")
private LibraryCallback callback;
@Captor
@SuppressWarnings("NullAway.Init")
private ArgumentCaptor<Library> libraryCaptor;
@BeforeEach
@@ -49,7 +49,6 @@ import static org.mockito.Mockito.mock;
class DependencyFilterMojoTests {
@TempDir
@SuppressWarnings("NullAway.Init")
static Path temp;
@Test
@@ -39,7 +39,6 @@ import static org.mockito.Mockito.mock;
class JarTypeFilterTests {
@TempDir
@SuppressWarnings("NullAway.Init")
Path temp;
@Test
@@ -61,7 +61,6 @@ class BuildRequestTests {
private static final ZoneId UTC = ZoneId.of("UTC");
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@Test
@@ -50,7 +50,6 @@ import static org.mockito.Mockito.mock;
class DirectoryBuildpackTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
private File buildpackDir;
@@ -62,7 +62,6 @@ class EphemeralBuilderTests extends AbstractJsonTests {
private static final int EXISTING_IMAGE_LAYER_COUNT = 43;
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
private final BuildOwner owner = BuildOwner.of(123, 456);
@@ -105,7 +105,6 @@ class DockerApiTests {
StandardCharsets.UTF_8);
@Mock
@SuppressWarnings("NullAway.Init")
private HttpTransport http;
private DockerApi dockerApi;
@@ -222,19 +221,15 @@ class DockerApiTests {
private ImageApi api;
@Mock
@SuppressWarnings("NullAway.Init")
private UpdateListener<PullImageUpdateEvent> pullListener;
@Mock
@SuppressWarnings("NullAway.Init")
private UpdateListener<PushImageUpdateEvent> pushListener;
@Mock
@SuppressWarnings("NullAway.Init")
private UpdateListener<LoadImageUpdateEvent> loadListener;
@Captor
@SuppressWarnings("NullAway.Init")
private ArgumentCaptor<IOConsumer<OutputStream>> writer;
@BeforeEach
@@ -632,11 +627,9 @@ class DockerApiTests {
private ContainerApi api;
@Captor
@SuppressWarnings("NullAway.Init")
private ArgumentCaptor<IOConsumer<OutputStream>> writer;
@Mock
@SuppressWarnings("NullAway.Init")
private UpdateListener<LogUpdateEvent> logListener;
@BeforeEach
@@ -68,19 +68,15 @@ class HttpClientTransportTests {
private static final String APPLICATION_X_TAR = "application/x-tar";
@Mock
@SuppressWarnings("NullAway.Init")
private HttpClient client;
@Mock
@SuppressWarnings("NullAway.Init")
private ClassicHttpResponse response;
@Mock
@SuppressWarnings("NullAway.Init")
private HttpEntity entity;
@Mock
@SuppressWarnings("NullAway.Init")
private InputStream content;
private HttpClientTransport http;
@@ -45,7 +45,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
class FilePermissionsTests {
@TempDir
@SuppressWarnings("NullAway.Init")
Path tempDir;
@Test
@@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat;
class TarArchiveTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@Test
@@ -42,7 +42,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
class ZipFileTarArchiveTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@Test
@@ -48,11 +48,9 @@ class CommandRunnerTests {
private CommandRunner commandRunner;
@Mock
@SuppressWarnings("NullAway.Init")
private Command regularCommand;
@Mock
@SuppressWarnings("NullAway.Init")
private Command anotherCommand;
private final Set<Call> calls = EnumSet.noneOf(Call.class);
@@ -63,15 +63,12 @@ class ConditionEvaluationReportTests {
private ConditionEvaluationReport report;
@Mock
@SuppressWarnings("NullAway.Init")
private Condition condition1;
@Mock
@SuppressWarnings("NullAway.Init")
private Condition condition2;
@Mock
@SuppressWarnings("NullAway.Init")
private Condition condition3;
private @Nullable ConditionOutcome outcome1;
@@ -101,7 +101,6 @@ class PropertyPlaceholderAutoConfigurationTests {
static class PlaceholderConfig {
@Value("${fruit:apple}")
@SuppressWarnings("NullAway.Init")
private String fruit;
}
@@ -53,7 +53,6 @@ class TemplateAvailabilityProvidersTests {
private TemplateAvailabilityProviders providers;
@Mock
@SuppressWarnings("NullAway.Init")
private TemplateAvailabilityProvider provider;
private final String view = "view";
@@ -63,7 +62,6 @@ class TemplateAvailabilityProvidersTests {
private final MockEnvironment environment = new MockEnvironment();
@Mock
@SuppressWarnings("NullAway.Init")
private ResourceLoader resourceLoader;
@BeforeEach
@@ -59,7 +59,6 @@ import static org.assertj.core.api.Assertions.assertThat;
class DockerCliIntegrationTests {
@TempDir
@SuppressWarnings("NullAway.Init")
private static Path tempDir;
@Test
@@ -47,7 +47,6 @@ import static org.assertj.core.api.Assertions.entry;
class DefaultRunningServiceTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
private DefaultRunningService runningService;
@@ -39,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
class DockerComposeFileTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Test
@@ -37,7 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat;
class DockerComposeOriginTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Test
@@ -71,7 +71,6 @@ import static org.mockito.Mockito.never;
class DockerComposeLifecycleManagerTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
private DockerComposeFile dockerComposeFile;
@@ -64,7 +64,6 @@ class JsonContentAssertTests {
private static final JSONComparator COMPARATOR = new DefaultComparator(JSONCompareMode.LENIENT);
@TempDir
@SuppressWarnings("NullAway.Init")
public Path tempDir;
private File temp;
@@ -38,7 +38,6 @@ import org.springframework.lang.Contract;
class DefaultApplicationContextFactory implements ApplicationContextFactory {
// Method reference is not detected with correct nullability
@SuppressWarnings("NullAway")
@Override
public @Nullable Class<? extends ConfigurableEnvironment> getEnvironmentType(
@Nullable WebApplicationType webApplicationType) {
@@ -46,14 +45,12 @@ class DefaultApplicationContextFactory implements ApplicationContextFactory {
}
// Method reference is not detected with correct nullability
@SuppressWarnings("NullAway")
@Override
public @Nullable ConfigurableEnvironment createEnvironment(@Nullable WebApplicationType webApplicationType) {
return getFromSpringFactories(webApplicationType, ApplicationContextFactory::createEnvironment, null);
}
// Method reference is not detected with correct nullability
@SuppressWarnings("NullAway")
@Override
public ConfigurableApplicationContext create(@Nullable WebApplicationType webApplicationType) {
try {
@@ -346,7 +346,6 @@ public class Binder {
* @return the bound or created object
* @since 2.2.0
*/
@SuppressWarnings("NullAway") // https://github.com/uber/NullAway/issues/1232
public <T> T bindOrCreate(ConfigurationPropertyName name, Bindable<T> target, @Nullable BindHandler handler) {
return bind(name, target, handler, true);
}
@@ -635,7 +635,6 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
* @return a {@link ConfigurationPropertyName} instance
* @throws InvalidConfigurationPropertyNameException if the name is not valid
*/
@SuppressWarnings("NullAway") // See https://github.com/uber/NullAway/issues/1232
public static ConfigurationPropertyName of(@Nullable CharSequence name) {
return of(name, false);
}
@@ -665,7 +664,6 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
return (elements != null) ? new ConfigurationPropertyName(elements) : null;
}
@SuppressWarnings("NullAway") // See https://github.com/uber/NullAway/issues/1232
private static Elements probablySingleElementOf(CharSequence name) {
return elementsOf(name, false, 1);
}
@@ -347,7 +347,7 @@ class JsonValueWriter {
}
// Lambda isn't detected with the correct nullability
@SuppressWarnings({ "unchecked", "NullAway" })
@SuppressWarnings("unchecked")
private <V> @Nullable V processValue(@Nullable V value, ValueProcessor<?> valueProcessor) {
return (V) LambdaSafe
.callback(ValueProcessor.class, valueProcessor, this.path, new @Nullable Object[] { value })
@@ -84,7 +84,6 @@ final class StructuredLogLayout extends AbstractStringLayout {
private String format;
@PluginBuilderAttribute
@SuppressWarnings("NullAway.Init")
private String charset = StandardCharsets.UTF_8.name();
public Builder setFormat(String format) {
@@ -136,7 +136,6 @@ public class ContextPairs {
* @param <V> the map value type
* @param extractor the extractor used to provide the map
*/
@SuppressWarnings("NullAway") // Doesn't detect lambda with correct nullability
public <V> void addMapEntries(Function<T, Map<String, V>> extractor) {
Function<T, @Nullable Iterable<Map.Entry<String, V>>> elementsExtractor = extractor.andThen(Map::entrySet);
add(elementsExtractor, Map.Entry::getKey, Map.Entry::getValue);
@@ -82,7 +82,6 @@ public record ElasticCommonSchemaProperties(Service service) {
static final Service NONE = new Service(null, null, null, null);
@SuppressWarnings("NullAway") // Doesn't detect lambda with correct nullability
void jsonMembers(Members<?> members) {
members.add("service").usingMembers((service) -> {
service.add("name", this::name).whenHasLength();
@@ -58,7 +58,6 @@ public record GraylogExtendedLogFormatProperties(@Nullable String host, Service
* Add {@link JsonWriter} members for the service.
* @param members the members to add to
*/
@SuppressWarnings("NullAway") // Doesn't detect lambda with correct nullability
public void jsonMembers(JsonWriter.Members<?> members) {
members.add("host", this::host).whenHasLength();
this.service.jsonMembers(members);
@@ -91,7 +90,6 @@ public record GraylogExtendedLogFormatProperties(@Nullable String host, Service
return new Service(version);
}
@SuppressWarnings("NullAway") // Doesn't detect lambda with correct nullability
void jsonMembers(JsonWriter.Members<?> members) {
members.add("_service_version", this::version).whenHasLength();
}
@@ -60,7 +60,6 @@ class BannerTests {
}
@Captor
@SuppressWarnings("NullAway.Init")
private ArgumentCaptor<Class<?>> sourceClassCaptor;
@Test
@@ -57,7 +57,6 @@ class ApplicationPidFileWriterTests {
new String[] {}, mock(ConfigurableApplicationContext.class));
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@BeforeEach
@@ -63,7 +63,6 @@ class ConfigDataEnvironmentPostProcessorImportCombinedWithProfileSpecificIntegra
private SpringApplication application;
@TempDir
@SuppressWarnings("NullAway.Init")
public File temp;
@BeforeEach
@@ -86,7 +86,6 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests {
private SpringApplication application;
@TempDir
@SuppressWarnings("NullAway.Init")
public File temp;
@BeforeEach
@@ -47,31 +47,24 @@ class ConfigDataImporterTests {
private final DeferredLogFactory logFactory = Supplier::get;
@Mock
@SuppressWarnings("NullAway.Init")
private ConfigDataLocationResolvers resolvers;
@Mock
@SuppressWarnings("NullAway.Init")
private ConfigDataLoaders loaders;
@Mock
@SuppressWarnings("NullAway.Init")
private Binder binder;
@Mock
@SuppressWarnings("NullAway.Init")
private ConfigDataLocationResolverContext locationResolverContext;
@Mock
@SuppressWarnings("NullAway.Init")
private ConfigDataLoaderContext loaderContext;
@Mock
@SuppressWarnings("NullAway.Init")
private ConfigDataActivationContext activationContext;
@Mock
@SuppressWarnings("NullAway.Init")
private Profiles profiles;
@BeforeEach
@@ -56,19 +56,15 @@ class ConfigDataLocationResolversTests {
private final DefaultBootstrapContext bootstrapContext = new DefaultBootstrapContext();
@Mock
@SuppressWarnings("NullAway.Init")
private Binder binder;
@Mock
@SuppressWarnings("NullAway.Init")
private ConfigDataLocationResolverContext context;
@Mock
@SuppressWarnings("NullAway.Init")
private Profiles profiles;
@TempDir
@SuppressWarnings("NullAway.Init")
private File tempDir;
@Test
@@ -49,7 +49,6 @@ class ConfigDataResourceNotFoundExceptionTests {
private File missing;
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@BeforeEach
@@ -44,7 +44,6 @@ class ConfigTreeConfigDataLoaderTests {
private final ConfigDataLoaderContext loaderContext = mock(ConfigDataLoaderContext.class);
@TempDir
@SuppressWarnings("NullAway.Init")
Path directory;
@Test
@@ -42,7 +42,6 @@ class ConfigTreeConfigDataLocationResolverTests {
private final ConfigDataLocationResolverContext context = mock(ConfigDataLocationResolverContext.class);
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Test
@@ -40,7 +40,6 @@ class LocationResourceLoaderTests {
private final LocationResourceLoader loader = new LocationResourceLoader(new DefaultResourceLoader());
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Test
@@ -120,7 +120,6 @@ class LoggingApplicationListenerTests {
private final GenericApplicationContext context = new GenericApplicationContext();
@TempDir
@SuppressWarnings("NullAway.Init")
public Path tempDir;
private File logFile;
@@ -54,7 +54,6 @@ import static org.mockito.BDDMockito.then;
class BindConverterTests {
@Mock
@SuppressWarnings("NullAway.Init")
private Consumer<PropertyEditorRegistry> propertyEditorInitializer;
@Test
@@ -44,15 +44,12 @@ import static org.mockito.BDDMockito.then;
class BindResultTests {
@Mock
@SuppressWarnings("NullAway.Init")
private Consumer<String> consumer;
@Mock
@SuppressWarnings("NullAway.Init")
private Function<String, String> mapper;
@Mock
@SuppressWarnings("NullAway.Init")
private Supplier<String> supplier;
@Test
@@ -49,7 +49,6 @@ class BoundPropertiesTrackingBindHandlerTests {
private Binder binder;
@Mock
@SuppressWarnings("NullAway.Init")
private Consumer<ConfigurationProperty> consumer;
@BeforeEach
@@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
class ConfigurationPropertyNameTests {
@Test
@SuppressWarnings("NullAway") // Test null check
void ofNameShouldNotBeNull() {
assertThatIllegalArgumentException().isThrownBy(() -> ConfigurationPropertyName.of(null))
.withMessageContaining("'name' must not be null");
@@ -39,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat;
class StringToFileConverterTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@ConversionServiceTest
@@ -49,7 +49,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
class ConfigTreePropertySourceTests {
@TempDir
@SuppressWarnings("NullAway.Init")
Path directory;
@Test
@@ -44,7 +44,6 @@ import static org.mockito.BDDMockito.then;
class DefaultPropertiesPropertySourceTests {
@Mock
@SuppressWarnings("NullAway.Init")
private Consumer<DefaultPropertiesPropertySource> action;
@Test
@@ -41,7 +41,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
class WritableJsonTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Test
@@ -48,7 +48,6 @@ abstract class AbstractStructuredLoggingTests {
private static final JsonMapper JSON_MAPPER = new JsonMapper();
@Mock
@SuppressWarnings("NullAway.Init")
StructuredLoggingJsonMembersCustomizer<?> customizer;
MockStructuredLoggingJsonMembersCustomizerBuilder<?> customizerBuilder = new MockStructuredLoggingJsonMembersCustomizerBuilder<>(
@@ -36,7 +36,6 @@ import static org.assertj.core.api.Assertions.assertThat;
class Log4j2FileXmlTests extends Log4j2XmlTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Override
@@ -60,7 +60,6 @@ abstract class AbstractStructuredLoggingTests {
private BasicMarkerFactory markerFactory;
@Mock
@SuppressWarnings("NullAway.Init")
StructuredLoggingJsonMembersCustomizer<?> customizer;
MockStructuredLoggingJsonMembersCustomizerBuilder<?> customizerBuilder = new MockStructuredLoggingJsonMembersCustomizerBuilder<>(
@@ -43,7 +43,7 @@ import static org.mockito.BDDMockito.given;
class StructuredLoggingJsonPropertiesJsonMembersCustomizerTests {
@Mock
@SuppressWarnings({ "rawtypes", "NullAway.Init" })
@SuppressWarnings("rawtypes")
private Instantiator instantiator;
@Test
@@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat;
class ApplicationHomeTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@Test
@@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.contentOf;
class ApplicationPidTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@Test
@@ -61,11 +61,9 @@ import static org.mockito.Mockito.never;
abstract class AbstractFilterRegistrationBeanTests {
@Mock
@SuppressWarnings("NullAway.Init")
ServletContext servletContext;
@Mock
@SuppressWarnings("NullAway.Init")
FilterRegistration.Dynamic registration;
@Test
@@ -56,7 +56,6 @@ class DelegatingFilterProxyRegistrationBeanTests extends AbstractFilterRegistrat
}
@Test
@SuppressWarnings("NullAway") // Test null check
void targetBeanNameMustNotBeEmpty() {
assertThatIllegalArgumentException().isThrownBy(() -> new DelegatingFilterProxyRegistrationBean(""))
.withMessageContaining("'targetBeanName' must not be empty");
@@ -39,11 +39,9 @@ import static org.mockito.Mockito.never;
class ServletListenerRegistrationBeanTests {
@Mock
@SuppressWarnings("NullAway.Init")
private ServletContextListener listener;
@Mock
@SuppressWarnings("NullAway.Init")
private ServletContext servletContext;
@Test
@@ -52,11 +52,9 @@ class ServletRegistrationBeanTests {
private final MockServlet servlet = new MockServlet();
@Mock
@SuppressWarnings("NullAway.Init")
private ServletContext servletContext;
@Mock
@SuppressWarnings("NullAway.Init")
private ServletRegistration.Dynamic registration;
@Test
@@ -54,7 +54,6 @@ import static org.assertj.core.api.Assertions.assertThat;
abstract class AbstractJarModeTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
Manifest createManifest(String... entries) {
@@ -34,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
class ContextTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Test
@@ -69,11 +69,9 @@ class ExtractLayersCommandTests {
private static final FileTime LAST_ACCESS_TIME = FileTime.from(NOW.minus(1, ChronoUnit.DAYS));
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Mock
@SuppressWarnings("NullAway.Init")
private Context context;
private File jarFile;
@@ -40,7 +40,6 @@ class HelpCommandTests {
private TestPrintStream out;
@TempDir
@SuppressWarnings("NullAway.Init")
Path temp;
@BeforeEach
@@ -42,7 +42,6 @@ import static org.mockito.Mockito.mock;
class IndexedLayersTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Test
@@ -48,11 +48,9 @@ import static org.mockito.BDDMockito.given;
class ListCommandTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File temp;
@Mock
@SuppressWarnings("NullAway.Init")
private Context context;
private ListCommand command;
@@ -89,7 +89,6 @@ abstract class AbstractPackagerTests<P extends Packager> {
}
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
protected TestJarFile testJarFile;
@@ -39,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat;
class FileUtilsTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
private File outputDirectory;
@@ -342,8 +342,7 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
return isFilterMatch(filter, getFilterEndpoint(endpointBean));
}
// Doesn't detect lambda with correct nullability
@SuppressWarnings({ "unchecked", "NullAway" })
@SuppressWarnings("unchecked")
private boolean isFilterMatch(EndpointFilter<E> filter, E endpoint) {
Boolean result = LambdaSafe.callback(EndpointFilter.class, filter, endpoint)
.withLogger(EndpointDiscoverer.class)
@@ -362,8 +361,7 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
return false;
}
// Doesn't detect lambda with correct nullability
@SuppressWarnings({ "unchecked", "NullAway" })
@SuppressWarnings("unchecked")
private boolean isFilterMatch(OperationFilter<O> filter, Operation operation, EndpointId endpointId,
Access defaultAccess) {
Boolean result = LambdaSafe.callback(OperationFilter.class, filter, operation)
@@ -42,7 +42,6 @@ class EndpointIdTests {
}
@Test
@SuppressWarnings("NullAway") // Test null check
void ofWhenEmptyThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of(""))
.withMessage("'value' must not be empty");
@@ -51,11 +51,9 @@ import static org.mockito.BDDMockito.then;
class CachingOperationInvokerAdvisorTests {
@Mock
@SuppressWarnings("NullAway.Init")
private OperationInvoker invoker;
@Mock
@SuppressWarnings("NullAway.Init")
private Function<EndpointId, @Nullable Long> timeToLive;
private CachingOperationInvokerAdvisor advisor;
@@ -59,11 +59,9 @@ class JmxEndpointExporterTests {
private final List<ExposableJmxEndpoint> endpoints = new ArrayList<>();
@Mock
@SuppressWarnings("NullAway.Init")
private MBeanServer mBeanServer;
@Spy
@SuppressWarnings("NullAway.Init")
private EndpointObjectNameFactory objectNameFactory = new TestEndpointObjectNameFactory();
private JmxEndpointExporter exporter;
@@ -58,15 +58,12 @@ import static org.mockito.Mockito.mock;
class ServletEndpointRegistrarTests {
@Mock
@SuppressWarnings("NullAway.Init")
private ServletContext servletContext;
@Mock
@SuppressWarnings("NullAway.Init")
private ServletRegistration.Dynamic servletDynamic;
@Mock
@SuppressWarnings("NullAway.Init")
private FilterRegistration.Dynamic filterDynamic;
@Test
@@ -45,11 +45,9 @@ import static org.mockito.Mockito.mock;
class RabbitHealthIndicatorTests {
@Mock
@SuppressWarnings("NullAway.Init")
private RabbitTemplate rabbitTemplate;
@Mock
@SuppressWarnings("NullAway.Init")
private Channel channel;
@Test
@@ -69,8 +69,7 @@ public class CacheMetricsRegistrar {
return false;
}
// Lambda isn't detected with the correct nullability
@SuppressWarnings({ "unchecked", "NullAway" })
@SuppressWarnings("unchecked")
private @Nullable MeterBinder getMeterBinder(Cache cache, Tags tags) {
Tags cacheTags = tags.and(getAdditionalTags(cache));
return LambdaSafe.callbacks(CacheMeterBinderProvider.class, this.binderProviders, cache)
@@ -42,7 +42,6 @@ import static org.mockito.Mockito.mock;
class JCacheCacheMeterBinderProviderTests {
@Mock
@SuppressWarnings("NullAway.Init")
private javax.cache.Cache<Object, Object> nativeCache;
@Test
@@ -48,11 +48,9 @@ import static org.mockito.BDDMockito.given;
class SecurityInterceptorTests {
@Mock
@SuppressWarnings("NullAway.Init")
private TokenValidator tokenValidator;
@Mock
@SuppressWarnings("NullAway.Init")
private SecurityService securityService;
private SecurityInterceptor interceptor;
@@ -60,7 +60,6 @@ class TokenValidatorTests {
private static final byte[] DOT = ".".getBytes();
@Mock
@SuppressWarnings("NullAway.Init")
private SecurityService securityService;
private TokenValidator tokenValidator;
@@ -46,11 +46,9 @@ import static org.mockito.BDDMockito.then;
class SecurityInterceptorTests {
@Mock
@SuppressWarnings("NullAway.Init")
private TokenValidator tokenValidator;
@Mock
@SuppressWarnings("NullAway.Init")
private SecurityService securityService;
private SecurityInterceptor interceptor;
@@ -59,7 +59,6 @@ class TokenValidatorTests {
private static final byte[] DOT = ".".getBytes();
@Mock
@SuppressWarnings("NullAway.Init")
private SecurityService securityService;
private TokenValidator tokenValidator;
@@ -31,12 +31,10 @@ public class Country implements Serializable {
@Id
@GeneratedValue
@SuppressWarnings("NullAway.Init")
private Long id;
@Audited
@Column
@SuppressWarnings("NullAway.Init")
private String name;
public Long getId() {
@@ -52,7 +52,6 @@ abstract class AbstractDevToolsIntegrationTests {
protected final JvmLauncher javaLauncher = new JvmLauncher();
@TempDir
@SuppressWarnings("NullAway.Init")
protected static File temp;
private @Nullable LaunchedApplication launchedApplication;
@@ -32,7 +32,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
class TriggerFileFilterTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@Test
@@ -47,15 +47,12 @@ import static org.mockito.Mockito.never;
class ClassPathFileChangeListenerTests {
@Mock
@SuppressWarnings("NullAway.Init")
private ApplicationEventPublisher eventPublisher;
@Mock
@SuppressWarnings("NullAway.Init")
private ClassPathRestartStrategy restartStrategy;
@Mock
@SuppressWarnings("NullAway.Init")
private FileSystemWatcher fileSystemWatcher;
@Test
@@ -34,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
class ChangedFileTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@Test
@@ -38,7 +38,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
class DirectorySnapshotTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
private File directory;
@@ -42,7 +42,6 @@ class FileSnapshotTests {
private static final long MODIFIED = new Date().getTime() - TimeUnit.DAYS.toMillis(10);
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@Test
@@ -54,7 +54,6 @@ class FileSystemWatcherTests {
private final List<Set<ChangedFiles>> changes = Collections.synchronizedList(new ArrayList<>());
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@BeforeEach
@@ -50,27 +50,21 @@ class DelayedLiveReloadTriggerTests {
private static final String URL = "http://localhost:8080";
@Mock
@SuppressWarnings("NullAway.Init")
private OptionalLiveReloadServer liveReloadServer;
@Mock
@SuppressWarnings("NullAway.Init")
private ClientHttpRequestFactory requestFactory;
@Mock
@SuppressWarnings("NullAway.Init")
private ClientHttpRequest errorRequest;
@Mock
@SuppressWarnings("NullAway.Init")
private ClientHttpRequest okRequest;
@Mock
@SuppressWarnings("NullAway.Init")
private ClientHttpResponse errorResponse;
@Mock
@SuppressWarnings("NullAway.Init")
private ClientHttpResponse okResponse;
private DelayedLiveReloadTrigger trigger;
@@ -54,11 +54,9 @@ class HttpHeaderInterceptorTests {
private byte[] body;
@Mock
@SuppressWarnings("NullAway.Init")
private ClientHttpRequestExecution execution;
@Mock
@SuppressWarnings("NullAway.Init")
private ClientHttpResponse response;
private MockHttpServletRequest httpRequest;
@@ -51,11 +51,9 @@ import static org.mockito.Mockito.mock;
class DispatcherFilterTests {
@Mock
@SuppressWarnings("NullAway.Init")
private Dispatcher dispatcher;
@Mock
@SuppressWarnings("NullAway.Init")
private FilterChain chain;
private DispatcherFilter filter;
@@ -52,7 +52,6 @@ import static org.mockito.Mockito.withSettings;
class DispatcherTests {
@Mock
@SuppressWarnings("NullAway.Init")
private AccessManager accessManager;
private final MockHttpServletResponse response = new MockHttpServletResponse();
@@ -43,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat;
class ChangeableUrlsTests {
@TempDir
@SuppressWarnings("NullAway.Init")
File tempDir;
@Test
@@ -40,21 +40,18 @@ class ClassLoaderFileTests {
}
@Test
@SuppressWarnings("NullAway") // Test null check
void addedContentsMustNotBeNull() {
assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(Kind.ADDED, null))
.withMessageContaining("'contents' must not be null");
}
@Test
@SuppressWarnings("NullAway") // Test null check
void modifiedContentsMustNotBeNull() {
assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(Kind.MODIFIED, null))
.withMessageContaining("'contents' must not be null");
}
@Test
@SuppressWarnings("NullAway") // Test null check
void deletedContentsMustBeNull() {
assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(Kind.DELETED, new byte[10]))
.withMessageContaining("'contents' must be null");
@@ -52,7 +52,6 @@ import static org.mockito.BDDMockito.then;
class HttpRestartServerTests {
@Mock
@SuppressWarnings("NullAway.Init")
private RestartServer delegate;
private HttpRestartServer server;
@@ -35,11 +35,9 @@ import static org.assertj.core.api.Assertions.assertThat;
class AutoConfiguredHealthCheckedGrpcComponentTests {
@Mock
@SuppressWarnings("NullAway.Init")
private StatusAggregator statusAggregator;
@Mock
@SuppressWarnings("NullAway.Init")
private StatusMapper statusMapper;
@Test
@@ -41,7 +41,6 @@ import static org.mockito.BDDMockito.given;
class AvailabilityStateHealthIndicatorTests {
@Mock
@SuppressWarnings("NullAway.Init")
private ApplicationAvailability applicationAvailability;
@Test
@@ -46,7 +46,6 @@ class DiskSpaceHealthIndicatorTests {
private static final DataSize TOTAL_SPACE = DataSize.ofKilobytes(10);
@Mock
@SuppressWarnings("NullAway.Init")
private File fileMock;
private HealthIndicator healthIndicator;

Some files were not shown because too many files have changed in this diff Show More