mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Address new warnings from NullAway 0.13.6
Signed-off-by: Manu Sridharan <msridhar@gmail.com> See gh-50701
This commit is contained in:
committed by
Andy Wilkinson
parent
5439c67267
commit
2b7f6f3c69
+3
-3
@@ -269,7 +269,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
|
||||
* @throws AssertionError if the application context contains multiple beans of the
|
||||
* given type
|
||||
*/
|
||||
public <T> AbstractObjectAssert<?, T> getBean(Class<T> type, Scope scope) {
|
||||
public <T> AbstractObjectAssert<?, @Nullable T> getBean(Class<T> type, Scope scope) {
|
||||
Assert.notNull(scope, "'scope' must not be null");
|
||||
if (this.startupFailure != null) {
|
||||
throwAssertionError(
|
||||
@@ -329,7 +329,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
|
||||
* is found
|
||||
* @throws AssertionError if the application context did not start
|
||||
*/
|
||||
public AbstractObjectAssert<?, Object> getBean(String name) {
|
||||
public AbstractObjectAssert<?, @Nullable Object> getBean(String name) {
|
||||
if (this.startupFailure != null) {
|
||||
throwAssertionError(
|
||||
contextFailedToStartWhenExpecting(this.startupFailure, "to contain a bean of name:%n <%s>", name));
|
||||
@@ -356,7 +356,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
|
||||
* name but a different type
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> AbstractObjectAssert<?, T> getBean(String name, Class<T> type) {
|
||||
public <T> AbstractObjectAssert<?, @Nullable T> getBean(String name, Class<T> type) {
|
||||
if (this.startupFailure != null) {
|
||||
throwAssertionError(contextFailedToStartWhenExpecting(this.startupFailure,
|
||||
"to contain a bean of name:%n <%s> (%s)", name, type));
|
||||
|
||||
Reference in New Issue
Block a user