diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java index cfefd34f70fa4..5238f2e607e2f 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java @@ -21,6 +21,7 @@ import org.jboss.jandex.ArrayType; import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; +import org.jboss.jandex.IndexView; import org.jboss.jandex.MethodInfo; import org.jboss.jandex.Type; import org.jboss.logging.Logger; @@ -102,6 +103,8 @@ public class MainClassBuildStep { void.class); public static final MethodDescriptor CONFIGURE_STEP_TIME_START = ofMethod(StepTiming.class.getName(), "configureStart", void.class); + private static final DotName QUARKUS_APPLICATION = DotName.createSimple(QuarkusApplication.class.getName()); + private static final DotName OBJECT = DotName.createSimple(Object.class.getName()); @BuildStep void build(List staticInitTasks, @@ -335,7 +338,8 @@ public MainClassBuildItem mainClassBuildStep(BuildProducer quarkusMainAnnotations = new HashMap<>(); - Collection quarkusMains = combinedIndexBuildItem.getIndex() + IndexView index = combinedIndexBuildItem.getIndex(); + Collection quarkusMains = index .getAnnotations(DotName.createSimple(QuarkusMain.class.getName())); for (AnnotationInstance i : quarkusMains) { AnnotationValue nameValue = i.value("name"); @@ -349,7 +353,7 @@ public MainClassBuildItem mainClassBuildStep(BuildProducer impls = combinedIndexBuildItem.getIndex() - .getAllKnownImplementors(DotName.createSimple(QuarkusApplication.class.getName())); - ClassInfo classByName = combinedIndexBuildItem.getIndex().getClassByName(DotName.createSimple(mainClassName)); + Collection impls = index + .getAllKnownImplementors(QUARKUS_APPLICATION); + ClassInfo classByName = index.getClassByName(DotName.createSimple(mainClassName)); MethodInfo mainClassMethod = null; if (classByName != null) { mainClassMethod = classByName @@ -401,7 +405,7 @@ public MainClassBuildItem mainClassBuildStep(BuildProducer