From b3671d131f8cd05505362458a31aaea60cc7ef6d Mon Sep 17 00:00:00 2001 From: Matej Novotny Date: Wed, 22 Feb 2023 17:09:38 +0100 Subject: [PATCH] Arc - Validate whether interceptors declare producer methods --- .../arc/processor/InterceptorInfo.java | 16 ++++ .../illegal/DisposerInInterceptorTest.java | 73 ++++++++++++++++++ .../ProducerFieldInInterceptorTest.java | 73 ++++++++++++++++++ .../ProducerMethodInInterceptorTest.java | 76 +++++++++++++++++++ 4 files changed, 238 insertions(+) create mode 100644 independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/producer/disposer/illegal/DisposerInInterceptorTest.java create mode 100644 independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/producer/illegal/ProducerFieldInInterceptorTest.java create mode 100644 independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/producer/illegal/ProducerMethodInInterceptorTest.java diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorInfo.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorInfo.java index 2438fe6045ac9..444f04ec4807a 100644 --- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorInfo.java +++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/InterceptorInfo.java @@ -9,12 +9,14 @@ import java.util.List; import java.util.Set; +import jakarta.enterprise.inject.spi.DefinitionException; import jakarta.enterprise.inject.spi.InterceptionType; import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.AnnotationTarget; import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; +import org.jboss.jandex.FieldInfo; import org.jboss.jandex.MethodInfo; import org.jboss.jandex.Type; import org.jboss.jandex.Type.Kind; @@ -57,6 +59,12 @@ public class InterceptorInfo extends BeanInfo implements Comparable