Skip to content

Commit ee36207

Browse files
committed
Do not exclude properties from recording that are available in sources that should always be included
1 parent 049f6f0 commit ee36207

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,28 +1018,40 @@ private Converter<?> getConverter(SmallRyeConfig config, Field field, ConverterT
10181018
*/
10191019
private Set<String> getAllProperties(final Set<String> registeredRoots) {
10201020
Set<String> properties = new HashSet<>();
1021+
1022+
// Get all properties, including the ones generated by interceptors, but these do not include profiles
10211023
for (String property : config.getPropertyNames()) {
10221024
properties.add(property);
10231025
}
10241026

1027+
Set<String> propertiesToRemove = new HashSet<>();
1028+
Set<String> propertiesToAdd = new HashSet<>();
1029+
1030+
// Get properties per source to collect profiled properties and exclude properties that are build related
10251031
for (ConfigSource configSource : config.getConfigSources()) {
10261032
if (configSource instanceof SysPropConfigSource || configSource instanceof EnvConfigSource
10271033
|| "PropertiesConfigSource[source=Build system]".equals(configSource.getName())) {
10281034
for (String property : configSource.getPropertyNames()) {
10291035
NameIterator ni = new NameIterator(property);
10301036
if (ni.hasNext() && PropertiesUtil.isPropertyInRoot(registeredRoots, ni)) {
1031-
properties.add(property);
1037+
propertiesToAdd.add(property);
10321038
} else {
1033-
properties.remove(property);
1039+
propertiesToRemove.add(property);
10341040
if (configSource instanceof EnvConfigSource) {
1035-
properties.remove(StringUtil.toLowerCaseAndDotted(property));
1041+
propertiesToRemove.add(StringUtil.toLowerCaseAndDotted(property));
10361042
}
10371043
}
10381044
}
10391045
} else {
1040-
properties.addAll(configSource.getPropertyNames());
1046+
propertiesToAdd.addAll(configSource.getPropertyNames());
10411047
}
10421048
}
1049+
1050+
// A property may exist in an excluded source and an include source. We don't have a way to know, so we
1051+
// just remove the excluded ones and add the ones to be included, so the property is back there again
1052+
properties.removeAll(propertiesToRemove);
1053+
properties.addAll(propertiesToAdd);
1054+
10431055
return properties;
10441056
}
10451057

0 commit comments

Comments
 (0)