Retain previous factory method in case of nested invocation with AOT
This commit harmonizes the invocation of a bean supplier with what
SimpleInstantiationStrategy does. Previously, the current factory method
was set to `null` once the invocation completes. This did not take
into account recursive scenarios where an instance supplier triggers
another instance supplier.
For consistency, the thread local is removed now if we attempt to set
the current method to null. SimpleInstantiationStrategy itself uses
the shortcut to align the code as much as possible.
Closes gh-33185
@ -209,12 +209,13 @@ public final class BeanInstanceSupplier<T> extends AutowiredElementResolver impl
@@ -209,12 +209,13 @@ public final class BeanInstanceSupplier<T> extends AutowiredElementResolver impl
@ -54,12 +54,18 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
@@ -54,12 +54,18 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
@ -133,9 +139,9 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
@@ -133,9 +139,9 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
@ -143,12 +149,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
@@ -143,12 +149,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {