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)
|
public List<AssociationRef> getCustomReferencesFrom(NodeRef node)
|
||||||
{
|
{
|
||||||
List<AssociationRef> retrievedAssocs = nodeService.getTargetAssocs(node, RegexQNamePattern.MATCH_ALL);
|
return nodeService.getTargetAssocs(node, RegexQNamePattern.MATCH_ALL);
|
||||||
return retrievedAssocs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1210,8 +1209,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
|||||||
*/
|
*/
|
||||||
public List<ChildAssociationRef> getCustomChildReferences(NodeRef node)
|
public List<ChildAssociationRef> getCustomChildReferences(NodeRef node)
|
||||||
{
|
{
|
||||||
List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(node);
|
return nodeService.getChildAssocs(node);
|
||||||
return childAssocs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1219,8 +1217,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
|||||||
*/
|
*/
|
||||||
public List<AssociationRef> getCustomReferencesTo(NodeRef node)
|
public List<AssociationRef> getCustomReferencesTo(NodeRef node)
|
||||||
{
|
{
|
||||||
List<AssociationRef> retrievedAssocs = nodeService.getSourceAssocs(node, RegexQNamePattern.MATCH_ALL);
|
return nodeService.getSourceAssocs(node, RegexQNamePattern.MATCH_ALL);
|
||||||
return retrievedAssocs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1228,8 +1225,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
|||||||
*/
|
*/
|
||||||
public List<ChildAssociationRef> getCustomParentReferences(NodeRef node)
|
public List<ChildAssociationRef> getCustomParentReferences(NodeRef node)
|
||||||
{
|
{
|
||||||
List<ChildAssociationRef> result = nodeService.getParentAssocs(node);
|
return nodeService.getParentAssocs(node);
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// note: currently RMC custom assocs only
|
// note: currently RMC custom assocs only
|
||||||
|
@@ -421,8 +421,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
|||||||
{
|
{
|
||||||
ResultSet raw = returnedObject.getWrapped();
|
ResultSet raw = returnedObject.getWrapped();
|
||||||
ResultSet filteredForPermissions = decide(authentication, object, config, raw);
|
ResultSet filteredForPermissions = decide(authentication, object, config, raw);
|
||||||
PagingLuceneResultSet newPaging = new PagingLuceneResultSet(filteredForPermissions, returnedObject.getResultSetMetaData().getSearchParameters(), nodeService);
|
return new PagingLuceneResultSet(filteredForPermissions, returnedObject.getResultSetMetaData().getSearchParameters(), nodeService);
|
||||||
return newPaging;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ResultSet decide(Authentication authentication, Object object, ConfigAttributeDefinition config, ResultSet returnedObject) throws AccessDeniedException
|
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)
|
if (invocation.getArguments()[position] != null)
|
||||||
{
|
{
|
||||||
QName qname = (QName) invocation.getArguments()[position];
|
return (QName) invocation.getArguments()[position];
|
||||||
return qname;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (NodeRef.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null)
|
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)
|
if (QName.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null)
|
||||||
{
|
{
|
||||||
QName qname = (QName) invocation.getArguments()[position];
|
return (QName) invocation.getArguments()[position];
|
||||||
return qname;
|
|
||||||
}
|
}
|
||||||
throw new ACLEntryVoterException("Unknown type");
|
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)
|
if (Serializable.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null)
|
||||||
{
|
{
|
||||||
Serializable property = (Serializable) invocation.getArguments()[position];
|
return (Serializable) invocation.getArguments()[position];
|
||||||
return property;
|
|
||||||
}
|
}
|
||||||
throw new ACLEntryVoterException("Unknown type");
|
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)
|
if (Map.class.isAssignableFrom(params[position]) && invocation.getArguments()[position] != null)
|
||||||
{
|
{
|
||||||
Map<QName, Serializable> properties = (Map<QName, Serializable>) invocation.getArguments()[position];
|
return (Map<QName, Serializable>) invocation.getArguments()[position];
|
||||||
return properties;
|
|
||||||
}
|
}
|
||||||
throw new ACLEntryVoterException("Unknown type");
|
throw new ACLEntryVoterException("Unknown type");
|
||||||
}
|
}
|
||||||
|
@@ -67,8 +67,7 @@ public class ScriptConstraint implements Serializable
|
|||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
String xxx = info.getName().replace(":", "_");
|
return info.getName().replace(":", "_");
|
||||||
return xxx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCaseSensitive()
|
public boolean isCaseSensitive()
|
||||||
@@ -257,9 +256,7 @@ public class ScriptConstraint implements Serializable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return constraints.toArray(new ScriptConstraintValue[constraints.size()]);
|
||||||
ScriptConstraintValue[] retVal = constraints.toArray(new ScriptConstraintValue[constraints.size()]);
|
|
||||||
return retVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -159,8 +159,7 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
|
|||||||
}
|
}
|
||||||
|
|
||||||
RMConstraintInfo info = caveatConfigService.addRMConstraint(listName, title, allowedValues);
|
RMConstraintInfo info = caveatConfigService.addRMConstraint(listName, title, allowedValues);
|
||||||
ScriptConstraint c = new ScriptConstraint(info, caveatConfigService, getAuthorityService());
|
return new ScriptConstraint(info, caveatConfigService, getAuthorityService());
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -51,7 +51,6 @@ public class BasicIdentifierGenerator extends IdentifierGeneratorBase
|
|||||||
|
|
||||||
Calendar fileCalendar = Calendar.getInstance();
|
Calendar fileCalendar = Calendar.getInstance();
|
||||||
String year = Integer.toString(fileCalendar.get(Calendar.YEAR));
|
String year = Integer.toString(fileCalendar.get(Calendar.YEAR));
|
||||||
String identifier = year + "-" + padString(dbId.toString(), 10);
|
return year + "-" + padString(dbId.toString(), 10);
|
||||||
return identifier;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user