Skip to content

Commit 2b7f6f3

Browse files
msridharwilkinsona
authored andcommitted
Address new warnings from NullAway 0.13.6
Signed-off-by: Manu Sridharan <msridhar@gmail.com> See gh-50701
1 parent 5439c67 commit 2b7f6f3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

core/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public <T> AbstractObjectAssert<?, T> getBean(Class<T> type) {
269269
* @throws AssertionError if the application context contains multiple beans of the
270270
* given type
271271
*/
272-
public <T> AbstractObjectAssert<?, T> getBean(Class<T> type, Scope scope) {
272+
public <T> AbstractObjectAssert<?, @Nullable T> getBean(Class<T> type, Scope scope) {
273273
Assert.notNull(scope, "'scope' must not be null");
274274
if (this.startupFailure != null) {
275275
throwAssertionError(
@@ -329,7 +329,7 @@ private boolean isPrimary(String name, Scope scope) {
329329
* is found
330330
* @throws AssertionError if the application context did not start
331331
*/
332-
public AbstractObjectAssert<?, Object> getBean(String name) {
332+
public AbstractObjectAssert<?, @Nullable Object> getBean(String name) {
333333
if (this.startupFailure != null) {
334334
throwAssertionError(
335335
contextFailedToStartWhenExpecting(this.startupFailure, "to contain a bean of name:%n <%s>", name));
@@ -356,7 +356,7 @@ public AbstractObjectAssert<?, Object> getBean(String name) {
356356
* name but a different type
357357
*/
358358
@SuppressWarnings("unchecked")
359-
public <T> AbstractObjectAssert<?, T> getBean(String name, Class<T> type) {
359+
public <T> AbstractObjectAssert<?, @Nullable T> getBean(String name, Class<T> type) {
360360
if (this.startupFailure != null) {
361361
throwAssertionError(contextFailedToStartWhenExpecting(this.startupFailure,
362362
"to contain a bean of name:%n <%s> (%s)", name, type));

0 commit comments

Comments
 (0)