Skip to content

Commit 4620d86

Browse files
committed
Refine GenericApplicationContext#registerBean nullness
Closes gh-34343
1 parent 042b78f commit 4620d86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -491,7 +491,7 @@ private void preDetermineBeanType(String beanName, List<SmartInstantiationAwareB
491491
* (may be {@code null} or empty)
492492
* @since 5.2 (since 5.0 on the AnnotationConfigApplicationContext subclass)
493493
*/
494-
public <T> void registerBean(Class<T> beanClass, Object... constructorArgs) {
494+
public <T> void registerBean(Class<T> beanClass, @Nullable Object... constructorArgs) {
495495
registerBean(null, beanClass, constructorArgs);
496496
}
497497

@@ -506,7 +506,7 @@ public <T> void registerBean(Class<T> beanClass, Object... constructorArgs) {
506506
* (may be {@code null} or empty)
507507
* @since 5.2 (since 5.0 on the AnnotationConfigApplicationContext subclass)
508508
*/
509-
public <T> void registerBean(@Nullable String beanName, Class<T> beanClass, Object... constructorArgs) {
509+
public <T> void registerBean(@Nullable String beanName, Class<T> beanClass, @Nullable Object... constructorArgs) {
510510
registerBean(beanName, beanClass, (Supplier<T>) null,
511511
bd -> {
512512
for (Object arg : constructorArgs) {

0 commit comments

Comments
 (0)