Skip to content

Commit 9c5ffc4

Browse files
committed
FIX: sometimes system property values are not Strings
It happens with Boolean for instance
1 parent 1a48982 commit 9c5ffc4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

restx-core/src/main/java/restx/config/ConsolidatedConfigFactoryMachine.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ protected RestxConfig doNewComponent(SatisfiedBOM satisfiedBOM) {
4646
* RestxConfig at all.
4747
*/
4848
for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) {
49-
elements.add(ConfigElement.of("system", "", (String) entry.getKey(), (String) entry.getValue()));
49+
// System properties are a Map which is not protected against adding non String entries
50+
// we simply ignore them
51+
if (entry.getKey() instanceof String && entry.getValue() instanceof String) {
52+
elements.add(ConfigElement.of("system", "", (String) entry.getKey(), (String) entry.getValue()));
53+
}
5054
}
5155

5256
// now fetch elements coming from ConfigSuppliers

0 commit comments

Comments
 (0)