mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed critical issues reported by sonar (Empty If Stmt)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@63495 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -36,7 +36,7 @@ import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Complete event action
|
||||
*
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
@@ -45,7 +45,7 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
public static final String PARAM_EVENT_NAME = "eventName";
|
||||
public static final String PARAM_EVENT_COMPLETED_BY = "eventCompletedBy";
|
||||
public static final String PARAM_EVENT_COMPLETED_AT = "eventCompletedAt";
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@@ -69,7 +69,7 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
String eventName = (String)action.getParameterValue(PARAM_EVENT_NAME);
|
||||
String eventCompletedBy = (String)action.getParameterValue(PARAM_EVENT_COMPLETED_BY);
|
||||
Date eventCompletedAt = (Date)action.getParameterValue(PARAM_EVENT_COMPLETED_AT);
|
||||
|
||||
|
||||
if (this.nodeService.hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE) == true)
|
||||
{
|
||||
// Get the next disposition action
|
||||
@@ -84,12 +84,12 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
eventCompletedAt = new Date();
|
||||
}
|
||||
|
||||
|
||||
if (eventCompletedBy == null)
|
||||
{
|
||||
eventCompletedBy = AuthenticationUtil.getRunAsUser();
|
||||
}
|
||||
|
||||
|
||||
// Update the event so that it is complete
|
||||
NodeRef eventNodeRef = event.getNodeRef();
|
||||
Map<QName, Serializable> props = this.nodeService.getProperties(eventNodeRef);
|
||||
@@ -97,24 +97,24 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
props.put(PROP_EVENT_EXECUTION_COMPLETED_AT, eventCompletedAt);
|
||||
props.put(PROP_EVENT_EXECUTION_COMPLETED_BY, eventCompletedBy);
|
||||
this.nodeService.setProperties(eventNodeRef, props);
|
||||
|
||||
|
||||
// Check to see if the events eligible property needs to be updated
|
||||
updateEventEligible(da);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// else
|
||||
// {
|
||||
// RM-695: Commenting error handling out. If the current disposition stage does not define the event being completed nothing should happen.
|
||||
// throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_EVENT_NO_DISP_LC, eventName));
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the event from the dispostion action
|
||||
*
|
||||
*
|
||||
* @param da
|
||||
* @param eventName
|
||||
* @return
|
||||
|
@@ -212,7 +212,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
validateAndReset(caveatConfigNodeRef);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy#onContentUpdate(org.alfresco.service.cmr.repository.NodeRef, boolean)
|
||||
*/
|
||||
@@ -232,7 +232,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
* @see org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy#beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
@Behaviour(kind = BehaviourKind.CLASS)
|
||||
@Behaviour(kind = BehaviourKind.CLASS)
|
||||
public void beforeDeleteNode(NodeRef nodeRef)
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
@@ -247,7 +247,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
* @see org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy#onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
|
||||
*/
|
||||
@Override
|
||||
@Behaviour(kind = BehaviourKind.CLASS)
|
||||
@Behaviour(kind = BehaviourKind.CLASS)
|
||||
public void onCreateNode(ChildAssociationRef childAssocRef)
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
@@ -352,6 +352,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
Map<String, List<String>> caveatMap = (Map<String, List<String>>)conEntry.getValue();
|
||||
|
||||
List<String> allowedValues = null;
|
||||
@SuppressWarnings("unused")
|
||||
boolean found = false;
|
||||
|
||||
for (QName propertyName : props)
|
||||
@@ -382,10 +383,10 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
}
|
||||
}
|
||||
|
||||
if (! found)
|
||||
{
|
||||
//if (! found)
|
||||
//{
|
||||
//throw new AlfrescoRuntimeException("Constraint does not exist (or is not used): "+conStr);
|
||||
}
|
||||
//}
|
||||
|
||||
if (allowedValues != null)
|
||||
{
|
||||
@@ -547,7 +548,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
if (! (AuthenticationUtil.isMtEnabled() && AuthenticationUtil.isRunAsUserTheSystemUser()))
|
||||
{
|
||||
// note: userName and userGroupNames must not be null
|
||||
caveatConfig.get(constraintName);
|
||||
caveatConfig.get(constraintName);
|
||||
|
||||
Set<String> userGroupFullNames = authorityService.getAuthoritiesForUser(userName);
|
||||
allowedValues = getRMAllowedValues(userName, userGroupFullNames, constraintName);
|
||||
@@ -922,11 +923,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
readLock.lock();
|
||||
|
||||
members = caveatConfig.get(listName);
|
||||
if(members == null)
|
||||
{
|
||||
// list does not exist
|
||||
}
|
||||
else
|
||||
if (members != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -934,11 +931,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
writeLock.lock();
|
||||
// check again
|
||||
members = caveatConfig.get(listName);
|
||||
if(members == null)
|
||||
{
|
||||
// list does not exist
|
||||
}
|
||||
else
|
||||
if (members != null)
|
||||
{
|
||||
// authorities contains authority, values[]
|
||||
// pivot contains value, members[]
|
||||
@@ -964,7 +957,6 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
|
||||
readLock.lock();
|
||||
writeLock.unlock();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
@@ -603,12 +603,8 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
|
||||
}
|
||||
// Prepend it to the path
|
||||
nodeRefPath.addFirst(nodeRef);
|
||||
// Are we at the root
|
||||
if (isFilePlan(nodeRef) == true)
|
||||
{
|
||||
// We're done
|
||||
}
|
||||
else
|
||||
// Are we not at the root
|
||||
if (isFilePlan(nodeRef) == false)
|
||||
{
|
||||
ChildAssociationRef assocRef = nodeService.getPrimaryParent(nodeRef);
|
||||
if (assocRef == null)
|
||||
|
Reference in New Issue
Block a user