Skip to content

Restore supplier-disposal link in ClassRequestor without jakarta#2707

Merged
HannesWell merged 1 commit into
eclipse-platform:masterfrom
akurtakov:master
Jun 4, 2026
Merged

Restore supplier-disposal link in ClassRequestor without jakarta#2707
HannesWell merged 1 commit into
eclipse-platform:masterfrom
akurtakov:master

Conversation

@akurtakov

Copy link
Copy Markdown
Member

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 #2700

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   33m 55s ⏱️ - 2m 54s
 4 671 tests ±0   4 649 ✅ ±0   22 💤 ±0  0 ❌ ±0 
11 907 runs  ±0  11 754 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit 1344c9a. ± Comparison against base commit b721651.

♻️ This comment has been updated with latest results.

The E4 Injector was decoupled from jakarta annotations by replacing
the ClassRequestor pseudo-dependency descriptor with an empty array, in:
- eclipse-platform#2649

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.

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 the previous change) while re-establishing the supplier-disposal
link.

Fixes eclipse-platform#2700

@HannesWell HannesWell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Alex.

I was able to verify locally that this fixes the test in question.
Furthermore I tried to simplify this and to avoid the PSEUDO_VARIABLE, by creating the used types directly. But for the Annotation instantiation this was eventually not simpler.
So I just made the code and comments a bit less verbose, as we discussed in private.

Will submit this once the build is ready to have the test failure fixed with tonight’s I-build.
And since it's similar to the state from #2649, I think there is not much discussion necessary.

@HannesWell HannesWell merged commit a0b74bc into eclipse-platform:master Jun 4, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test error in I-Build org.eclipse.e4.ui.tests.workbench.PartRenderingEngineTests testBut336225()

2 participants