mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Remove unnecessary @Nullables from local variable declarations
See gh-50866 Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
This commit is contained in:
committed by
Andy Wilkinson
parent
428963e02d
commit
dff33aec55
+2
-3
@@ -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());
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -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()) {
|
||||
|
||||
+1
-2
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user