Permalink
Browse files

IVYDE-372: fix ClassCastException: System properties may not be strings

  • Loading branch information...
cpfeiffer authored and nlalevee committed Sep 24, 2014
1 parent a6b9ca3 commit 81fec3193ad12a0f78eb021c4a1548484595860b
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/java/org/apache/ivy/core/settings/IvySettings.java
@@ -604,11 +604,13 @@ public synchronized void addAllVariables(Map variables) {
addAllVariables(variables, true);
}
- public synchronized void addAllVariables(Map variables, boolean overwrite) {
- for (Iterator iter = variables.keySet().iterator(); iter.hasNext();) {
- String key = (String) iter.next();
- String val = (String) variables.get(key);
- setVariable(key, val, overwrite);
+ public synchronized void addAllVariables(Map<?, ?> variables, boolean overwrite) {
+ for (Map.Entry<?, ?> entry : variables.entrySet()) {
+ String key = entry.getKey().toString();
+ Object val = entry.getValue();
+ if (val == null || val instanceof String) {
+ setVariable(key, (String) val, overwrite);
+ }
}
}

0 comments on commit 81fec31

Please sign in to comment.