Repository: quarkusio/quarkus
Issue: Jandex warning at boot time about JsonString

**Describe the bug**

At system start, the following warning is printed:

```
2020-07-15 11:54:34,465 WARN  [io.qua.dep.ste.ReflectiveHierarchyStep] (build-32) Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:
        - javax.json.JsonString (source: com.redhat.cloud.policies.app.rest.PolicyCrudService[javax.ws.rs.core.Response validateName(@NotNull javax.json.JsonString policyName, java.util.UUID id)])
Consider adding them to the index either by creating a Jandex index for your dependency via the Maven plugin, an empty META-INF/beans.xml or quarkus.index-dependency properties.");.

```

Code looks like

```
  @POST
  @Path("/validate-name")
  public Response validateName(@NotNull JsonString policyName, @QueryParam("id") UUID id) {

```

`JsonString` is pulled into Quarkus via 

* io.quarkus:quarkus-resteasy-jsonb:1.6.0.Final
** org.jboss.resteasy:resteasy-json-binding-provider:4.5.5.Final
*** org.glassfish:jakarta.json:1.1.6

so I would expect that this is already registered in Quarkus by default. 
This warning was not printed before 1.6 

**Expected behavior**

Print no warning, as it is already registered



Changed files:
extensions/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java
core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveHierarchyBuildItem.java

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveHierarchyBuildItem.java b/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveHierarchyBuildItem.java
index ed0d30f703f..3fd15dfa0be 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveHierarchyBuildItem.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveHierarchyBuildItem.java
@@ -32,9 +32,9 @@
 public final class ReflectiveHierarchyBuildItem extends MultiBuildItem {
 
     private final Type type;
-    private IndexView index;
+    private final IndexView index;
     private final Predicate<DotName> ignorePredicate;
-    private String source;
+    private final String source;
 
     public ReflectiveHierarchyBuildItem(Type type) {
         this(type, DefaultIgnorePredicate.INSTANCE);
diff --git a/extensions/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java b/extensions/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java
index 1e67bf64acf..e73d6c46758 100755
--- a/extensions/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java
+++ b/extensions/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java
@@ -740,8 +740,9 @@ private static void registerReflectionForSerialization(BuildProducer<ReflectiveC
         // Declare reflection for all the types implicated in the Rest end points (return types and parameters).
         // It might be needed for serialization.
         for (DotName annotationType : annotations) {
-            scanMethodParameters(annotationType, reflectiveHierarchy, index);
-            scanMethodParameters(annotationType, reflectiveHierarchy, beanArchiveIndex);
+            Set<AnnotationInstance> processedAnnotations = new HashSet<>();
+            scanMethods(annotationType, reflectiveHierarchy, beanArchiveIndex, processedAnnotations);
+            scanMethods(annotationType, reflectiveHierarchy, index, processedAnnotations);
         }
 
         // In the case of a constraint violation, these elements might be returned as entities and will be serialized
@@ -749,14 +750,18 @@ private static void registerReflectionForSerialization(BuildProducer<ReflectiveC
         reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, ResteasyConstraintViolation.class.getName()));
     }
 
-    private static void scanMethodParameters(DotName annotationType,
-            BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy, IndexView index) {
+    private static void scanMethods(DotName annotationType,
+            BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy, IndexView index,
+            Set<AnnotationInstance> processedAnnotations) {
         Collection<AnnotationInstance> instances = index.getAnnotations(annotationType);
         for (AnnotationInstance instance : instances) {
             if (instance.target().kind() != Kind.METHOD) {
                 continue;
             }
-
+            if (processedAnnotations.contains(instance)) {
+                continue;
+            }
+            processedAnnotations.add(instance);
             MethodInfo method = instance.target().asMethod();
             String source = method.declaringClass() + "[" + method + "]";