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:
Daan Hoogland 2015-06-26 15:29:25 +02:00
parent f5847147c0
commit edfe6f4d4f
4 changed files with 18 additions and 9 deletions

View File

@ -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;
}

View File

@ -44,7 +44,7 @@ public class UpdateIsoCmd extends BaseUpdateTemplateOrIsoCmd {
}
@Override
public Boolean isPasswordEnabled() {
public Boolean getPasswordEnabled() {
return null;
}

View File

@ -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;
}

View File

@ -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;
}