Commit 5b02554
committed
Restore supplier-disposal link in ClassRequestor without jakarta
PR #2649 decoupled the E4 injector from jakarta annotations by replacing
the ClassRequestor pseudo-dependency descriptor with an empty array.
That
pseudo-link is what notifies an injected object when its supplier is
disposed. With an empty descriptor the link is no longer established, so
@PreDestroy of objects that only use constructor/@PostConstruct
injection
(no @Inject links) is no longer guaranteed to run before the supplying
context is disposed.
This broke disposal ordering and surfaced as a failure of
PartRenderingEngineTests.testBut336225 ("The shell should not have been
disposed first"), reported in #2700.
Restore a non-empty, optional descriptor without re-introducing jakarta:
use a private marker interface InjectionLink that is never available
from
any supplier together with e4's own @optional annotation. This keeps the
injector free of specific jakarta annotation classes (the goal of #2649)
while re-establishing the supplier-disposal link.
Fixes #27001 parent b721651 commit 5b02554
1 file changed
Lines changed: 26 additions & 1 deletion
File tree
- runtime/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
30 | 55 | | |
31 | 56 | | |
32 | 57 | | |
| |||
0 commit comments