21
21
import java .util .ArrayList ;
22
22
import java .util .HashMap ;
23
23
import java .util .HashSet ;
24
+ import java .util .LinkedHashSet ;
24
25
import java .util .List ;
25
26
import java .util .Map ;
26
27
import java .util .Objects ;
@@ -267,13 +268,13 @@ void generateBuilders(
267
268
Set <String > configCustomizers = discoverService (SmallRyeConfigBuilderCustomizer .class , reflectiveClass );
268
269
269
270
// TODO - introduce a way to ignore mappings that are only used for documentation or to prevent warnings
270
- Set <ConfigClass > ignoreMappings = new HashSet <>();
271
+ Set <ConfigClass > ignoreMappings = new LinkedHashSet <>();
271
272
ignoreMappings .add (ConfigClass .configClass (BuildAnalyticsConfig .class , "quarkus.analytics" ));
272
273
ignoreMappings .add (ConfigClass .configClass (BuilderConfig .class , "quarkus.builder" ));
273
274
ignoreMappings .add (ConfigClass .configClass (CommandLineRuntimeConfig .class , "quarkus" ));
274
275
ignoreMappings .add (ConfigClass .configClass (DebugRuntimeConfig .class , "quarkus.debug" ));
275
276
276
- Set <ConfigClass > allMappings = new HashSet <>();
277
+ Set <ConfigClass > allMappings = new LinkedHashSet <>();
277
278
allMappings .addAll (staticSafeConfigMappings (configMappings ));
278
279
allMappings .addAll (runtimeConfigMappings (configMappings ));
279
280
allMappings .addAll (configItem .getReadResult ().getBuildTimeRunTimeMappings ());
@@ -284,11 +285,11 @@ void generateBuilders(
284
285
Map <Object , FieldDescriptor > sharedFields = generateSharedConfig (generatedClass , converters , allMappings );
285
286
286
287
// For Static Init Config
287
- Set <ConfigClass > staticMappings = new HashSet <>();
288
+ Set <ConfigClass > staticMappings = new LinkedHashSet <>();
288
289
staticMappings .addAll (staticSafeConfigMappings (configMappings ));
289
290
staticMappings .addAll (configItem .getReadResult ().getBuildTimeRunTimeMappings ());
290
291
staticMappings .removeAll (ignoreMappings );
291
- Set <String > staticCustomizers = new HashSet <>(staticSafeServices (configCustomizers ));
292
+ Set <String > staticCustomizers = new LinkedHashSet <>(staticSafeServices (configCustomizers ));
292
293
staticCustomizers .add (StaticInitConfigBuilder .class .getName ());
293
294
294
295
generateConfigBuilder (generatedClass , reflectiveClass , CONFIG_STATIC_NAME ,
@@ -311,12 +312,12 @@ void generateBuilders(
311
312
reflectiveClass .produce (ReflectiveClassBuildItem .builder (CONFIG_STATIC_NAME ).build ());
312
313
313
314
// For RunTime Config
314
- Set <ConfigClass > runTimeMappings = new HashSet <>();
315
+ Set <ConfigClass > runTimeMappings = new LinkedHashSet <>();
315
316
runTimeMappings .addAll (runtimeConfigMappings (configMappings ));
316
317
runTimeMappings .addAll (configItem .getReadResult ().getBuildTimeRunTimeMappings ());
317
318
runTimeMappings .addAll (configItem .getReadResult ().getRunTimeMappings ());
318
319
runTimeMappings .removeAll (ignoreMappings );
319
- Set <String > runtimeCustomizers = new HashSet <>(configCustomizers );
320
+ Set <String > runtimeCustomizers = new LinkedHashSet <>(configCustomizers );
320
321
runtimeCustomizers .add (RuntimeConfigBuilder .class .getName ());
321
322
322
323
generateConfigBuilder (generatedClass , reflectiveClass , CONFIG_RUNTIME_NAME ,
@@ -837,7 +838,7 @@ private static Set<String> discoverService(
837
838
Class <?> serviceClass ,
838
839
BuildProducer <ReflectiveClassBuildItem > reflectiveClass ) throws IOException {
839
840
ClassLoader classLoader = Thread .currentThread ().getContextClassLoader ();
840
- Set <String > services = new HashSet <>();
841
+ Set <String > services = new LinkedHashSet <>();
841
842
for (String service : classNamesNamedIn (classLoader , SERVICES_PREFIX + serviceClass .getName ())) {
842
843
// The discovery includes deployment modules, so we only include services available at runtime
843
844
if (QuarkusClassLoader .isClassPresentAtRuntime (service )) {
@@ -850,7 +851,7 @@ private static Set<String> discoverService(
850
851
851
852
private static Set <String > staticSafeServices (Set <String > services ) {
852
853
ClassLoader classloader = Thread .currentThread ().getContextClassLoader ();
853
- Set <String > staticSafe = new HashSet <>();
854
+ Set <String > staticSafe = new LinkedHashSet <>();
854
855
for (String service : services ) {
855
856
// SmallRye Config services are always safe, but they cannot be annotated with @StaticInitSafe
856
857
if (service .startsWith ("io.smallrye.config." )) {
0 commit comments