Repository: quarkusio/quarkus
Issue: CDI events qualifiers not working when abstract superclass is in a library

## Describe the bug
CDI events qualifiers are not working well when abstract superclass is in a library since when implementing the class it will be registered as a general observer instead of one with a qualifier.
Check https://github.com/MarcoMartins86/event_qualifier_issue for more details.

### Expected behavior
If I trigger an important event `http://localhost:8080/Events/Important` should appear:
```text
Library AbstractObserverImportantEvent: Important event message 0 Event qualifiers[[@org.acme.ImportantEvent(), @javax.enterprise.inject.Any()]]
Runner ImportantEventImpl: Important event message 0
```

### Actual behavior
If I trigger an important event `http://localhost:8080/Events/Important` appears:
```text
Library AbstractObserverNormalEvent: Important event message 0 Event qualifiers[[@org.acme.ImportantEvent(), @javax.enterprise.inject.Any()]]
Runner NormalEventImpl: Important event message 0
Library AbstractObserverImportantEvent: Important event message 0 Event qualifiers[[@org.acme.ImportantEvent(), @javax.enterprise.inject.Any()]]
Runner ImportantEventImpl: Important event message 0
```


## To Reproduce
A project that reproduces this https://github.com/MarcoMartins86/event_qualifier_issue

Steps to reproduce the behavior:
1. make
2. Do GET to http://localhost:8080/Events/Important
3. Check the command line for the prints

## Environment (please complete the following information):

### Output of `uname -a` or `ver`
Darwin PT-320323-MBP16 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64

### Output of `java -version`
java version "11.0.9" 2020-10-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.9+7-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.9+7-LTS, mixed mode)

### GraalVM version (if different from Java)

### Quarkus version or git rev
1.12.2.Final

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 11.0.9, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.9.jdk/Contents/Home
Default locale: en_PT, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

## Additional context



Changed files:
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ObserverInfo.java
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/DisposerInfo.java

diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/DisposerInfo.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/DisposerInfo.java
index 9712660d828..175bae52a50 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/DisposerInfo.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/DisposerInfo.java
@@ -86,7 +86,7 @@ Type getDisposedParameterType() {
     MethodParameterInfo initDisposedParam(MethodInfo disposerMethod) {
         List<MethodParameterInfo> disposedParams = new ArrayList<>();
         for (AnnotationInstance annotation : disposerMethod.annotations()) {
-            if (Kind.METHOD_PARAMETER.equals(annotation.target().kind()) && annotation.name().equals(DotNames.DISPOSES)) {
+            if (Kind.METHOD_PARAMETER == annotation.target().kind() && annotation.name().equals(DotNames.DISPOSES)) {
                 disposedParams.add(annotation.target().asMethodParameter());
             }
         }
diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ObserverInfo.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ObserverInfo.java
index 298109e92db..b23b85a08b5 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ObserverInfo.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ObserverInfo.java
@@ -1,5 +1,8 @@
 package io.quarkus.arc.processor;
 
+import static io.quarkus.arc.processor.Annotations.find;
+import static io.quarkus.arc.processor.Annotations.getParameterAnnotations;
+
 import io.quarkus.arc.processor.BuildExtension.BuildContext;
 import io.quarkus.arc.processor.ObserverTransformer.ObserverTransformation;
 import io.quarkus.arc.processor.ObserverTransformer.TransformationContext;
@@ -36,9 +39,11 @@ public class ObserverInfo implements InjectionTargetInfo {
     static ObserverInfo create(BeanInfo declaringBean, MethodInfo observerMethod, Injection injection, boolean isAsync,
             List<ObserverTransformer> transformers, BuildContext buildContext, boolean jtaCapabilities) {
         MethodParameterInfo eventParameter = initEventParam(observerMethod, declaringBean.getDeployment());
-        AnnotationInstance priorityAnnotation = observerMethod.annotation(DotNames.PRIORITY);
+        AnnotationInstance priorityAnnotation = find(
+                getParameterAnnotations(declaringBean.getDeployment(), observerMethod, eventParameter.position()),
+                DotNames.PRIORITY);
         Integer priority;
-        if (priorityAnnotation != null && priorityAnnotation.target().equals(eventParameter)) {
+        if (priorityAnnotation != null) {
             priority = priorityAnnotation.value().asInt();
         } else {
             priority = ObserverMethod.DEFAULT_PRIORITY;
@@ -285,10 +290,9 @@ static TransactionPhase initTransactionPhase(boolean isAsync, BeanDeployment bea
     static Set<AnnotationInstance> initQualifiers(BeanDeployment beanDeployment, MethodInfo observerMethod,
             MethodParameterInfo eventParameter) {
         Set<AnnotationInstance> qualifiers = new HashSet<>();
-        for (AnnotationInstance annotation : beanDeployment.getAnnotations(observerMethod)) {
-            if (annotation.target().equals(eventParameter)) {
-                beanDeployment.extractQualifiers(annotation).forEach(qualifiers::add);
-            }
+        for (AnnotationInstance annotation : getParameterAnnotations(beanDeployment, observerMethod,
+                eventParameter.position())) {
+            beanDeployment.extractQualifiers(annotation).forEach(qualifiers::add);
         }
         return qualifiers;
     }