mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fixed major issues reported by sonar (Simplify Boolean Expression)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@63886 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -185,7 +185,7 @@ public class RmClassesGet extends DictionaryWebServiceBase implements RecordsMan
|
||||
}
|
||||
}
|
||||
|
||||
if (classdef.isEmpty() == true)
|
||||
if (classdef.isEmpty())
|
||||
{
|
||||
for (QName qnameObj : qnames)
|
||||
{
|
||||
@@ -213,7 +213,7 @@ public class RmClassesGet extends DictionaryWebServiceBase implements RecordsMan
|
||||
*/
|
||||
private Collection<QName> getTypes(boolean isRM)
|
||||
{
|
||||
if (isRM == true)
|
||||
if (isRM)
|
||||
{
|
||||
return this.dictionaryservice.getTypes(RM_MODEL);
|
||||
}
|
||||
@@ -231,7 +231,7 @@ public class RmClassesGet extends DictionaryWebServiceBase implements RecordsMan
|
||||
*/
|
||||
private Collection<QName> getAspects(boolean isRM)
|
||||
{
|
||||
if (isRM == true)
|
||||
if (isRM)
|
||||
{
|
||||
return this.dictionaryservice.getAspects(RM_MODEL);
|
||||
}
|
||||
|
@@ -43,12 +43,12 @@ public class RmDictionaryWebServiceUtils
|
||||
{
|
||||
boolean isRmSite = false;
|
||||
String siteId = req.getParameter(SITE_ID);
|
||||
if (StringUtils.isNotBlank(siteId) == true)
|
||||
if (StringUtils.isNotBlank(siteId))
|
||||
{
|
||||
SiteInfo site = siteService.getSite(siteId);
|
||||
if (site != null)
|
||||
{
|
||||
if (site.getSitePreset().equals(SITE_PRESET) == true)
|
||||
if (site.getSitePreset().equals(SITE_PRESET))
|
||||
{
|
||||
isRmSite = true;
|
||||
}
|
||||
|
@@ -139,7 +139,7 @@ public class RmPropertiesGet extends DictionaryWebServiceBase implements Records
|
||||
for (Map.Entry<QName, PropertyDefinition> entry : propMap.entrySet())
|
||||
{
|
||||
if ((namespaceURI != null &&
|
||||
namespaceURI.equals(entry.getKey().getNamespaceURI()) == true) ||
|
||||
namespaceURI.equals(entry.getKey().getNamespaceURI())) ||
|
||||
namespaceURI == null)
|
||||
{
|
||||
props.add(entry.getValue());
|
||||
@@ -165,7 +165,7 @@ public class RmPropertiesGet extends DictionaryWebServiceBase implements Records
|
||||
*/
|
||||
private Collection<QName> getProperties(boolean isRM)
|
||||
{
|
||||
if (isRM == true)
|
||||
if (isRM)
|
||||
{
|
||||
return dictionaryservice.getProperties(RM_MODEL);
|
||||
}
|
||||
|
@@ -41,33 +41,33 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
public class RmActionConditionDefinitionsGet extends DeclarativeWebScript
|
||||
{
|
||||
private ActionService actionService;
|
||||
|
||||
|
||||
private RecordsManagementActionService recordsManagementActionService;
|
||||
|
||||
|
||||
public void setActionService(ActionService actionService)
|
||||
{
|
||||
this.actionService = actionService;
|
||||
}
|
||||
|
||||
|
||||
public void setRecordsManagementActionService(RecordsManagementActionService recordsManagementActionService)
|
||||
{
|
||||
this.recordsManagementActionService = recordsManagementActionService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.springframework.extensions.webscripts.DeclarativeWebScript#executeImpl(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.Status, org.springframework.extensions.webscripts.Cache)
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||
{
|
||||
List<ActionConditionDefinition> dmDefs = actionService.getActionConditionDefinitions();
|
||||
List<ActionConditionDefinition> dmDefs = actionService.getActionConditionDefinitions();
|
||||
List<RecordsManagementActionCondition> conditions = recordsManagementActionService.getRecordsManagementActionConditions();
|
||||
|
||||
|
||||
List<ActionConditionDefinition> defs = new ArrayList<ActionConditionDefinition>(dmDefs.size()+conditions.size());
|
||||
defs.addAll(dmDefs);
|
||||
for (RecordsManagementActionCondition condition: conditions)
|
||||
{
|
||||
if (condition.isPublicCondition() == true)
|
||||
if (condition.isPublicCondition())
|
||||
{
|
||||
defs.add(condition.getRecordsManagementActionConditionDefinition());
|
||||
}
|
||||
|
@@ -41,12 +41,12 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
public class RmActionDefinitionsGet extends DeclarativeWebScript
|
||||
{
|
||||
private RecordsManagementActionService recordsManagementActionService;
|
||||
|
||||
|
||||
public void setRecordsManagementActionService(RecordsManagementActionService recordsManagementActionService)
|
||||
{
|
||||
this.recordsManagementActionService = recordsManagementActionService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.springframework.extensions.webscripts.DeclarativeWebScript#executeImpl(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.Status, org.springframework.extensions.webscripts.Cache)
|
||||
*/
|
||||
@@ -57,15 +57,15 @@ public class RmActionDefinitionsGet extends DeclarativeWebScript
|
||||
Set<ActionDefinition> defs = new HashSet<ActionDefinition>(actions.size());
|
||||
for (RecordsManagementAction action : actions)
|
||||
{
|
||||
if (action.isPublicAction() == true)
|
||||
if (action.isPublicAction())
|
||||
{
|
||||
defs.add(action.getRecordsManagementActionDefinition());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
model.put("actiondefinitions", defs);
|
||||
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
@@ -243,7 +243,7 @@ public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
|
||||
{
|
||||
StoreRef storeRef = new StoreRef(storeType, storeId);
|
||||
NodeRef nodeRef = new NodeRef(storeRef, id);
|
||||
if (filePlanService.isFilePlan(nodeRef) == true)
|
||||
if (filePlanService.isFilePlan(nodeRef))
|
||||
{
|
||||
filePlan = nodeRef;
|
||||
}
|
||||
|
Reference in New Issue
Block a user