-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
NPE on build when decorator is injected a delegate that is a subtype of the decorated interface #22142
Comments
Unfortunately I haven't been able to create a small reproducer for now. Hopefully the stacktrace gives an idea of what might be happening. Happy to answer any questions that might help figuring this out or taking any suggestions on what could be causing the error to try to create a small reproducer. |
It seems it's related to priority of decorators cause if I add a priority to the decorator that uses the subtype the build works fine. So that it's easier to understand, I have something like this: public interface A {}
@ApplicationScoped
public class B implements A {}
@Decorator
public class C implements A {
private final A a;
@Inject
public C(@Delegate A a) {
this.a = a;
}
}
@Decorator
public class D implements A {
private final A a;
@Inject
public D(@Delegate B b) {
this.a = b;
}
} but I still haven't been able to make it fail on a small reproducer like this. |
Interesting... @mkouba would the test you added not pass without the changes? Anyway, I can test if this fixes my issue as soon as there's a release with those changes. Are there daily builds or similar? |
Well, I only added the
I don't think that this PR can actually fix your problem but +1 if you can try it ;-)
I believe that snapshots are deployed to https://s01.oss.sonatype.org/content/repositories/snapshots/ once a day or so. But it's very easy to build the snapshot locally - just clone the repo and run |
@xtaixe would you care to verify that the problem still exists? |
@mkouba yes, still happening on |
Well, in that case we'll need more information. Would you care to create a simple reproducer app/test? |
I already tried unsuccessfully at the time I raised the issue. I'll try again if I find the time, but I doubt my luck will change. |
Closing as we never got a reproducer |
Describe the bug
Getting:
when using a subtype as a delegate instead of the decorated interface.
Expected behavior
Project builds and decorator and beans are handled properly.
Actual behavior
NPE on build
How to Reproduce?
No response
Output of
uname -a
orver
Darwin xtaixe 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:42 PDT 2021; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64
Output of
java -version
openjdk 11.0.13 2021-10-19 OpenJDK Runtime Environment GraalVM CE 21.3.0 (build 11.0.13+7-jvmci-21.3-b05) OpenJDK 64-Bit Server VM GraalVM CE 21.3.0 (build 11.0.13+7-jvmci-21.3-b05, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.5.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.4
Additional information
No response
The text was updated successfully, but these errors were encountered: