mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed major issues reported by sonar (Unnecessary Local Before Return)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@64827 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1201,8 +1201,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
||||
*/
|
||||
public List<AssociationRef> getCustomReferencesFrom(NodeRef node)
|
||||
{
|
||||
List<AssociationRef> retrievedAssocs = nodeService.getTargetAssocs(node, RegexQNamePattern.MATCH_ALL);
|
||||
return retrievedAssocs;
|
||||
return nodeService.getTargetAssocs(node, RegexQNamePattern.MATCH_ALL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1210,8 +1209,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
||||
*/
|
||||
public List<ChildAssociationRef> getCustomChildReferences(NodeRef node)
|
||||
{
|
||||
List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(node);
|
||||
return childAssocs;
|
||||
return nodeService.getChildAssocs(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1219,8 +1217,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
||||
*/
|
||||
public List<AssociationRef> getCustomReferencesTo(NodeRef node)
|
||||
{
|
||||
List<AssociationRef> retrievedAssocs = nodeService.getSourceAssocs(node, RegexQNamePattern.MATCH_ALL);
|
||||
return retrievedAssocs;
|
||||
return nodeService.getSourceAssocs(node, RegexQNamePattern.MATCH_ALL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1228,8 +1225,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
||||
*/
|
||||
public List<ChildAssociationRef> getCustomParentReferences(NodeRef node)
|
||||
{
|
||||
List<ChildAssociationRef> result = nodeService.getParentAssocs(node);
|
||||
return result;
|
||||
return nodeService.getParentAssocs(node);
|
||||
}
|
||||
|
||||
// note: currently RMC custom assocs only
|
||||
|
@@ -421,8 +421,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
{
|
||||
ResultSet raw = returnedObject.getWrapped();
|
||||
ResultSet filteredForPermissions = decide(authentication, object, config, raw);
|
||||
PagingLuceneResultSet newPaging = new PagingLuceneResultSet(filteredForPermissions, returnedObject.getResultSetMetaData().getSearchParameters(), nodeService);
|
||||
return newPaging;
|
||||
return new PagingLuceneResultSet(filteredForPermissions, returnedObject.getResultSetMetaData().getSearchParameters(), nodeService);
|
||||
}
|
||||
|
||||
private ResultSet decide(Authentication authentication, Object object, ConfigAttributeDefinition config, ResultSet returnedObject) throws AccessDeniedException
|
||||
|
@@ -108,8 +108,7 @@ public abstract class AbstractBasePolicy extends RMSecurityCommon
|
||||
{
|
||||
if (invocation.getArguments()[position] != null)
|
||||
{
|
||||
QName qname = (QName) invocation.getArguments()[position];
|
||||
return qname;
|
||||
return (QName) invocation.getArguments()[position];
|
||||
}
|
||||
}
|
||||
else if (NodeRef.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null)
|
||||
@@ -133,8 +132,7 @@ public abstract class AbstractBasePolicy extends RMSecurityCommon
|
||||
{
|
||||
if (QName.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null)
|
||||
{
|
||||
QName qname = (QName) invocation.getArguments()[position];
|
||||
return qname;
|
||||
return (QName) invocation.getArguments()[position];
|
||||
}
|
||||
throw new ACLEntryVoterException("Unknown type");
|
||||
}
|
||||
@@ -155,8 +153,7 @@ public abstract class AbstractBasePolicy extends RMSecurityCommon
|
||||
}
|
||||
if (Serializable.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null)
|
||||
{
|
||||
Serializable property = (Serializable) invocation.getArguments()[position];
|
||||
return property;
|
||||
return (Serializable) invocation.getArguments()[position];
|
||||
}
|
||||
throw new ACLEntryVoterException("Unknown type");
|
||||
}
|
||||
@@ -177,8 +174,7 @@ public abstract class AbstractBasePolicy extends RMSecurityCommon
|
||||
}
|
||||
if (Map.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null)
|
||||
{
|
||||
Map<QName, Serializable> properties = (Map<QName, Serializable>) invocation.getArguments()[position];
|
||||
return properties;
|
||||
return (Map<QName, Serializable>) invocation.getArguments()[position];
|
||||
}
|
||||
throw new ACLEntryVoterException("Unknown type");
|
||||
}
|
||||
|
@@ -67,8 +67,7 @@ public class ScriptConstraint implements Serializable
|
||||
|
||||
public String getName()
|
||||
{
|
||||
String xxx = info.getName().replace(":", "_");
|
||||
return xxx;
|
||||
return info.getName().replace(":", "_");
|
||||
}
|
||||
|
||||
public boolean isCaseSensitive()
|
||||
@@ -257,9 +256,7 @@ public class ScriptConstraint implements Serializable
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ScriptConstraintValue[] retVal = constraints.toArray(new ScriptConstraintValue[constraints.size()]);
|
||||
return retVal;
|
||||
return constraints.toArray(new ScriptConstraintValue[constraints.size()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -159,8 +159,7 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
|
||||
}
|
||||
|
||||
RMConstraintInfo info = caveatConfigService.addRMConstraint(listName, title, allowedValues);
|
||||
ScriptConstraint c = new ScriptConstraint(info, caveatConfigService, getAuthorityService());
|
||||
return c;
|
||||
return new ScriptConstraint(info, caveatConfigService, getAuthorityService());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -51,7 +51,6 @@ public class BasicIdentifierGenerator extends IdentifierGeneratorBase
|
||||
|
||||
Calendar fileCalendar = Calendar.getInstance();
|
||||
String year = Integer.toString(fileCalendar.get(Calendar.YEAR));
|
||||
String identifier = year + "-" + padString(dbId.toString(), 10);
|
||||
return identifier;
|
||||
return year + "-" + padString(dbId.toString(), 10);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user