diff --git a/core/deployment/src/main/java/io/quarkus/deployment/CracProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/CracProcessor.java index d0905569781a5..6361f715831ce 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/CracProcessor.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/CracProcessor.java @@ -48,24 +48,37 @@ public void processCrac(BuildProducer preload, @BuildStep(onlyIf = IsNormal.class, onlyIfNot = NativeBuild.class) public void generateClassListFromApplication( - CracConfig cc, + CracConfig config, + Optional defaultVal, BuildProducer producer, TransformedClassesBuildItem transformedClasses, ApplicationArchivesBuildItem applicationArchivesBuildItem, List generatedClasses) { - if (cc.generateApplicationClassList) { + if (config.enable.isPresent()) { + if (!config.enable.get()) { + return; + } + } else if (defaultVal == null || !defaultVal.isPresent() || !defaultVal.get().isDefaultValue()) { + return; + } + + if (config.generateApplicationClassList) { for (Set transformedSet : transformedClasses .getTransformedClassesByJar().values()) { for (TransformedClassesBuildItem.TransformedClass transformed : transformedSet) { String className = transformed.getClassName(); - producer.produce(new PreloadClassBuildItem(className)); + if (className != null) { + producer.produce(new PreloadClassBuildItem(className)); + } } } for (GeneratedClassBuildItem i : generatedClasses) { if (i.isApplicationClass()) { - String cn = i.getName().replace("/", "."); - producer.produce(new PreloadClassBuildItem(cn)); + if (i.getName() != null) { + String cn = i.getName().replace("/", "."); + producer.produce(new PreloadClassBuildItem(cn)); + } } }