Repository: quarkusio/quarkus
Issue: Lots of logging if class is not in index

When using the reproducer for https://github.com/quarkusio/quarkus/issues/5354 I noticed that there is a lot of logging about the same class not being in the index:

IMHO this should be logged once at most, and probably we should automatically index (and cache the result, as we don't want to do it multiple times).  

```
2020-01-06 16:36:53,100 INFO  [io.qua.arc.pro.IndexClassLookupUtils] (build-2) Class for name: com.github.brunoabdon.quarkus.SomeSuperclass was not found in Jandex index. Please ensure the class is part of the index.
2020-01-06 16:36:53,109 INFO  [io.qua.arc.pro.IndexClassLookupUtils] (build-2) Class for name: com.github.brunoabdon.quarkus.SomeSuperclass was not found in Jandex index. Please ensure the class is part of the index.
2020-01-06 16:36:53,110 INFO  [io.qua.arc.pro.IndexClassLookupUtils] (build-2) Class for name: com.github.brunoabdon.quarkus.SomeSuperclass was not found in Jandex index. Please ensure the class is part of the index.
2020-01-06 16:36:53,139 INFO  [io.qua.arc.pro.IndexClassLookupUtils] (build-2) Class for name: com.github.brunoabdon.quarkus.SomeSuperclass was not found in Jandex index. Please ensure the class is part of the index.
2020-01-06 16:36:53,139 INFO  [io.qua.arc.pro.IndexClassLookupUtils] (build-2) Class for name: com.github.brunoabdon.quarkus.SomeSuperclass was not found in Jandex index. Please ensure the class is part of the index.
2020-01-06 16:36:53,139 INFO  [io.qua.arc.pro.IndexClassLookupUtils] (build-2) Class for name: com.github.brunoabdon.quarkus.SomeSuperclass was not found in Jandex index. Please ensure the class is part of the index.
2020-01-06 16:36:53,185 INFO  [io.qua.arc.pro.IndexClassLookupUtils] (build-3) Class for name: com.github.brunoabdon.quarkus.SomeSuperclass was not found in Jandex index. Please ensure the class is part of the index.
2020-01-06 16:36:53,185 INFO  [io.qua.arc.pro.IndexClassLookupUtils] (build-3) Class for name: com.github.brunoabdon.quarkus.SomeSuperclass was not found in Jandex index. Please ensure the class is part of the index.
```


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

diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/IndexClassLookupUtils.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/IndexClassLookupUtils.java
index 161e4fddb2c..b05604d0386 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/IndexClassLookupUtils.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/IndexClassLookupUtils.java
@@ -1,5 +1,7 @@
 package io.quarkus.arc.processor;
 
+import java.util.HashSet;
+import java.util.Set;
 import org.jboss.jandex.ClassInfo;
 import org.jboss.jandex.DotName;
 import org.jboss.jandex.IndexView;
@@ -9,6 +11,9 @@ final class IndexClassLookupUtils {
 
     private static final Logger LOGGER = Logger.getLogger(IndexClassLookupUtils.class);
 
+    // set of already encountered and logged DotNames that are missing in the index
+    private static Set<DotName> alreadyKnown = new HashSet<>();
+
     private IndexClassLookupUtils() {
     }
 
@@ -31,10 +36,11 @@ private static ClassInfo lookupClassInIndex(IndexView index, DotName dotName, bo
             throw new IllegalArgumentException("Cannot lookup class, provided Jandex Index was null.");
         }
         ClassInfo info = index.getClassByName(dotName);
-        if (info == null && withLogging) {
-            // class not in index, log warning as this may cause the application to blow up or behave weirdly
+        if (info == null && withLogging && !alreadyKnown.contains(dotName)) {
+            // class not in index, log info as this may cause the application to blow up or behave weirdly
             LOGGER.info("Class for name: " + dotName + " was not found in Jandex index. Please ensure the class " +
                     "is part of the index.");
+            alreadyKnown.add(dotName);
         }
         return info;
     }