@@ -227,6 +227,9 @@ public final class RunTimeConfigurationGenerator {
227
227
228
228
static final MethodDescriptor PU_IS_PROPERTY_IN_ROOT = MethodDescriptor .ofMethod (PropertiesUtil .class ,
229
229
"isPropertyInRoot" , boolean .class , Set .class , NameIterator .class );
230
+ static final MethodDescriptor PU_FILTER_PROPERTIES_IN_ROOTS = MethodDescriptor .ofMethod (PropertiesUtil .class ,
231
+ "filterPropertiesInRoots" , Iterable .class , Iterable .class , Set .class );
232
+
230
233
static final MethodDescriptor PU_IS_PROPERTY_QUARKUS_COMPOUND_NAME = MethodDescriptor .ofMethod (PropertiesUtil .class ,
231
234
"isPropertyQuarkusCompoundName" , boolean .class , NameIterator .class );
232
235
static final MethodDescriptor PU_FILTER_UNKNOWN = MethodDescriptor .ofMethod (PropertiesUtil .class , "filterUnknown" ,
@@ -668,16 +671,10 @@ public void run() {
668
671
669
672
private void configSweepLoop (MethodDescriptor parserBody , MethodCreator method , ResultHandle config ,
670
673
Set <String > registeredRoots , Type type ) {
671
- ResultHandle rootSet ;
672
674
ResultHandle nameSet ;
673
675
ResultHandle iterator ;
674
676
675
- rootSet = method .newInstance (HS_NEW );
676
- for (String registeredRoot : registeredRoots ) {
677
- method .invokeVirtualMethod (HS_ADD , rootSet , method .load (registeredRoot ));
678
- }
679
-
680
- nameSet = method .invokeVirtualMethod (SRC_GET_PROPERTY_NAMES , config );
677
+ nameSet = filterProperties (method , config , registeredRoots );
681
678
iterator = method .invokeInterfaceMethod (ITRA_ITERATOR , nameSet );
682
679
683
680
try (BytecodeCreator sweepLoop = method .createScope ()) {
@@ -701,8 +698,6 @@ private void configSweepLoop(MethodDescriptor parserBody, MethodCreator method,
701
698
// if (! keyIter.hasNext()) continue sweepLoop;
702
699
hasNext .ifNonZero (hasNext .invokeVirtualMethod (NI_HAS_NEXT , keyIter )).falseBranch ().continueScope (sweepLoop );
703
700
// if (! keyIter.nextSegmentEquals("quarkus")) continue sweepLoop;
704
- hasNext .ifNonZero (hasNext .invokeStaticMethod (PU_IS_PROPERTY_IN_ROOT , rootSet , keyIter )).falseBranch ()
705
- .continueScope (sweepLoop );
706
701
// parse(config, keyIter);
707
702
hasNext .invokeStaticMethod (parserBody , config , keyIter );
708
703
// continue sweepLoop;
@@ -711,6 +706,21 @@ private void configSweepLoop(MethodDescriptor parserBody, MethodCreator method,
711
706
}
712
707
}
713
708
709
+ private ResultHandle filterProperties (MethodCreator method , ResultHandle config , Set <String > registeredRoots ) {
710
+ // Roots
711
+ ResultHandle rootSet ;
712
+ rootSet = method .newInstance (HS_NEW );
713
+ for (String registeredRoot : registeredRoots ) {
714
+ method .invokeVirtualMethod (HS_ADD , rootSet , method .load (registeredRoot ));
715
+ }
716
+
717
+ // PropertyNames
718
+ ResultHandle properties = method .invokeVirtualMethod (SRC_GET_PROPERTY_NAMES , config );
719
+
720
+ // Filtered Properties
721
+ return method .invokeStaticMethod (PU_FILTER_PROPERTIES_IN_ROOTS , properties , rootSet );
722
+ }
723
+
714
724
private Set <String > getRegisteredRoots (ConfigPhase configPhase ) {
715
725
Set <String > registeredRoots = new HashSet <>();
716
726
for (RootDefinition root : roots ) {
0 commit comments