From a27c09220829b6dfe6b383017a7b1d451ed3e0f9 Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Mon, 23 Jun 2025 09:00:16 +0800 Subject: [PATCH] Polish BeanFactoryAspectInstanceFactory See https://github.com/spring-projects/spring-framework/issues/35074#issuecomment-2994607881 Signed-off-by: Yanming Zhou --- .../aspectj/annotation/BeanFactoryAspectInstanceFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java index 33d7efd43e78..3fc01fa02ac6 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java @@ -129,7 +129,7 @@ public int getOrder() { Class type = this.beanFactory.getType(this.name); if (type != null) { if (Ordered.class.isAssignableFrom(type) && this.beanFactory.isSingleton(this.name)) { - return ((Ordered) this.beanFactory.getBean(this.name)).getOrder(); + return ((Ordered) getAspectInstance()).getOrder(); } return OrderUtils.getOrder(type, Ordered.LOWEST_PRECEDENCE); }