Skip to content

Commit 96d6aaa

Browse files
rsafonsecayadvr
authored andcommitted
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>
1 parent 8634fe5 commit 96d6aaa

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

‎api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,7 @@ public Long getServiceOfferingId() {
7575
}
7676

7777
public Map<String, String> getDetails() {
78-
Map<String, String> customparameterMap = new HashMap<String, String>();
79-
if (details != null && details.size() != 0) {
80-
Collection parameterCollection = details.values();
81-
Iterator iter = parameterCollection.iterator();
82-
while (iter.hasNext()) {
83-
HashMap<String, String> value = (HashMap<String, String>)iter.next();
84-
for (Map.Entry<String,String>entry : value.entrySet()) {
85-
customparameterMap.put(entry.getKey(), entry.getValue());
86-
}
87-
}
88-
}
89-
return customparameterMap;
78+
return details;
9079
}
9180

9281
/////////////////////////////////////////////////////

0 commit comments

Comments
 (0)