Application startup fails using Lombok's @NonNull on a method annotated with @ConsumeEvent
See original GitHub issueDescribe the bug
When annotating a method parameter with @NonNull for a Vertx Consumer Method (means its annotated with @ConsumeEvent) then the application startup fails, throwing an exception.
Mentioned on: https://github.com/quarkusio/quarkus/discussions/29322
Expected behavior
No exception is thrown when using @NonNull.
Actual behavior
Exception is thrown when using @NonNull, application can not be started.
How to Reproduce?
- Clone the repo: https://github.com/benjaminrau/quarkus-nonnull-reproducer
- Start the application
Output of uname -a
or ver
Linux br-builders-nb 5.14.0-1052-oem #59-Ubuntu SMP Fri Sep 9 09:37:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version “17” 2021-09-14 OpenJDK Runtime Environment (build 17+35-2724) OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
= 2.14.0.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.6.3
Additional information
Noticable is that @NonNull is included in the ClassName for EventBusCodec registration too:
2022-11-23 10:29:52,634 INFO [io.qua.ver.dep.EventBusCodecProcessor] (build-5) Local Message Codec registered for type org.acme.@NonNull HelloEvent
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (1 by maintainers)
Thanks a lot for your efforts! Quarkus is really awesome!
Found it: https://github.com/quarkusio/quarkus/blob/2.14.1.Final/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java#L91
Here,
entry.getKey()
is a JandexType
, soentry.getKey().toString()
may include type annotations. Fix is simple:entry.getKey().name().toString()
.