Fix findbugs ClassCastException in UpgradeSystemVMCmd.java getDetails() isn't called anywhere in the code, either way, implementation is wrong since details is a Map<String, String> and not a Map<String, Map<String,String>> If this piece of could would get run, it would just fail trying to cast String to HashMap<String,String> in line 83

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rafael da Fonseca 2015-06-14 15:25:33 +02:00 committed by Rohit Yadav
parent 8634fe5cf5
commit 96d6aaa293

View File

@ -75,18 +75,7 @@ public class UpgradeSystemVMCmd extends BaseCmd {
} }
public Map<String, String> getDetails() { public Map<String, String> getDetails() {
Map<String, String> customparameterMap = new HashMap<String, String>(); return details;
if (details != null && details.size() != 0) {
Collection parameterCollection = details.values();
Iterator iter = parameterCollection.iterator();
while (iter.hasNext()) {
HashMap<String, String> value = (HashMap<String, String>)iter.next();
for (Map.Entry<String,String>entry : value.entrySet()) {
customparameterMap.put(entry.getKey(), entry.getValue());
}
}
}
return customparameterMap;
} }
///////////////////////////////////////////////////// /////////////////////////////////////////////////////