Add more @Nullable parameters based on null usage

Issue: SPR-15540
This commit is contained in:
Sebastien Deleuze
2017-05-31 21:35:52 +02:00
parent f9b319d3ba
commit 1f28825f9d
219 changed files with 441 additions and 355 deletions

View File

@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.web.util.WebUtils;
@@ -91,7 +92,7 @@ public class MockAsyncContext implements AsyncContext {
}
@Override
public void dispatch(ServletContext context, String path) {
public void dispatch(@Nullable ServletContext context, String path) {
this.dispatchedPath = path;
for (Runnable r : this.dispatchHandlers) {
r.run();

View File

@@ -873,7 +873,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
}
@Override
public AsyncContext startAsync(ServletRequest request, ServletResponse response) {
public AsyncContext startAsync(ServletRequest request, @Nullable ServletResponse response) {
Assert.state(this.asyncSupported, "Async not supported");
this.asyncStarted = true;
this.asyncContext = new MockAsyncContext(request, response);
@@ -1088,7 +1088,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
return this.method;
}
public void setPathInfo(String pathInfo) {
public void setPathInfo(@Nullable String pathInfo) {
this.pathInfo = pathInfo;
}

View File

@@ -303,7 +303,7 @@ class StubWebApplicationContext implements WebApplicationContext {
//---------------------------------------------------------------------
@Override
public String getMessage(String code, @Nullable Object args[], String defaultMessage, Locale locale) {
public String getMessage(String code, @Nullable Object args[], @Nullable String defaultMessage, Locale locale) {
return this.messageSource.getMessage(code, args, defaultMessage, locale);
}
@@ -400,13 +400,13 @@ class StubWebApplicationContext implements WebApplicationContext {
}
@Override
public Object resolveDependency(DependencyDescriptor descriptor, String requestingBeanName) {
public Object resolveDependency(DependencyDescriptor descriptor, @Nullable String requestingBeanName) {
throw new UnsupportedOperationException("Dependency resolution not supported");
}
@Override
public Object resolveDependency(DependencyDescriptor descriptor, String requestingBeanName,
Set<String> autowiredBeanNames, TypeConverter typeConverter) {
@Nullable Set<String> autowiredBeanNames, @Nullable TypeConverter typeConverter) {
throw new UnsupportedOperationException("Dependency resolution not supported");
}