diff --git a/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java b/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java index 954877fdf1..f318d1eb23 100644 --- a/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 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. @@ -491,7 +491,7 @@ public class GenericApplicationContext extends AbstractApplicationContext implem * (may be {@code null} or empty) * @since 5.2 (since 5.0 on the AnnotationConfigApplicationContext subclass) */ - public void registerBean(Class beanClass, Object... constructorArgs) { + public void registerBean(Class beanClass, @Nullable Object... constructorArgs) { registerBean(null, beanClass, constructorArgs); } @@ -506,7 +506,7 @@ public class GenericApplicationContext extends AbstractApplicationContext implem * (may be {@code null} or empty) * @since 5.2 (since 5.0 on the AnnotationConfigApplicationContext subclass) */ - public void registerBean(@Nullable String beanName, Class beanClass, Object... constructorArgs) { + public void registerBean(@Nullable String beanName, Class beanClass, @Nullable Object... constructorArgs) { registerBean(beanName, beanClass, (Supplier) null, bd -> { for (Object arg : constructorArgs) {