Skip to content
Permalink
Browse files

FIX: sometimes system property values are not Strings

It happens with Boolean for instance
  • Loading branch information
xhanin committed Nov 19, 2014
1 parent 1a48982 commit 9c5ffc476dd01b5fae4cd343d92e8d241356182f
Showing with 5 additions and 1 deletion.
  1. +5 −1 restx-core/src/main/java/restx/config/ConsolidatedConfigFactoryMachine.java
@@ -46,7 +46,11 @@ protected RestxConfig doNewComponent(SatisfiedBOM satisfiedBOM) {
* RestxConfig at all.
*/
for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) {
elements.add(ConfigElement.of("system", "", (String) entry.getKey(), (String) entry.getValue()));
// System properties are a Map which is not protected against adding non String entries
// we simply ignore them
if (entry.getKey() instanceof String && entry.getValue() instanceof String) {
elements.add(ConfigElement.of("system", "", (String) entry.getKey(), (String) entry.getValue()));
}
}

// now fetch elements coming from ConfigSuppliers

0 comments on commit 9c5ffc4

Please sign in to comment.
You can’t perform that action at this time.