Skip to content

Commit f8b6375

Browse files
Kui-LiuDaanHoogland
authored andcommitted
CLOUDSTACK-10359: Change the inconsistent method names. (#2591)
* CLOUDSTACK-10359: Change the inconsistent method names. The two methods are named "getXXX". The two method are checking the status of variables. "getCustomized" is not as intuitive as "isCustomized". "getIsSystem" is not as intuitive as "isSystem" as well. * Add the missing changes of all usages of method getIsSystem.
1 parent 9187392 commit f8b6375

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public String getHostTag() {
194194
return hostTag;
195195
}
196196

197-
public Boolean getIsSystem() {
197+
public Boolean isSystem() {
198198
return isSystem == null ? false : isSystem;
199199
}
200200

@@ -210,7 +210,7 @@ public String getDeploymentPlanner() {
210210
return deploymentPlanner;
211211
}
212212

213-
public boolean getCustomized() {
213+
public boolean isCustomized() {
214214
return (cpuNumber == null || memory == null || cpuSpeed == null);
215215
}
216216

server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
22792279

22802280
Boolean isCustomizedIops;
22812281

2282-
if (cmd.getIsSystem()) {
2282+
if (cmd.isSystem()) {
22832283
if (vmTypeString == null || VirtualMachine.Type.DomainRouter.toString().toLowerCase().equals(vmTypeString)) {
22842284
vmType = VirtualMachine.Type.DomainRouter;
22852285
allowNetworkRate = true;
@@ -2328,7 +2328,7 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
23282328
}
23292329
}
23302330

2331-
return createServiceOffering(userId, cmd.getIsSystem(), vmType, cmd.getServiceOfferingName(), cpuNumber, memory, cpuSpeed, cmd.getDisplayText(),
2331+
return createServiceOffering(userId, cmd.isSystem(), vmType, cmd.getServiceOfferingName(), cpuNumber, memory, cpuSpeed, cmd.getDisplayText(),
23322332
cmd.getProvisioningType(), localStorageRequired, offerHA, limitCpuUse, volatileVm, cmd.getTags(), cmd.getDomainId(), cmd.getHostTag(),
23332333
cmd.getNetworkRate(), cmd.getDeploymentPlanner(), cmd.getDetails(), isCustomizedIops, cmd.getMinIops(), cmd.getMaxIops(),
23342334
cmd.getBytesReadRate(), cmd.getBytesWriteRate(), cmd.getIopsReadRate(), cmd.getIopsWriteRate(), cmd.getHypervisorSnapshotReserve());

0 commit comments

Comments
 (0)