Fixed minor issues ("Empty Statement") reported in Sonar

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@71951 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-05-27 21:10:37 +00:00
parent f50e604b7e
commit 4c78001a3b
3 changed files with 41 additions and 41 deletions

View File

@@ -88,7 +88,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
String actionName = action.getActionDefinitionName();
if (isOkToProceedWithAction(actionedUponNodeRef, actionName))
{
QName actionedUponType = nodeService.getType(actionedUponNodeRef);;
QName actionedUponType = nodeService.getType(actionedUponNodeRef);
boolean targetIsUnfiledRecords;
if (ACTION_FILETO.equals(action.getActionDefinitionName()))

View File

@@ -28,14 +28,14 @@ import org.alfresco.service.namespace.RegexQNamePattern;
/**
* Evaluates whether the node in question is transferring is either a transfer or accession.
*
*
* @author Roy Wetherall
*/
public class TransferEvaluator extends BaseEvaluator
{
/** indicates whether we are looking for accessions or transfers */
private boolean transferAccessionIndicator = false;
/**
* @param transferAccessionIndicator true if accession, false otherwise
*/
@@ -43,7 +43,7 @@ public class TransferEvaluator extends BaseEvaluator
{
this.transferAccessionIndicator = transferAccessionIndicator;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.jscript.app.BaseEvaluator#evaluateImpl(org.alfresco.service.cmr.repository.NodeRef)
*/
@@ -51,29 +51,29 @@ public class TransferEvaluator extends BaseEvaluator
protected boolean evaluateImpl(NodeRef nodeRef)
{
boolean result = false;
NodeRef transfer = getTransferNodeRef(nodeRef);
if (transfer != null)
{
boolean actual = ((Boolean)nodeService.getProperty(transfer, RecordsManagementModel.PROP_TRANSFER_ACCESSION_INDICATOR)).booleanValue();
result = (actual == transferAccessionIndicator);
}
return result;
}
/**
* Helper method to get the transfer node reference.
* <p>
* Takes into account records in tranferred record folders.
*
*
* @param nodeRef node reference
* @return {@link NodeRef} transfer node
*/
private NodeRef getTransferNodeRef(NodeRef nodeRef)
{
NodeRef result = null;
List<ChildAssociationRef> parents = nodeService.getParentAssocs(nodeRef, RecordsManagementModel.ASSOC_TRANSFERRED, RegexQNamePattern.MATCH_ALL);
if (parents.size() == 1)
{
@@ -90,10 +90,10 @@ public class TransferEvaluator extends BaseEvaluator
{
break;
}
};
}
}
}
return result;
}
}

View File

@@ -20,7 +20,7 @@ import org.apache.commons.logging.LogFactory;
* <p>
* Provides a way to record information about the capabilities being executed and report
* when an access denied exception is thrown.
*
*
* @author Roy Wetherall
* @since 2.2
*/
@@ -28,20 +28,20 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
{
/** logger */
protected static Log logger = LogFactory.getLog(RMMethodSecurityInterceptor.class);
/**
* Helper class to hold capability report information
*/
private static class CapabilityReport
{
public String name;
public AccessStatus status;
public AccessStatus status;
public Map<String, Boolean> conditions = new HashMap<String, Boolean>();
}
/**
* Helper method to translate vote to access status.
*
*
* @param vote vote
* @return {@link AccessStatus} access status
*/
@@ -59,7 +59,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
return AccessStatus.UNDETERMINED;
}
}
/**
* Current capability report details.
* <p>
@@ -68,17 +68,17 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
private static final ThreadLocal<Map<String, CapabilityReport>> capabilities = new ThreadLocal<Map<String, CapabilityReport>>()
{
@Override
protected Map<String, CapabilityReport> initialValue()
protected Map<String, CapabilityReport> initialValue()
{
return new HashMap<String, CapabilityReport>();
};
};
/**
* Get capability report object from the thread local, creating one for
* the given capability name if one does not already exist.
*
* @param name capability name
*
* @param name capability name
* @return {@link CapabilityReport} object containing information about the capability
*/
private static final CapabilityReport getCapabilityReport(String name)
@@ -89,15 +89,15 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
{
capability = new CapabilityReport();
capability.name = name;
map.put(name, capability);
}
return capability;
}
/**
* Report capability status.
*
*
* @param name capability name
* @param status capability status
*/
@@ -106,13 +106,13 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
if (logger.isDebugEnabled())
{
CapabilityReport capability = getCapabilityReport(name);
capability.status = translate(status);;
capability.status = translate(status);
}
}
/**
* Report capability condition.
*
*
* @param name capability name
* @param conditionName capability condition name
* @param expected expected value
@@ -130,23 +130,23 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
capability.conditions.put(conditionName, (expected == actual));
}
}
/**
* Gets the failure report for the currently recorded capabilities.
*
*
* @return {@link String} capability error report
*/
public String getFailureReport()
{
String result = null;
if (logger.isDebugEnabled())
{
Collection<CapabilityReport> capabilities = RMMethodSecurityInterceptor.capabilities.get().values();
if (!capabilities.isEmpty())
{
StringBuffer buffer = new StringBuffer("\n");
StringBuffer buffer = new StringBuffer("\n");
for (CapabilityReport capability : capabilities)
{
buffer.append(" ").append(capability.name).append(" (").append(capability.status).append(")\n");
@@ -167,14 +167,14 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
}
}
}
result = buffer.toString();
}
}
return result;
}
/**
* @see net.sf.acegisecurity.intercept.AbstractSecurityInterceptor#beforeInvocation(java.lang.Object)
*/
@@ -186,7 +186,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
{
// clear the capability report information
RMMethodSecurityInterceptor.capabilities.remove();
result = super.beforeInvocation(object);
}
catch (AccessDeniedException exception)
@@ -204,21 +204,21 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
}
return result;
}
/**
* @see net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)
*/
@Override
public Object invoke(MethodInvocation mi) throws Throwable
public Object invoke(MethodInvocation mi) throws Throwable
{
Object result = null;
InterceptorStatusToken token = beforeInvocation(mi);
try
try
{
result = mi.proceed();
}
finally
}
finally
{
result = super.afterInvocation(token, result);
}