Commit 6fac2e5
authored
When injecting List<T> dependencies, the DI container now sorts the
bindings by their @priority annotation value in descending order
(highest priority first) to ensure deterministic ordering.
This change ensures that components with higher priority values
appear first in injected lists, providing predictable behavior
for dependency injection scenarios where order matters.
- Modified InjectorImpl.doGetCompiledBinding() to sort bindings
by priority before creating supplier lists
- Added comprehensive tests for priority-based list ordering
- Includes tests for mixed priorities and default priority handling
1 parent 33a6ffe commit 6fac2e5
File tree
2 files changed
+77
-1
lines changed- impl/maven-di/src
- main/java/org/apache/maven/di/impl
- test/java/org/apache/maven/di/impl
2 files changed
+77
-1
lines changedLines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
224 | 230 | | |
225 | 231 | | |
226 | 232 | | |
| |||
Lines changed: 70 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
205 | 219 | | |
206 | 220 | | |
207 | 221 | | |
| |||
213 | 227 | | |
214 | 228 | | |
215 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
216 | 247 | | |
217 | 248 | | |
218 | 249 | | |
| |||
392 | 423 | | |
393 | 424 | | |
394 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
395 | 445 | | |
396 | 446 | | |
397 | 447 | | |
| |||
405 | 455 | | |
406 | 456 | | |
407 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
408 | 478 | | |
0 commit comments