Commit a6099fa
Apply InstanceSupplier post-processing when bypassed by explicit args
When getBean(name, args) is called with explicit constructor arguments,
the InstanceSupplier is intentionally bypassed (gh-32657). However, in
AOT mode, @Autowired setter/field injection is baked into the
InstanceSupplier's andThen() chain and AutowiredAnnotationBeanPostProcessor
is excluded from runtime registration. This means the autowiring
post-processing is lost when the supplier is bypassed.
Add InstanceSupplier.postProcessInstance() to allow applying only the
post-processing steps (from andThen()) to an already-created instance
without re-invoking creation. Call this from doCreateBean() when the
instance supplier was bypassed due to explicit args.
Closes gh-35871
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>1 parent 227bc19 commit a6099fa
File tree
4 files changed
+820
-0
lines changed- spring-beans/src/main/java/org/springframework/beans/factory/support
- spring-context/src/test/java/org/springframework/context/aot
4 files changed
+820
-0
lines changedLines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
601 | 615 | | |
602 | 616 | | |
603 | 617 | | |
| |||
1285 | 1299 | | |
1286 | 1300 | | |
1287 | 1301 | | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
1288 | 1319 | | |
1289 | 1320 | | |
1290 | 1321 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1029 | 1049 | | |
1030 | 1050 | | |
1031 | 1051 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
67 | 86 | | |
68 | 87 | | |
69 | 88 | | |
| |||
83 | 102 | | |
84 | 103 | | |
85 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
86 | 111 | | |
87 | 112 | | |
88 | 113 | | |
| |||
0 commit comments