From a61a942b67bb779c187ac6a80bdac6fd2719a026 Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Tue, 4 Jul 2023 10:55:34 +0200 Subject: [PATCH] Generate config metadata fix. (#7145) --- .../config/metadata/processor/ConfigMetadataHandler.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/metadata-processor/src/main/java/io/helidon/config/metadata/processor/ConfigMetadataHandler.java b/config/metadata-processor/src/main/java/io/helidon/config/metadata/processor/ConfigMetadataHandler.java index 680b814e325..03a18595402 100644 --- a/config/metadata-processor/src/main/java/io/helidon/config/metadata/processor/ConfigMetadataHandler.java +++ b/config/metadata-processor/src/main/java/io/helidon/config/metadata/processor/ConfigMetadataHandler.java @@ -20,6 +20,7 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -75,7 +76,7 @@ class ConfigMetadataHandler { private final Map newOptions = new HashMap<>(); // map of module name to list of classes that belong to it private final Map> moduleTypes = new HashMap<>(); - + private final Set classesToHandle = new LinkedHashSet<>(); /* * Compiler utilities for annotation processing */ @@ -249,9 +250,10 @@ private static String javadoc(String docComment) { } private boolean doProcess(RoundEnvironment roundEnv) { + // we need to collect all types for processing + classesToHandle.addAll(roundEnv.getElementsAnnotatedWith(configuredElement)); if (roundEnv.processingOver()) { - Set classes = roundEnv.getElementsAnnotatedWith(configuredElement); - for (Element aClass : classes) { + for (Element aClass : classesToHandle) { processClass(aClass); }