Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@PostConstruct sometimes not working when using higher jakarta inject version #1565

Open
jukzi opened this issue Sep 23, 2024 · 3 comments · May be fixed by #1566
Open

@PostConstruct sometimes not working when using higher jakarta inject version #1565

jukzi opened this issue Sep 23, 2024 · 3 comments · May be fixed by #1566
Labels
bug Something isn't working

Comments

@jukzi
Copy link
Contributor

jukzi commented Sep 23, 2024

org.eclipse.ui.tests.api.workbenchpart.DependencyInjectionViewTest.testDependencyInjectionLifecycle() fails locally.
Enabling debug output in org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(AnnotationProxy, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, List<Class<?>>) reveals
annotated with

 "jakarta.annotation-api:3.0.0:jakarta.annotation.PostConstruct" but was looking for 
 "jakarta.annotation-api:2.1.1:jakarta.annotation.PostConstruct or jakarta.annotation-api:1.3.5:javax.annotation.PostConstruct"

I think it should not matter which API version is used. Only the qualified name jakarta.annotation.PostConstruct should matter

@HannesWell ?

@jukzi jukzi added the bug Something isn't working label Sep 23, 2024
HannesWell added a commit to HannesWell/eclipse.platform that referenced this issue Sep 23, 2024
@HannesWell
Copy link
Member

This should be fixed by #1566.

But where do you get version 3 from? AFAICT it's not in the SDK TP yet.

I think it should not matter which API version is used. Only the qualified name jakarta.annotation.PostConstruct should matter

In general this is right, but I'm not sure that there are no corner cases where just comparing the FQN is not correct.
On the other hand I don't know if there's another good way to support version 2 and 3 of the jakarta.annotation in the same application, so we maybe have no other choice.

HannesWell added a commit to HannesWell/eclipse.platform that referenced this issue Sep 23, 2024
@jukzi
Copy link
Contributor Author

jukzi commented Sep 24, 2024

i have a OOmphed workspace and ended with this v3:
image

@merks
Copy link
Contributor

merks commented Sep 24, 2024

There are two in the target platform via Maven locations:

image

So I do expect there to be two.

HannesWell added a commit to HannesWell/eclipse.platform that referenced this issue Sep 24, 2024
and specifically support jakarta.annotation version 3.0.

Fixes eclipse-platform#1565
HannesWell added a commit to HannesWell/eclipse.platform that referenced this issue Sep 26, 2024
and specifically support jakarta.annotation version 3.0.

Fixes eclipse-platform#1565
@laeubi laeubi changed the title @PostConstruct not working @PostConstruct sometimes not working when using higher jakarta inject version Sep 30, 2024
HannesWell added a commit to HannesWell/eclipse.platform that referenced this issue Oct 2, 2024
and specifically support jakarta.annotation version 3.0.

Fixes eclipse-platform#1565
HannesWell added a commit to HannesWell/eclipse.platform that referenced this issue Oct 2, 2024
and specifically support jakarta.annotation version 3.0.

Fixes eclipse-platform#1565
HannesWell added a commit to HannesWell/eclipse.platform that referenced this issue Oct 4, 2024
and specifically support jakarta.annotation version 3.0.

Fixes eclipse-platform#1565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants