Skip to content

Commit dff33ae

Browse files
quaffwilkinsona
authored andcommitted
Remove unnecessary @Nullables from local variable declarations
See gh-50866 Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
1 parent 428963e commit dff33ae

4 files changed

Lines changed: 5 additions & 8 deletions

File tree

module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/autoconfigure/jsontest/app/ExampleJacksonComponent.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.Date;
2020
import java.util.UUID;
2121

22-
import org.jspecify.annotations.Nullable;
2322
import tools.jackson.core.JsonGenerator;
2423
import tools.jackson.core.JsonParser;
2524
import tools.jackson.databind.DeserializationContext;
@@ -45,11 +44,11 @@ static class Serializer extends ObjectValueSerializer<ExampleCustomObject> {
4544
@Override
4645
protected void serializeObject(ExampleCustomObject value, JsonGenerator jgen, SerializationContext context) {
4746
jgen.writeStringProperty("value", value.value());
48-
@Nullable Date date = value.date();
47+
Date date = value.date();
4948
if (date != null) {
5049
jgen.writeNumberProperty("date", date.getTime());
5150
}
52-
@Nullable UUID uuid = value.uuid();
51+
UUID uuid = value.uuid();
5352
if (uuid != null) {
5453
jgen.writeStringProperty("uuid", uuid.toString());
5554
}

module/spring-boot-micrometer-metrics/src/main/java/org/springframework/boot/micrometer/metrics/autoconfigure/PropertiesMeterFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public DistributionStatisticConfig configure(Meter.Id id, DistributionStatisticC
125125
if (values.isEmpty()) {
126126
return defaultValue;
127127
}
128-
@Nullable T result = doLookup(values, id);
128+
T result = doLookup(values, id);
129129
return (result != null) ? result : values.getOrDefault("all", defaultValue);
130130
}
131131

smoke-test/spring-boot-smoke-test-integration/src/test/java/smoketest/integration/producer/ProducerApplication.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.io.File;
2020
import java.io.FileOutputStream;
2121

22-
import org.jspecify.annotations.Nullable;
2322
import smoketest.integration.ServiceProperties;
2423

2524
import org.springframework.boot.ApplicationArguments;
@@ -41,7 +40,7 @@ public ProducerApplication(ServiceProperties serviceProperties) {
4140

4241
@Override
4342
public void run(ApplicationArguments args) throws Exception {
44-
@Nullable File inputDir = this.serviceProperties.getInputDir();
43+
File inputDir = this.serviceProperties.getInputDir();
4544
Assert.notNull(inputDir, "No inputDir configured");
4645
inputDir.mkdirs();
4746
if (!args.getNonOptionArgs().isEmpty()) {

smoke-test/spring-boot-smoke-test-parent-context/src/test/java/smoketest/parent/producer/ProducerApplication.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.io.File;
2020
import java.io.FileOutputStream;
2121

22-
import org.jspecify.annotations.Nullable;
2322
import smoketest.parent.ServiceProperties;
2423

2524
import org.springframework.boot.ApplicationArguments;
@@ -41,7 +40,7 @@ public ProducerApplication(ServiceProperties serviceProperties) {
4140

4241
@Override
4342
public void run(ApplicationArguments args) throws Exception {
44-
@Nullable File inputDir = this.serviceProperties.getInputDir();
43+
File inputDir = this.serviceProperties.getInputDir();
4544
Assert.notNull(inputDir, "No inputDir configured");
4645
inputDir.mkdirs();
4746
if (!args.getNonOptionArgs().isEmpty()) {

0 commit comments

Comments
 (0)