-
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
Arc - Inherited Observer methods clash with type variables #25364
Labels
area/arc
Issue related to ARC (dependency injection)
env/windows
Impacts Windows machines
kind/bug
Something isn't working
Milestone
Comments
quarkus-bot
bot
added
area/arc
Issue related to ARC (dependency injection)
env/windows
Impacts Windows machines
labels
May 4, 2022
mkouba
added a commit
to mkouba/quarkus
that referenced
this issue
May 4, 2022
mkouba
added a commit
to mkouba/quarkus
that referenced
this issue
May 4, 2022
mkouba
added a commit
to mkouba/quarkus
that referenced
this issue
May 4, 2022
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
May 5, 2022
- resolves quarkusio#25364 (cherry picked from commit a2142d5)
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
May 5, 2022
- resolves quarkusio#25364 (cherry picked from commit a2142d5)
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
May 12, 2022
- resolves quarkusio#25364 (cherry picked from commit a2142d5)
The fix did not make it into 2.9.0.Final it seems. Should I open a new issue for that? |
@gsmet is it ^ possible? |
2.9.1.Final does contain the fix again. So all is well, I guess. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/arc
Issue related to ARC (dependency injection)
env/windows
Impacts Windows machines
kind/bug
Something isn't working
Describe the bug
If an observer method is defined in a superclass of two bean classes and observes a type variable, then the the concrete type of this type variable in the context of the implementing classes is seemingly not taken into account. It seems that only the bounds at the declaration are taken into account.
Expected behavior
The test shown below should succeed when executed with Arc
Actual behavior
Annotated with
@EnableAutoWeld
the test succeeds. Annotated with@QuarkusTest
the test fails with aClassCastException
:suggesting that the event was delivered to the inherited observer method in
MyBService
. The same happens for async observer methods which I have omitted for brevity.Admittedly, it is not entirely clear (to me) from the CDI Spec that Weld's behaviour is correct and Arc's is incorrect. The Spec DOES say that an observer method must be non-abstract, so the difference in behaviour for a similar test in which the observer method itself is abstract is not that surprising; it's simply something Weld allows and Arc doesn't. But the spec does not forbid calling abstract methods from a non-abstract observer method.
At the very least, Weld's behaviour is the more intuitive (to me) of the two.
How to Reproduce?
Consider this application
and the following test:
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.8.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537) Maven home: C:\Users<me>.m2\wrapper\dists\apache-maven-3.8.4-bin\52ccbt68d252mdldqsfsn03jlf\apache-maven-3.8.4 Java version: 11, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11 Default locale: de_DE, platform encoding: UTF-8 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Additional information
No response
The text was updated successfully, but these errors were encountered: