Skip to content

Commit bc4c805

Browse files
findbugs: impossible cast in CreateServiceOfferingCmd file.
1 parent 3ee1fc2 commit bc4c805

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@
2121
import java.util.Iterator;
2222
import java.util.Map;
2323

24-
import org.apache.log4j.Logger;
25-
2624
import org.apache.cloudstack.api.APICommand;
2725
import org.apache.cloudstack.api.ApiConstants;
2826
import org.apache.cloudstack.api.ApiErrorCode;
2927
import org.apache.cloudstack.api.BaseCmd;
3028
import org.apache.cloudstack.api.Parameter;
3129
import org.apache.cloudstack.api.ServerApiException;
32-
import org.apache.cloudstack.api.BaseCmd.CommandType;
3330
import org.apache.cloudstack.api.response.DomainResponse;
3431
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
32+
import org.apache.log4j.Logger;
3533

3634
import com.cloud.offering.ServiceOffering;
3735
import com.cloud.user.Account;
@@ -106,7 +104,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
106104
private String deploymentPlanner;
107105

108106
@Parameter(name = ApiConstants.SERVICE_OFFERING_DETAILS, type = CommandType.MAP, description = "details for planner, used to store specific parameters")
109-
private Map<String, String> details;
107+
private Map details;
110108

111109
@Parameter(name = ApiConstants.BYTES_READ_RATE, type = CommandType.LONG, required = false, description = "bytes read rate of the disk offering")
112110
private Long bytesReadRate;
@@ -215,7 +213,7 @@ public Map<String, String> getDetails() {
215213
Iterator<?> iter = props.iterator();
216214
while (iter.hasNext()) {
217215
HashMap<String, String> detail = (HashMap<String, String>) iter.next();
218-
detailsMap.putAll(detail);
216+
detailsMap.put(detail.get("key"), detail.get("value"));
219217
}
220218
}
221219
return detailsMap;

ui/scripts/configuration.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,15 +490,18 @@
490490

491491
var array1 = [];
492492
if (args.data.deploymentPlanner == "ImplicitDedicationPlanner" && args.data.plannerMode != "") {
493-
array1.push("&serviceofferingdetails[0].ImplicitDedicationMode" + "=" + args.data.plannerMode);
493+
array1.push("&serviceofferingdetails[0].key" + "=" + "ImplicitDedicationMode");
494+
array1.push("&serviceofferingdetails[0].value" + "=" + args.data.plannerMode);
494495
}
495496

496497
if (args.data.pciDevice != "") {
497-
array1.push("&serviceofferingdetails[1].pciDevice" + "=" + args.data.pciDevice);
498+
array1.push("&serviceofferingdetails[1].key" + "=" + "pciDevice");
499+
array1.push("&serviceofferingdetails[1].value" + "=" + args.data.pciDevice);
498500
}
499501

500502
if (args.data.pciDevice == "VGPU") {
501-
array1.push("&serviceofferingdetails[2].vgpuType" + "=" + args.data.vgpuType);
503+
array1.push("&serviceofferingdetails[2].key" + "=" + "vgpuType");
504+
array1.push("&serviceofferingdetails[2].value" + "=" + args.data.vgpuType);
502505
}
503506

504507
if (args.data.networkRate != null && args.data.networkRate.length > 0) {

0 commit comments

Comments
 (0)