Skip to content

@AroundConstruct method returning Object works only if it's private #1791

@jmartisk

Description

@jmartisk

InterceptorGenerator incorrectly assumes that return type from an @AroundConstruct method is void, but the specification allows Object too (https://docs.oracle.com/javaee/7/api/javax/interceptor/AroundConstruct.html).

When the method is private, it will work because InterceptorGenerator will use a reflection fallback and find the method to invoke by name and param types only (so the return type doesn't matter): https://github.com/quarkusio/quarkus/blob/0.12.0/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorGenerator.java#L245

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions