From 4620d864dde1498d6a5fa1cb87bbea553cd092b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= <141109+sdeleuze@users.noreply.github.com> Date: Thu, 30 Jan 2025 12:26:31 +0100 Subject: [PATCH] Refine GenericApplicationContext#registerBean nullness Closes gh-34343 --- .../context/support/GenericApplicationContext.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) {