Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2026 Contributors to the Eclipse Foundation.
* Copyright (c) 2013, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -161,9 +162,20 @@ public Object get() {
Object bean = ctx.getBean(beanName);
if (bean instanceof Advised) {
try {
// Unwrap the bean and inject the values inside of it
Object localBean = ((Advised) bean).getTargetSource().getTarget();
injectionManager.inject(localBean);
Object target = bean;
// Recursively unwrap the bean until we find the real POJO and then inject the values inside of it
while (target instanceof Advised) {
try {
Object nextTarget = ((Advised) target).getTargetSource().getTarget();
if (nextTarget == null || nextTarget == target) {
break;
}
target = nextTarget;
} catch (Exception e) {
break;
}
}
injectionManager.inject(target);
} catch (Exception e) {
// Ignore and let the injection happen as it normally would.
injectionManager.inject(bean);
Expand Down
Loading