Skip to content

Commit c3d186b

Browse files
committed
Remove superfluous @nonnull declarations
1 parent f8926d6 commit c3d186b

File tree

6 files changed

+13
-19
lines changed

6 files changed

+13
-19
lines changed

Diff for: spring-core/src/main/java/org/springframework/core/metrics/jfr/FlightRecorderStartupStep.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,10 +21,10 @@
2121
import java.util.function.Supplier;
2222

2323
import org.springframework.core.metrics.StartupStep;
24-
import org.springframework.lang.NonNull;
2524

2625
/**
2726
* {@link StartupStep} implementation for the Java Flight Recorder.
27+
*
2828
* <p>This variant delegates to a {@link FlightRecorderStartupEvent JFR event extension}
2929
* to collect and record data in Java Flight Recorder.
3030
*
@@ -114,12 +114,12 @@ public void add(String key, Supplier<String> value) {
114114
add(key, value.get());
115115
}
116116

117-
@NonNull
118117
@Override
119118
public Iterator<Tag> iterator() {
120119
return new TagsIterator();
121120
}
122121

122+
123123
private class TagsIterator implements Iterator<Tag> {
124124

125125
private int idx = 0;

Diff for: spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,7 +63,6 @@
6363

6464
import org.springframework.http.HttpHeaders;
6565
import org.springframework.http.MediaType;
66-
import org.springframework.lang.NonNull;
6766
import org.springframework.lang.Nullable;
6867
import org.springframework.util.Assert;
6968
import org.springframework.util.LinkedCaseInsensitiveMap;
@@ -1020,7 +1019,7 @@ public void setCookies(@Nullable Cookie... cookies) {
10201019
}
10211020
}
10221021

1023-
private static String encodeCookies(@NonNull Cookie... cookies) {
1022+
private static String encodeCookies(Cookie... cookies) {
10241023
return Arrays.stream(cookies)
10251024
.map(c -> c.getName() + '=' + (c.getValue() == null ? "" : c.getValue()))
10261025
.collect(Collectors.joining("; "));

Diff for: spring-test/src/main/java/org/springframework/test/context/jdbc/SqlScriptsTestExecutionListener.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,7 +35,6 @@
3535
import org.springframework.core.io.DefaultResourceLoader;
3636
import org.springframework.core.io.Resource;
3737
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
38-
import org.springframework.lang.NonNull;
3938
import org.springframework.lang.Nullable;
4039
import org.springframework.test.context.TestContext;
4140
import org.springframework.test.context.TestContextAnnotationUtils;
@@ -315,7 +314,6 @@ else if (logger.isDebugEnabled()) {
315314
}
316315
}
317316

318-
@NonNull
319317
private ResourceDatabasePopulator createDatabasePopulator(MergedSqlConfig mergedSqlConfig) {
320318
ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
321319
populator.setSqlScriptEncoding(mergedSqlConfig.getEncoding());

Diff for: spring-web/src/main/java/org/springframework/http/DefaultHttpStatusCode.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import java.io.Serializable;
2020

21-
import org.springframework.lang.NonNull;
2221
import org.springframework.lang.Nullable;
2322

2423
/**
@@ -80,8 +79,8 @@ private int hundreds() {
8079

8180

8281
@Override
83-
public int compareTo(@NonNull HttpStatusCode o) {
84-
return Integer.compare(this.value, o.value());
82+
public int compareTo(HttpStatusCode other) {
83+
return Integer.compare(this.value, other.value());
8584
}
8685

8786
@Override

Diff for: spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,7 +63,6 @@
6363

6464
import org.springframework.http.HttpHeaders;
6565
import org.springframework.http.MediaType;
66-
import org.springframework.lang.NonNull;
6766
import org.springframework.lang.Nullable;
6867
import org.springframework.util.Assert;
6968
import org.springframework.util.LinkedCaseInsensitiveMap;
@@ -1020,7 +1019,7 @@ public void setCookies(@Nullable Cookie... cookies) {
10201019
}
10211020
}
10221021

1023-
private static String encodeCookies(@NonNull Cookie... cookies) {
1022+
private static String encodeCookies(Cookie... cookies) {
10241023
return Arrays.stream(cookies)
10251024
.map(c -> c.getName() + '=' + (c.getValue() == null ? "" : c.getValue()))
10261025
.collect(Collectors.joining("; "));

Diff for: spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerRequest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
import org.springframework.http.converter.HttpMessageConverter;
5959
import org.springframework.http.server.RequestPath;
6060
import org.springframework.http.server.ServletServerHttpRequest;
61-
import org.springframework.lang.NonNull;
6261
import org.springframework.lang.Nullable;
6362
import org.springframework.util.CollectionUtils;
6463
import org.springframework.util.LinkedMultiValueMap;
@@ -486,7 +485,7 @@ public boolean contains(Object o) {
486485
}
487486

488487
@Override
489-
public boolean addAll(@NonNull Collection<? extends Entry<String, Object>> c) {
488+
public boolean addAll(Collection<? extends Entry<String, Object>> c) {
490489
throw new UnsupportedOperationException();
491490
}
492491

@@ -501,7 +500,7 @@ public boolean removeAll(Collection<?> c) {
501500
}
502501

503502
@Override
504-
public boolean retainAll(@NonNull Collection<?> c) {
503+
public boolean retainAll(Collection<?> c) {
505504
throw new UnsupportedOperationException();
506505
}
507506

0 commit comments

Comments
 (0)