mirror of https://github.com/apache/cloudstack.git
findbugs Boolean return null in getter not in is-query
Signed-off-by: Daan Hoogland <daan@onecht.net> This closes #534
This commit is contained in:
parent
f5847147c0
commit
edfe6f4d4f
|
|
@ -77,7 +77,7 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
|
|||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Boolean isBootable() {
|
||||
public Boolean getBootable() {
|
||||
return bootable;
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
|
|||
return osTypeId;
|
||||
}
|
||||
|
||||
public Boolean isPasswordEnabled() {
|
||||
public Boolean getPasswordEnabled() {
|
||||
return passwordEnabled;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class UpdateIsoCmd extends BaseUpdateTemplateOrIsoCmd {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Boolean isPasswordEnabled() {
|
||||
public Boolean getPasswordEnabled() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class UpdateTemplateCmd extends BaseUpdateTemplateOrIsoCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public Boolean isBootable() {
|
||||
public Boolean getBootable() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +52,6 @@ public class UpdateTemplateCmd extends BaseUpdateTemplateOrIsoCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public TemplateResponse getResponse() {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1819,10 +1819,10 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
|||
String displayText = cmd.getDisplayText();
|
||||
String format = cmd.getFormat();
|
||||
Long guestOSId = cmd.getOsTypeId();
|
||||
Boolean passwordEnabled = cmd.isPasswordEnabled();
|
||||
Boolean passwordEnabled = cmd.getPasswordEnabled();
|
||||
Boolean isDynamicallyScalable = cmd.isDynamicallyScalable();
|
||||
Boolean isRoutingTemplate = cmd.isRoutingType();
|
||||
Boolean bootable = cmd.isBootable();
|
||||
Boolean bootable = cmd.getBootable();
|
||||
Boolean requiresHvm = cmd.getRequiresHvm();
|
||||
Integer sortKey = cmd.getSortKey();
|
||||
Map details = cmd.getDetails();
|
||||
|
|
@ -1846,9 +1846,19 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
|||
}
|
||||
}
|
||||
|
||||
// update is needed if any of the fields below got filled by the user
|
||||
boolean updateNeeded =
|
||||
!(name == null && displayText == null && format == null && guestOSId == null && passwordEnabled == null && bootable == null && requiresHvm == null && sortKey == null &&
|
||||
isDynamicallyScalable == null && isRoutingTemplate == null && details == null);
|
||||
!(name == null &&
|
||||
displayText == null &&
|
||||
format == null &&
|
||||
guestOSId == null &&
|
||||
passwordEnabled == null &&
|
||||
bootable == null &&
|
||||
requiresHvm == null &&
|
||||
sortKey == null &&
|
||||
isDynamicallyScalable == null &&
|
||||
isRoutingTemplate == null &&
|
||||
details == null);
|
||||
if (!updateNeeded) {
|
||||
return template;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue