mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
findbugs: impossible cast in CreateServiceOfferingCmd file.
This commit is contained in:
parent
3ee1fc28de
commit
bc4c8052fd
@ -21,17 +21,15 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.BaseCmd.CommandType;
|
||||
import org.apache.cloudstack.api.response.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.user.Account;
|
||||
@ -106,7 +104,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
|
||||
private String deploymentPlanner;
|
||||
|
||||
@Parameter(name = ApiConstants.SERVICE_OFFERING_DETAILS, type = CommandType.MAP, description = "details for planner, used to store specific parameters")
|
||||
private Map<String, String> details;
|
||||
private Map details;
|
||||
|
||||
@Parameter(name = ApiConstants.BYTES_READ_RATE, type = CommandType.LONG, required = false, description = "bytes read rate of the disk offering")
|
||||
private Long bytesReadRate;
|
||||
@ -215,7 +213,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
|
||||
Iterator<?> iter = props.iterator();
|
||||
while (iter.hasNext()) {
|
||||
HashMap<String, String> detail = (HashMap<String, String>) iter.next();
|
||||
detailsMap.putAll(detail);
|
||||
detailsMap.put(detail.get("key"), detail.get("value"));
|
||||
}
|
||||
}
|
||||
return detailsMap;
|
||||
|
||||
@ -490,15 +490,18 @@
|
||||
|
||||
var array1 = [];
|
||||
if (args.data.deploymentPlanner == "ImplicitDedicationPlanner" && args.data.plannerMode != "") {
|
||||
array1.push("&serviceofferingdetails[0].ImplicitDedicationMode" + "=" + args.data.plannerMode);
|
||||
array1.push("&serviceofferingdetails[0].key" + "=" + "ImplicitDedicationMode");
|
||||
array1.push("&serviceofferingdetails[0].value" + "=" + args.data.plannerMode);
|
||||
}
|
||||
|
||||
if (args.data.pciDevice != "") {
|
||||
array1.push("&serviceofferingdetails[1].pciDevice" + "=" + args.data.pciDevice);
|
||||
array1.push("&serviceofferingdetails[1].key" + "=" + "pciDevice");
|
||||
array1.push("&serviceofferingdetails[1].value" + "=" + args.data.pciDevice);
|
||||
}
|
||||
|
||||
if (args.data.pciDevice == "VGPU") {
|
||||
array1.push("&serviceofferingdetails[2].vgpuType" + "=" + args.data.vgpuType);
|
||||
array1.push("&serviceofferingdetails[2].key" + "=" + "vgpuType");
|
||||
array1.push("&serviceofferingdetails[2].value" + "=" + args.data.vgpuType);
|
||||
}
|
||||
|
||||
if (args.data.networkRate != null && args.data.networkRate.length > 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user