Skip to content

Build fails if a param with a primitive type and type annotation is declared on a method that is called via Invoker #50225

@mkouba

Description

@mkouba

Describe the bug

The build fails if there's a method that accepts a parameter with primitive type and the parameter is annotated with a type annotation and this method is called via jakarta.enterprise.invoke.Invoker API.

import jakarta.validation.constraints.Min;

void ping(@Min(5) int price) { // -> build fails if it's invoked via the Invoker API
}

Expected behavior

No response

Actual behavior

A NPE is thrown from the InvokerGenerator:

Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Set.iterator()" because the return value of "java.util.Map.get(Object)" is null
    at io.quarkus.arc.processor.InvokerGenerator.assignWithUnboxingAndWideningConversion(InvokerGenerator.java:407)
    at io.quarkus.arc.processor.InvokerGenerator.createInvokerClass(InvokerGenerator.java:298)
    at io.quarkus.arc.processor.InvokerGenerator.generate(InvokerGenerator.java:93)
    at io.quarkus.arc.processor.BeanProcessor$6.call(BeanProcessor.java:411)
    at io.quarkus.arc.processor.BeanProcessor$6.call(BeanProcessor.java:408)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1591)

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/arcIssue related to ARC (dependency injection)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions