Nullability refinements (based on IntelliJ IDEA 2018.1 introspection)

Issue: SPR-15756
This commit is contained in:
Juergen Hoeller
2018-03-29 23:50:17 +02:00
parent 1cc513d7db
commit d553ddc5b3
17 changed files with 84 additions and 107 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@ public abstract class AbstractView implements View, ApplicationContextAware {
* Set the supported media types for this view.
* Default is "text/html;charset=UTF-8".
*/
public void setSupportedMediaTypes(@Nullable List<MediaType> supportedMediaTypes) {
public void setSupportedMediaTypes(List<MediaType> supportedMediaTypes) {
Assert.notEmpty(supportedMediaTypes, "MediaType List must not be empty");
this.mediaTypes.clear();
this.mediaTypes.addAll(supportedMediaTypes);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@ import java.util.List;
import org.springframework.core.Ordered;
import org.springframework.http.MediaType;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -54,7 +53,7 @@ public abstract class ViewResolverSupport implements Ordered {
* Set the supported media types for this view.
* Default is "text/html;charset=UTF-8".
*/
public void setSupportedMediaTypes(@Nullable List<MediaType> supportedMediaTypes) {
public void setSupportedMediaTypes(List<MediaType> supportedMediaTypes) {
Assert.notEmpty(supportedMediaTypes, "MediaType List must not be empty");
this.mediaTypes.clear();
this.mediaTypes.addAll(supportedMediaTypes);