Skip to content

Remove remaining pseudo dependency of E4-Injector to jakarta annotations#2649

Open
HannesWell wants to merge 1 commit intoeclipse-platform:masterfrom
HannesWell:remove-injector-pseudo-dependency
Open

Remove remaining pseudo dependency of E4-Injector to jakarta annotations#2649
HannesWell wants to merge 1 commit intoeclipse-platform:masterfrom
HannesWell:remove-injector-pseudo-dependency

Conversation

@HannesWell
Copy link
Copy Markdown
Member

@HannesWell HannesWell commented May 4, 2026

This ensures that the E4-Injector does not work with any specific annotation class.

The pseudo dependency was introduced when resolving Bug 301462, but just returning an empty array as dependencies of the ClassRequestor also passes the then added DisposeClassLinkTest.
I stepped through the code a bit when using the ClassRequestor and the pseudoVariable doesn't seem to have an effect.
Or does anyone know a reason to keep it?

Follow-up on

org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
Copy link
Copy Markdown
Member Author

@HannesWell HannesWell May 4, 2026

Choose a reason for hiding this comment

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

Even with invalidJavadoc turned to warning the javadoc links below report errors because the jakarta.annotation/inject annotations are not accessible anymore.
The only way I found to silence the errors was to add them back as additional.bundles in the build.properties below.
Does anyone know a JDT preference to ignore inaccessible types in javadoc? Or is this a bug?

Copy link
Copy Markdown
Contributor

@laeubi laeubi May 5, 2026

Choose a reason for hiding this comment

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

eclipse-jdt/eclipse.jdt.core#4923

Apart from that I think the javadoc references are not that valuable so we can remove them if needed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the pointer.

Apart from that I think the javadoc references are not that valuable so we can remove them if needed.

Yes, they are not essential. But I think they're nice to have and if possible, I'd like to retain them

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Test Results

0 files   -     54  0 suites   - 54   0s ⏱️ - 37m 9s
0 tests  -  4 665  0 ✅  -  4 643  0 💤  -  22  0 ❌ ±0 
0 runs   - 12 435  0 ✅  - 12 279  0 💤  - 156  0 ❌ ±0 

Results for commit 459844e. ± Comparison against base commit a877760.

♻️ This comment has been updated with latest results.

@akurtakov
Copy link
Copy Markdown
Member

That way the DI will not make sure there is at least one annotation provider - it opens the door for products crafted with either javax or jakarta or both or none even.
This might have the implication that target platforms will have neither thus projects need modifications in their target platforms in order to migrate to new eclipse version.

@laeubi
Copy link
Copy Markdown
Contributor

laeubi commented May 5, 2026

The pseudo dependency was introduced when resolving Bug 301462, but just returning an empty array as dependencies of the ClassRequestor also passes the then added DisposeClassLinkTest.

Sadly the bugzilla link is inaccessible - do you have a copy of what this is talking about?

I stepped through the code a bit when using the ClassRequestor and the pseudoVariable doesn't seem to have an effect.

Is this maybe somewhere else used (e.g. via reflection?) as it is a public static field ... it might be used for some kind of triggering a (reinjection) of dependencies.

@HeikoKlare HeikoKlare force-pushed the remove-injector-pseudo-dependency branch from 55a1c43 to 6ff7e39 Compare May 5, 2026 12:01
@HannesWell
Copy link
Copy Markdown
Member Author

The pseudo dependency was introduced when resolving Bug 301462, but just returning an empty array as dependencies of the ClassRequestor also passes the then added DisposeClassLinkTest.

Sadly the bugzilla link is inaccessible - do you have a copy of what this is talking about?

Bugzilla seems to have had some temporary issues today. It was available when I wrote the comment and is now available again for me. But besides that the resolving commit might provide more context: 6cf3c7c

I stepped through the code a bit when using the ClassRequestor and the pseudoVariable doesn't seem to have an effect.

Is this maybe somewhere else used (e.g. via reflection?) as it is a public static field ... it might be used for some kind of triggering a (reinjection) of dependencies.

I didn't find any such reflective reference. And something like that was also not done in the commit that introduced that class. My assumption is that it was just added to return a non empty array in calcDependentObjects().
But as far as I can tell, just returning an empty array seems to have now drawbacks. The DisposeClassLinkTest, introduced with 6cf3c7c, still passes.

@HannesWell
Copy link
Copy Markdown
Member Author

That way the DI will not make sure there is at least one annotation provider - it opens the door for products crafted with either javax or jakarta or both or none even. This might have the implication that target platforms will have neither thus projects need modifications in their target platforms in order to migrate to new eclipse version.

That's in theory correct, but the other very basic e4-core/di Plug-ins still require it:
grafik

Therefore I'd assume that the chances are relatively low that one can really avoid the jakarta annotation bundles or that one would not have them in the in the TP transitively. But the chances are not zero.

My primary goal was to make the o.e.e4.core.di independent from any specific annotation package in order to ensure by design that it doesn't rely on specific class instances but just relies on names.

This ensures that the E4-Injector does not work with any specific
annotation class.
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.

3 participants