mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fixed minor bugs (Redundant Throws) reported in Sonar
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@73861 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,7 +22,6 @@ import org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditSe
|
||||
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
@@ -66,7 +65,7 @@ public abstract class AuditableActionExecuterAbstractBase extends ActionExecuter
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
{
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
@@ -129,7 +129,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public Object decide(Authentication authentication, Object object, ConfigAttributeDefinition config, Object returnedObject) throws AccessDeniedException
|
||||
public Object decide(Authentication authentication, Object object, ConfigAttributeDefinition config, Object returnedObject)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
@@ -239,14 +239,14 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
|
||||
}
|
||||
|
||||
private PermissionCheckedValue decide(Authentication authentication, Object object, ConfigAttributeDefinition config, PermissionCheckedValue returnedObject) throws AccessDeniedException
|
||||
private PermissionCheckedValue decide(Authentication authentication, Object object, ConfigAttributeDefinition config, PermissionCheckedValue returnedObject)
|
||||
{
|
||||
// This passes as it has already been filtered
|
||||
// TODO: Get the filter that was applied and double-check
|
||||
return returnedObject;
|
||||
}
|
||||
|
||||
private PermissionCheckValue decide(Authentication authentication, Object object, ConfigAttributeDefinition config, PermissionCheckValue returnedObject) throws AccessDeniedException
|
||||
private PermissionCheckValue decide(Authentication authentication, Object object, ConfigAttributeDefinition config, PermissionCheckValue returnedObject)
|
||||
{
|
||||
// Get the wrapped value
|
||||
NodeRef nodeRef = returnedObject.getNodeRef();
|
||||
@@ -255,8 +255,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
return returnedObject;
|
||||
}
|
||||
|
||||
private NodeRef decide(Authentication authentication, Object object, ConfigAttributeDefinition config, NodeRef returnedObject) throws AccessDeniedException
|
||||
|
||||
private NodeRef decide(Authentication authentication, Object object, ConfigAttributeDefinition config, NodeRef returnedObject)
|
||||
{
|
||||
if (returnedObject == null)
|
||||
{
|
||||
@@ -322,8 +321,6 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
}
|
||||
|
||||
private ChildAssociationRef decide(Authentication authentication, Object object, ConfigAttributeDefinition config, ChildAssociationRef returnedObject)
|
||||
throws AccessDeniedException
|
||||
|
||||
{
|
||||
if (returnedObject == null)
|
||||
{
|
||||
@@ -373,8 +370,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
return returnedObject;
|
||||
}
|
||||
|
||||
private AssociationRef decide(Authentication authentication, Object object, ConfigAttributeDefinition config, AssociationRef returnedObject) throws AccessDeniedException
|
||||
|
||||
private AssociationRef decide(Authentication authentication, Object object, ConfigAttributeDefinition config, AssociationRef returnedObject)
|
||||
{
|
||||
if (returnedObject == null)
|
||||
{
|
||||
@@ -416,16 +412,14 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
return returnedObject;
|
||||
}
|
||||
|
||||
private ResultSet decide(Authentication authentication, Object object, ConfigAttributeDefinition config, PagingLuceneResultSet returnedObject) throws AccessDeniedException
|
||||
|
||||
private ResultSet decide(Authentication authentication, Object object, ConfigAttributeDefinition config, PagingLuceneResultSet returnedObject)
|
||||
{
|
||||
ResultSet raw = returnedObject.getWrapped();
|
||||
ResultSet filteredForPermissions = decide(authentication, object, config, raw);
|
||||
return new PagingLuceneResultSet(filteredForPermissions, returnedObject.getResultSetMetaData().getSearchParameters(), nodeService);
|
||||
}
|
||||
|
||||
private ResultSet decide(Authentication authentication, Object object, ConfigAttributeDefinition config, ResultSet returnedObject) throws AccessDeniedException
|
||||
|
||||
private ResultSet decide(Authentication authentication, Object object, ConfigAttributeDefinition config, ResultSet returnedObject)
|
||||
{
|
||||
if (returnedObject == null)
|
||||
{
|
||||
@@ -569,8 +563,6 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
}
|
||||
|
||||
private QueryEngineResults decide(Authentication authentication, Object object, ConfigAttributeDefinition config, QueryEngineResults returnedObject)
|
||||
throws AccessDeniedException
|
||||
|
||||
{
|
||||
Map<Set<String>, ResultSet> map = returnedObject.getResults();
|
||||
Map<Set<String>, ResultSet> answer = new HashMap<Set<String>, ResultSet>(map.size(), 1.0f);
|
||||
@@ -594,7 +586,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
private Collection decide(Authentication authentication, Object object, ConfigAttributeDefinition config, Collection returnedObject) throws AccessDeniedException
|
||||
private Collection decide(Authentication authentication, Object object, ConfigAttributeDefinition config, Collection returnedObject)
|
||||
{
|
||||
if (returnedObject == null)
|
||||
{
|
||||
@@ -788,7 +780,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
return PermissionCheckedCollectionMixin.create(returnedObject, cutoff, checksRemaining, sizeOriginal);
|
||||
}
|
||||
|
||||
private Object[] decide(Authentication authentication, Object object, ConfigAttributeDefinition config, Object[] returnedObject) throws AccessDeniedException
|
||||
private Object[] decide(Authentication authentication, Object object, ConfigAttributeDefinition config, Object[] returnedObject)
|
||||
{
|
||||
// Assumption: value is not null
|
||||
BitSet incudedSet = new BitSet(returnedObject.length);
|
||||
@@ -952,7 +944,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes" })
|
||||
private Map decide(Authentication authentication, Object object, ConfigAttributeDefinition config, Map returnedObject) throws AccessDeniedException
|
||||
private Map decide(Authentication authentication, Object object, ConfigAttributeDefinition config, Map returnedObject)
|
||||
{
|
||||
try {
|
||||
if (returnedObject.containsKey(RecordsManagementModel.PROP_HOLD_REASON))
|
||||
|
@@ -36,7 +36,6 @@ import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
@@ -71,7 +70,7 @@ public class RMSecurityCommon implements ApplicationContextAware
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
{
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.model.compatibility;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
@@ -23,7 +22,7 @@ public class DictionaryBootstrapPostProcessor implements BeanFactoryPostProcesso
|
||||
* @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
|
||||
*/
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
|
||||
{
|
||||
// if the site service bootstrap bean and the RM dictionary bean are present in the bean factory
|
||||
if (beanFactory.containsBean(BEAN_SITESERVICE_BOOTSTRAP) &&
|
||||
|
@@ -22,7 +22,6 @@ import java.util.List;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.patch.compatibility.ModulePatchComponent;
|
||||
import org.alfresco.repo.module.ModuleComponent;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
@@ -43,7 +42,7 @@ public abstract class RMv21PatchComponent extends ModulePatchComponent
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
{
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
@@ -21,7 +21,6 @@ package org.alfresco.module.org_alfresco_module_rm.report.generator;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.module.org_alfresco_module_rm.report.Report;
|
||||
import org.alfresco.module.org_alfresco_module_rm.report.ReportGenerator;
|
||||
import org.alfresco.module.org_alfresco_module_rm.report.ReportService;
|
||||
@@ -124,9 +123,8 @@ public abstract class BaseReportGenerator implements ReportGenerator
|
||||
* Throws AlfrescoRuntimeException if applicability fails, with reason.
|
||||
*
|
||||
* @param reportedUponNodeRef reported upon node reference
|
||||
* @throws AlfrescoRuntimeException if applicability check fails
|
||||
*/
|
||||
protected abstract void checkReportApplicability(NodeRef reportedUponNodeRef) throws AlfrescoRuntimeException;
|
||||
protected abstract void checkReportApplicability(NodeRef reportedUponNodeRef);
|
||||
|
||||
/**
|
||||
* Generate the report name
|
||||
|
@@ -313,7 +313,7 @@ public class DeclarativeReportGenerator extends BaseReportGenerator
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.report.generator.BaseReportGenerator#checkReportApplicability(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void checkReportApplicability(NodeRef reportedUponNodeRef) throws AlfrescoRuntimeException
|
||||
protected void checkReportApplicability(NodeRef reportedUponNodeRef)
|
||||
{
|
||||
if (applicableTypes != null && applicableTypes.size() != 0)
|
||||
{
|
||||
|
@@ -27,7 +27,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
@@ -96,7 +95,7 @@ public abstract class ExtendedSecurityBaseDynamicAuthority implements DynamicAut
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
{
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
@@ -26,7 +26,6 @@ import java.util.Set;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.PropertyValue;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
@@ -80,7 +79,7 @@ public class RMMethodSecurityPostProcessor implements BeanFactoryPostProcessor
|
||||
* @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
|
||||
*/
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
|
||||
{
|
||||
for (String bean : getSecurityBeanNames(beanFactory))
|
||||
{
|
||||
|
@@ -20,7 +20,6 @@ package org.alfresco.module.org_alfresco_module_rm.util;
|
||||
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.PropertyValue;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
@@ -64,7 +63,7 @@ public class BeanExtender implements BeanFactoryPostProcessor
|
||||
* @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
|
||||
*/
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
|
||||
{
|
||||
ParameterCheck.mandatory("beanName", beanName);
|
||||
ParameterCheck.mandatory("extendingBeanName", extendingBeanName);
|
||||
|
@@ -46,7 +46,7 @@ public class QNameTypeEditor extends PropertyEditorSupport
|
||||
* @see java.beans.PropertyEditorSupport#setAsText(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setAsText(String text) throws IllegalArgumentException
|
||||
public void setAsText(String text)
|
||||
{
|
||||
// convert prefix string to QName
|
||||
setValue(QName.createQName(text, namespaceService));
|
||||
|
@@ -33,7 +33,6 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
@@ -58,7 +57,7 @@ public class ServiceBaseImpl implements RecordsManagementModel, ApplicationConte
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
{
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
|
||||
/**
|
||||
@@ -68,7 +67,7 @@ public class AnnotatedBehaviourPostProcessor implements BeanPostProcessor
|
||||
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName)
|
||||
{
|
||||
// register annotated behavior methods
|
||||
registerBehaviours(bean, beanName);
|
||||
@@ -81,7 +80,7 @@ public class AnnotatedBehaviourPostProcessor implements BeanPostProcessor
|
||||
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName)
|
||||
{
|
||||
// do nothing
|
||||
return bean;
|
||||
|
Reference in New Issue
Block a user