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

Arc - improve producer wildcard type detection #29883

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

manovotn
Copy link
Contributor

Fixes #29836

@manovotn manovotn requested a review from mkouba December 15, 2022 10:38
@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label Dec 15, 2022
@manovotn manovotn force-pushed the producerWildcardDetection branch from 6837423 to 1a321eb Compare December 15, 2022 10:38
@quarkus-bot

This comment has been minimized.

@manovotn
Copy link
Contributor Author

After discussion with @mkouba, we agreed that this scenario should instead of logging throw a DefinitionException based on the following specification section:

If a producer method return type contains a wildcard type parameter or is an array type whose component type contains a wildcard type parameter, the container automatically detects the problem and treats it as a definition error.

(Same applies to producer fields OFC)

@manovotn manovotn force-pushed the producerWildcardDetection branch from 1a321eb to 70d19de Compare December 15, 2022 11:54
@manovotn
Copy link
Contributor Author

@mkouba updated as per discussion.

Following exception is now thrown:

javax.enterprise.inject.spi.DefinitionException: Producer method java.util.List<? extends java.lang.Number> produce() declared on class io.quarkus.arc.processor.TypesTest$Producer contains a parameterized type with a wildcard. This type is not a legal bean type according to CDI specification.

@manovotn manovotn force-pushed the producerWildcardDetection branch from 70d19de to 5f6fd0a Compare December 15, 2022 12:32
@mkouba mkouba added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 15, 2022
@manovotn manovotn force-pushed the producerWildcardDetection branch from 5f6fd0a to b39b96b Compare December 15, 2022 12:38
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@quarkus-bot
Copy link

quarkus-bot bot commented Dec 15, 2022

Failing Jobs - Building b39b96b

Status Name Step Failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
✔️ JVM Tests - JDK 17
✔️ JVM Tests - JDK 17 MacOS M1
✔️ JVM Tests - JDK 18

Failures

⚙️ JVM Tests - JDK 11 Windows #

- Failing: extensions/grpc/deployment 
! Skipped: extensions/opentelemetry/deployment extensions/quartz/deployment extensions/scheduler/deployment and 26 more

📦 extensions/grpc/deployment

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test (default-test) on project quarkus-grpc-deployment:

Please refer to D:\a\quarkus\quarkus\extensions\grpc\deployment\target\surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.

@mkouba mkouba merged commit afe32fa into quarkusio:main Dec 16, 2022
@quarkus-bot quarkus-bot bot added this to the 2.16 - main milestone Dec 16, 2022
@quarkus-bot quarkus-bot bot added kind/bugfix and removed triage/waiting-for-ci Ready to merge when CI successfully finishes labels Dec 16, 2022
@manovotn manovotn deleted the producerWildcardDetection branch December 16, 2022 09:46
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) kind/bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ArC - improve the way a wildcard in a producer return/field type is detected
2 participants