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:
Tuna Aksoy
2014-06-15 12:16:08 +00:00
parent 114c198b44
commit 20f6fee1db
13 changed files with 59 additions and 78 deletions

View File

@@ -22,7 +22,6 @@ import org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditSe
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase; import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; 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) * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/ */
@Override @Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException public void setApplicationContext(ApplicationContext applicationContext)
{ {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }

View File

@@ -129,7 +129,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
} }
@SuppressWarnings("rawtypes") @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()) 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 // This passes as it has already been filtered
// TODO: Get the filter that was applied and double-check // TODO: Get the filter that was applied and double-check
return returnedObject; 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 // Get the wrapped value
NodeRef nodeRef = returnedObject.getNodeRef(); NodeRef nodeRef = returnedObject.getNodeRef();
@@ -255,8 +255,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
return returnedObject; 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) if (returnedObject == null)
{ {
@@ -322,8 +321,6 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
} }
private ChildAssociationRef decide(Authentication authentication, Object object, ConfigAttributeDefinition config, ChildAssociationRef returnedObject) private ChildAssociationRef decide(Authentication authentication, Object object, ConfigAttributeDefinition config, ChildAssociationRef returnedObject)
throws AccessDeniedException
{ {
if (returnedObject == null) if (returnedObject == null)
{ {
@@ -373,8 +370,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
return returnedObject; 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) if (returnedObject == null)
{ {
@@ -416,16 +412,14 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
return returnedObject; 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 raw = returnedObject.getWrapped();
ResultSet filteredForPermissions = decide(authentication, object, config, raw); ResultSet filteredForPermissions = decide(authentication, object, config, raw);
return new PagingLuceneResultSet(filteredForPermissions, returnedObject.getResultSetMetaData().getSearchParameters(), nodeService); 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) if (returnedObject == null)
{ {
@@ -569,8 +563,6 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
} }
private QueryEngineResults decide(Authentication authentication, Object object, ConfigAttributeDefinition config, QueryEngineResults returnedObject) private QueryEngineResults decide(Authentication authentication, Object object, ConfigAttributeDefinition config, QueryEngineResults returnedObject)
throws AccessDeniedException
{ {
Map<Set<String>, ResultSet> map = returnedObject.getResults(); Map<Set<String>, ResultSet> map = returnedObject.getResults();
Map<Set<String>, ResultSet> answer = new HashMap<Set<String>, ResultSet>(map.size(), 1.0f); 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" }) @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) if (returnedObject == null)
{ {
@@ -788,7 +780,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
return PermissionCheckedCollectionMixin.create(returnedObject, cutoff, checksRemaining, sizeOriginal); 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 // Assumption: value is not null
BitSet incudedSet = new BitSet(returnedObject.length); BitSet incudedSet = new BitSet(returnedObject.length);
@@ -952,7 +944,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
} }
@SuppressWarnings({"unchecked", "rawtypes" }) @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 { try {
if (returnedObject.containsKey(RecordsManagementModel.PROP_HOLD_REASON)) if (returnedObject.containsKey(RecordsManagementModel.PROP_HOLD_REASON))

View File

@@ -36,7 +36,6 @@ import org.alfresco.service.cmr.security.PermissionService;
import org.aopalliance.intercept.MethodInvocation; import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
@@ -71,7 +70,7 @@ public class RMSecurityCommon implements ApplicationContextAware
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext) * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/ */
@Override @Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException public void setApplicationContext(ApplicationContext applicationContext)
{ {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }
@@ -222,12 +221,12 @@ public class RMSecurityCommon implements ApplicationContextAware
{ {
// log message // log message
RMMethodSecurityInterceptor.addMessage("User does not have read record permission on node, access denied. (nodeRef={0}, user={1})", nodeRef, AuthenticationUtil.getRunAsUser()); RMMethodSecurityInterceptor.addMessage("User does not have read record permission on node, access denied. (nodeRef={0}, user={1})", nodeRef, AuthenticationUtil.getRunAsUser());
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
logger.debug("\t\tUser does not have read record permission on node, access denied. (nodeRef=" + nodeRef.toString() + ", user=" + AuthenticationUtil.getRunAsUser() + ")"); logger.debug("\t\tUser does not have read record permission on node, access denied. (nodeRef=" + nodeRef.toString() + ", user=" + AuthenticationUtil.getRunAsUser() + ")");
} }
return setTransactionCache("checkRmRead", nodeRef, AccessDecisionVoter.ACCESS_DENIED); return setTransactionCache("checkRmRead", nodeRef, AccessDecisionVoter.ACCESS_DENIED);
} }
@@ -235,7 +234,7 @@ public class RMSecurityCommon implements ApplicationContextAware
{ {
// log capability details // log capability details
RMMethodSecurityInterceptor.reportCapabilityStatus(RMPermissionModel.VIEW_RECORDS, AccessDecisionVoter.ACCESS_DENIED); RMMethodSecurityInterceptor.reportCapabilityStatus(RMPermissionModel.VIEW_RECORDS, AccessDecisionVoter.ACCESS_DENIED);
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
logger.debug("\t\tUser does not have view records capability permission on node, access denied. (filePlan=" + filePlan.toString() + ", user=" + AuthenticationUtil.getRunAsUser() + ")"); logger.debug("\t\tUser does not have view records capability permission on node, access denied. (filePlan=" + filePlan.toString() + ", user=" + AuthenticationUtil.getRunAsUser() + ")");

View File

@@ -1,6 +1,5 @@
package org.alfresco.module.org_alfresco_module_rm.model.compatibility; 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.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
@@ -9,7 +8,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
* Dictionary bootstap post processor. * Dictionary bootstap post processor.
* <p> * <p>
* Ensures compatibility with 4.2 and 4.2.1 as well as 4.2.2. * Ensures compatibility with 4.2 and 4.2.1 as well as 4.2.2.
* *
* @author Roy Wetherall * @author Roy Wetherall
* @since 2.2 * @since 2.2
*/ */
@@ -18,20 +17,20 @@ public class DictionaryBootstrapPostProcessor implements BeanFactoryPostProcesso
/** bean id's */ /** bean id's */
private static final String BEAN_SITESERVICE_BOOTSTRAP = "siteService_dictionaryBootstrap"; private static final String BEAN_SITESERVICE_BOOTSTRAP = "siteService_dictionaryBootstrap";
private static final String BEAN_RM_DICTIONARY_BOOTSTRAP = "org_alfresco_module_rm_dictionaryBootstrap"; private static final String BEAN_RM_DICTIONARY_BOOTSTRAP = "org_alfresco_module_rm_dictionaryBootstrap";
/** /**
* @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory) * @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
*/ */
@Override @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 the site service bootstrap bean and the RM dictionary bean are present in the bean factory
if (beanFactory.containsBean(BEAN_SITESERVICE_BOOTSTRAP) && if (beanFactory.containsBean(BEAN_SITESERVICE_BOOTSTRAP) &&
beanFactory.containsBean(BEAN_RM_DICTIONARY_BOOTSTRAP)) beanFactory.containsBean(BEAN_RM_DICTIONARY_BOOTSTRAP))
{ {
// get the RM dictionary bootstrap bean definition // get the RM dictionary bootstrap bean definition
BeanDefinition beanDef = beanFactory.getBeanDefinition(BEAN_RM_DICTIONARY_BOOTSTRAP); BeanDefinition beanDef = beanFactory.getBeanDefinition(BEAN_RM_DICTIONARY_BOOTSTRAP);
// set the dependency // set the dependency
beanDef.setDependsOn(new String[]{BEAN_SITESERVICE_BOOTSTRAP}); beanDef.setDependsOn(new String[]{BEAN_SITESERVICE_BOOTSTRAP});
} }

View File

@@ -22,13 +22,12 @@ import java.util.List;
import org.alfresco.module.org_alfresco_module_rm.patch.compatibility.ModulePatchComponent; import org.alfresco.module.org_alfresco_module_rm.patch.compatibility.ModulePatchComponent;
import org.alfresco.repo.module.ModuleComponent; import org.alfresco.repo.module.ModuleComponent;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
/** /**
* Convenience class to ensure all V2.0 patches are executed before v2.1 * Convenience class to ensure all V2.0 patches are executed before v2.1
* *
* @author Roy Wetherall * @author Roy Wetherall
* @since 2.2 * @since 2.2
*/ */
@@ -38,16 +37,16 @@ public abstract class RMv21PatchComponent extends ModulePatchComponent
{ {
/** application context */ /** application context */
private ApplicationContext applicationContext; private ApplicationContext applicationContext;
/** /**
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext) * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/ */
@Override @Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException public void setApplicationContext(ApplicationContext applicationContext)
{ {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }
/** /**
* init method * init method
*/ */
@@ -55,7 +54,7 @@ public abstract class RMv21PatchComponent extends ModulePatchComponent
public void init() public void init()
{ {
super.init(); super.init();
// manual addition of V20 patch dependencies // manual addition of V20 patch dependencies
List<ModuleComponent> depends = getDependsOn(); List<ModuleComponent> depends = getDependsOn();
addDependency(depends, "org_alfresco_module_rm_notificationTemplatePatch"); addDependency(depends, "org_alfresco_module_rm_notificationTemplatePatch");
@@ -63,7 +62,7 @@ public abstract class RMv21PatchComponent extends ModulePatchComponent
addDependency(depends, "org_alfresco_module_rm_RMv2FilePlanNodeRefPatch"); addDependency(depends, "org_alfresco_module_rm_RMv2FilePlanNodeRefPatch");
addDependency(depends, "org_alfresco_module_rm_RMv2SavedSearchPatch"); addDependency(depends, "org_alfresco_module_rm_RMv2SavedSearchPatch");
} }
/** /**
* @param depends list of module dependencies * @param depends list of module dependencies
* @param beanName bean name * @param beanName bean name

View File

@@ -21,7 +21,6 @@ package org.alfresco.module.org_alfresco_module_rm.report.generator;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map; 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.Report;
import org.alfresco.module.org_alfresco_module_rm.report.ReportGenerator; import org.alfresco.module.org_alfresco_module_rm.report.ReportGenerator;
import org.alfresco.module.org_alfresco_module_rm.report.ReportService; import org.alfresco.module.org_alfresco_module_rm.report.ReportService;
@@ -33,7 +32,7 @@ import org.alfresco.util.ParameterCheck;
/** /**
* Base report generator. * Base report generator.
* *
* @author Roy Wetherall * @author Roy Wetherall
* @since 2.1 * @since 2.1
*/ */
@@ -63,7 +62,7 @@ public abstract class BaseReportGenerator implements ReportGenerator
{ {
this.namespaceService = namespaceService; this.namespaceService = namespaceService;
} }
/** /**
* @param reportType report type * @param reportType report type
*/ */
@@ -71,7 +70,7 @@ public abstract class BaseReportGenerator implements ReportGenerator
{ {
this.reportType = reportType; this.reportType = reportType;
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.report.ReportGenerator#getReportType() * @see org.alfresco.module.org_alfresco_module_rm.report.ReportGenerator#getReportType()
*/ */
@@ -88,7 +87,7 @@ public abstract class BaseReportGenerator implements ReportGenerator
{ {
// ensure required values have been set // ensure required values have been set
ParameterCheck.mandatory("reportType", reportType); ParameterCheck.mandatory("reportType", reportType);
// register report generator // register report generator
reportService.registerReportGenerator(this); reportService.registerReportGenerator(this);
} }
@@ -104,29 +103,28 @@ public abstract class BaseReportGenerator implements ReportGenerator
// check the applicability of the report generator for the given reported upon node // check the applicability of the report generator for the given reported upon node
checkReportApplicability(reportedUponNodeRef); checkReportApplicability(reportedUponNodeRef);
// generate the report name // generate the report name
String reportName = generateReportName(reportedUponNodeRef, mimetype); String reportName = generateReportName(reportedUponNodeRef, mimetype);
// generate the report meta-data // generate the report meta-data
Map<QName, Serializable> reportProperties = generateReportMetadata(reportedUponNodeRef); Map<QName, Serializable> reportProperties = generateReportMetadata(reportedUponNodeRef);
// generate the report content // generate the report content
ContentReader contentReader = generateReportContent(reportedUponNodeRef, mimetype, generateReportTemplateContext(reportedUponNodeRef)); ContentReader contentReader = generateReportContent(reportedUponNodeRef, mimetype, generateReportTemplateContext(reportedUponNodeRef));
// return the report information object // return the report information object
return new ReportInfo(reportType, reportName, reportProperties, contentReader); return new ReportInfo(reportType, reportName, reportProperties, contentReader);
} }
/** /**
* Checks whether the report generator is applicable given the reported upon node reference. * Checks whether the report generator is applicable given the reported upon node reference.
* <p> * <p>
* Throws AlfrescoRuntimeException if applicability fails, with reason. * Throws AlfrescoRuntimeException if applicability fails, with reason.
* *
* @param reportedUponNodeRef reported upon node reference * @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 * Generate the report name
@@ -137,7 +135,7 @@ public abstract class BaseReportGenerator implements ReportGenerator
* Generate the report template context. * Generate the report template context.
*/ */
protected abstract Map<String, Serializable> generateReportTemplateContext(NodeRef reportedUponNodeRef); protected abstract Map<String, Serializable> generateReportTemplateContext(NodeRef reportedUponNodeRef);
/** /**
* Generate report meta-data * Generate report meta-data
*/ */

View File

@@ -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) * @see org.alfresco.module.org_alfresco_module_rm.report.generator.BaseReportGenerator#checkReportApplicability(org.alfresco.service.cmr.repository.NodeRef)
*/ */
@Override @Override
protected void checkReportApplicability(NodeRef reportedUponNodeRef) throws AlfrescoRuntimeException protected void checkReportApplicability(NodeRef reportedUponNodeRef)
{ {
if (applicableTypes != null && applicableTypes.size() != 0) if (applicableTypes != null && applicableTypes.size() != 0)
{ {

View File

@@ -27,7 +27,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.AuthorityService; import org.alfresco.service.cmr.security.AuthorityService;
import org.alfresco.service.cmr.security.AuthorityType; import org.alfresco.service.cmr.security.AuthorityType;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; 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) * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/ */
@Override @Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException public void setApplicationContext(ApplicationContext applicationContext)
{ {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }

View File

@@ -26,7 +26,6 @@ import java.util.Set;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; 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) * @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
*/ */
@Override @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
{ {
for (String bean : getSecurityBeanNames(beanFactory)) for (String bean : getSecurityBeanNames(beanFactory))
{ {

View File

@@ -20,7 +20,6 @@ package org.alfresco.module.org_alfresco_module_rm.util;
import org.alfresco.util.ParameterCheck; import org.alfresco.util.ParameterCheck;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.NoSuchBeanDefinitionException;
@@ -32,7 +31,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
* Extends the definition of a bean with another. * Extends the definition of a bean with another.
* <p> * <p>
* Implements bean factory post processor. * Implements bean factory post processor.
* *
* @author Roy Wetherall * @author Roy Wetherall
* @since 2.2 * @since 2.2
*/ */
@@ -40,10 +39,10 @@ public class BeanExtender implements BeanFactoryPostProcessor
{ {
/** name of bean to extend */ /** name of bean to extend */
private String beanName; private String beanName;
/** extending bean name */ /** extending bean name */
private String extendingBeanName; private String extendingBeanName;
/** /**
* @param beanName bean name * @param beanName bean name
*/ */
@@ -51,7 +50,7 @@ public class BeanExtender implements BeanFactoryPostProcessor
{ {
this.beanName = beanName; this.beanName = beanName;
} }
/** /**
* @param extendingBeanName extending bean name * @param extendingBeanName extending bean name
*/ */
@@ -59,12 +58,12 @@ public class BeanExtender implements BeanFactoryPostProcessor
{ {
this.extendingBeanName = extendingBeanName; this.extendingBeanName = extendingBeanName;
} }
/** /**
* @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory) * @see org.springframework.beans.factory.config.BeanFactoryPostProcessor#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
*/ */
@Override @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
{ {
ParameterCheck.mandatory("beanName", beanName); ParameterCheck.mandatory("beanName", beanName);
ParameterCheck.mandatory("extendingBeanName", extendingBeanName); ParameterCheck.mandatory("extendingBeanName", extendingBeanName);
@@ -74,24 +73,24 @@ public class BeanExtender implements BeanFactoryPostProcessor
{ {
throw new NoSuchBeanDefinitionException("Can't find bean '" + beanName + "' to be extended."); throw new NoSuchBeanDefinitionException("Can't find bean '" + beanName + "' to be extended.");
} }
// check for extending bean // check for extending bean
if (!beanFactory.containsBean(extendingBeanName)) if (!beanFactory.containsBean(extendingBeanName))
{ {
throw new NoSuchBeanDefinitionException("Can't find bean '" + extendingBeanName + "' that is going to extend origional bean definition."); throw new NoSuchBeanDefinitionException("Can't find bean '" + extendingBeanName + "' that is going to extend origional bean definition.");
} }
// get the bean definitions // get the bean definitions
BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName); BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName);
BeanDefinition extendingBeanDefinition = beanFactory.getBeanDefinition(extendingBeanName); BeanDefinition extendingBeanDefinition = beanFactory.getBeanDefinition(extendingBeanName);
// update class // update class
if (StringUtils.isNotBlank(extendingBeanDefinition.getBeanClassName()) && if (StringUtils.isNotBlank(extendingBeanDefinition.getBeanClassName()) &&
!beanDefinition.getBeanClassName().equals(extendingBeanDefinition.getBeanClassName())) !beanDefinition.getBeanClassName().equals(extendingBeanDefinition.getBeanClassName()))
{ {
beanDefinition.setBeanClassName(extendingBeanDefinition.getBeanClassName()); beanDefinition.setBeanClassName(extendingBeanDefinition.getBeanClassName());
} }
// update properties // update properties
MutablePropertyValues properties = beanDefinition.getPropertyValues(); MutablePropertyValues properties = beanDefinition.getPropertyValues();
MutablePropertyValues extendingProperties = extendingBeanDefinition.getPropertyValues(); MutablePropertyValues extendingProperties = extendingBeanDefinition.getPropertyValues();

View File

@@ -25,7 +25,7 @@ import org.alfresco.service.namespace.QName;
/** /**
* QName type editor. * QName type editor.
* *
* @author Roy Wetherall * @author Roy Wetherall
* @since 2.2 * @since 2.2
*/ */
@@ -33,7 +33,7 @@ public class QNameTypeEditor extends PropertyEditorSupport
{ {
/** namespace service */ /** namespace service */
private NamespaceService namespaceService; private NamespaceService namespaceService;
/** /**
* @param namespaceService namespace service * @param namespaceService namespace service
*/ */
@@ -41,12 +41,12 @@ public class QNameTypeEditor extends PropertyEditorSupport
{ {
this.namespaceService = namespaceService; this.namespaceService = namespaceService;
} }
/** /**
* @see java.beans.PropertyEditorSupport#setAsText(java.lang.String) * @see java.beans.PropertyEditorSupport#setAsText(java.lang.String)
*/ */
@Override @Override
public void setAsText(String text) throws IllegalArgumentException public void setAsText(String text)
{ {
// convert prefix string to QName // convert prefix string to QName
setValue(QName.createQName(text, namespaceService)); setValue(QName.createQName(text, namespaceService));

View File

@@ -33,7 +33,6 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.util.ParameterCheck; import org.alfresco.util.ParameterCheck;
import org.alfresco.util.PropertyMap; import org.alfresco.util.PropertyMap;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; 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) * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/ */
@Override @Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException public void setApplicationContext(ApplicationContext applicationContext)
{ {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }

View File

@@ -27,7 +27,6 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.util.ParameterCheck; import org.alfresco.util.ParameterCheck;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor; 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) * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
*/ */
@Override @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException public Object postProcessAfterInitialization(Object bean, String beanName)
{ {
// register annotated behavior methods // register annotated behavior methods
registerBehaviours(bean, beanName); 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) * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
*/ */
@Override @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException public Object postProcessBeforeInitialization(Object bean, String beanName)
{ {
// do nothing // do nothing
return bean; return bean;