Remove unnecessary @Nullables from local variable declarations

See gh-50866

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
This commit is contained in:
Yanming Zhou
2026-06-28 10:39:07 +01:00
committed by Andy Wilkinson
parent 428963e02d
commit dff33aec55
4 changed files with 5 additions and 8 deletions
@@ -19,7 +19,6 @@ package org.springframework.boot.jackson.autoconfigure.jsontest.app;
import java.util.Date;
import java.util.UUID;
import org.jspecify.annotations.Nullable;
import tools.jackson.core.JsonGenerator;
import tools.jackson.core.JsonParser;
import tools.jackson.databind.DeserializationContext;
@@ -45,11 +44,11 @@ public class ExampleJacksonComponent {
@Override
protected void serializeObject(ExampleCustomObject value, JsonGenerator jgen, SerializationContext context) {
jgen.writeStringProperty("value", value.value());
@Nullable Date date = value.date();
Date date = value.date();
if (date != null) {
jgen.writeNumberProperty("date", date.getTime());
}
@Nullable UUID uuid = value.uuid();
UUID uuid = value.uuid();
if (uuid != null) {
jgen.writeStringProperty("uuid", uuid.toString());
}
@@ -125,7 +125,7 @@ public class PropertiesMeterFilter implements MeterFilter {
if (values.isEmpty()) {
return defaultValue;
}
@Nullable T result = doLookup(values, id);
T result = doLookup(values, id);
return (result != null) ? result : values.getOrDefault("all", defaultValue);
}
@@ -19,7 +19,6 @@ package smoketest.integration.producer;
import java.io.File;
import java.io.FileOutputStream;
import org.jspecify.annotations.Nullable;
import smoketest.integration.ServiceProperties;
import org.springframework.boot.ApplicationArguments;
@@ -41,7 +40,7 @@ public class ProducerApplication implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
@Nullable File inputDir = this.serviceProperties.getInputDir();
File inputDir = this.serviceProperties.getInputDir();
Assert.notNull(inputDir, "No inputDir configured");
inputDir.mkdirs();
if (!args.getNonOptionArgs().isEmpty()) {
@@ -19,7 +19,6 @@ package smoketest.parent.producer;
import java.io.File;
import java.io.FileOutputStream;
import org.jspecify.annotations.Nullable;
import smoketest.parent.ServiceProperties;
import org.springframework.boot.ApplicationArguments;
@@ -41,7 +40,7 @@ public class ProducerApplication implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
@Nullable File inputDir = this.serviceProperties.getInputDir();
File inputDir = this.serviceProperties.getInputDir();
Assert.notNull(inputDir, "No inputDir configured");
inputDir.mkdirs();
if (!args.getNonOptionArgs().isEmpty()) {