Skip to content

Commit 5a8ecdf

Browse files
committed
Merge pull request #50701 from msridhar
Closes gh-50701 * gh-50701: Polish "Address new warnings from NullAway 0.13.6" Address new warnings from NullAway 0.13.6
2 parents 5439c67 + 8715efc commit 5a8ecdf

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public <T> AbstractObjectArrayAssert<?, String> getBeanNames(Class<T> type) {
248248
* @throws AssertionError if the application context contains multiple beans of the
249249
* given type
250250
*/
251-
public <T> AbstractObjectAssert<?, T> getBean(Class<T> type) {
251+
public <T> AbstractObjectAssert<?, @Nullable T> getBean(Class<T> type) {
252252
return getBean(type, Scope.INCLUDE_ANCESTORS);
253253
}
254254

@@ -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));

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ kotlinVersion=2.2.21
1919
mavenVersion=3.9.13
2020
mockitoVersion=5.20.0
2121
nativeBuildToolsVersion=0.11.5
22-
nullabilityPluginVersion=0.0.11
22+
nullabilityPluginVersion=0.0.14
2323
snakeYamlVersion=2.5
2424
springFrameworkVersion=7.0.8
2525
springFramework60xVersion=6.0.23

0 commit comments

Comments
 (0)