Skip to content

Commit

Permalink
FIX: sometimes system property values are not Strings
Browse files Browse the repository at this point in the history
It happens with Boolean for instance
  • Loading branch information
xhanin committed Dec 21, 2014
1 parent 1a48982 commit 9c5ffc4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c5ffc4

Please sign in to comment.