Fixed major issues ("Illegal Throws") reported in Sonar

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@71958 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-05-27 22:20:44 +00:00
parent 1441c42f45
commit cbe6192307
27 changed files with 88 additions and 90 deletions

View File

@@ -93,7 +93,7 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
{ {
RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>() RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>()
{ {
public Void execute() throws Throwable public Void execute()
{ {
recordsManagementActionService.register(RecordsManagementActionConditionEvaluatorAbstractBase.this); recordsManagementActionService.register(RecordsManagementActionConditionEvaluatorAbstractBase.this);

View File

@@ -84,7 +84,7 @@ public final class AuthenticatedUserRolesDataExtractor extends AbstractDataExtra
/** /**
* @see org.alfresco.repo.audit.extractor.DataExtractor#extractData(java.io.Serializable) * @see org.alfresco.repo.audit.extractor.DataExtractor#extractData(java.io.Serializable)
*/ */
public Serializable extractData(Serializable value) throws Throwable public Serializable extractData(Serializable value)
{ {
NodeRef nodeRef = (NodeRef) value; NodeRef nodeRef = (NodeRef) value;
String user = AuthenticationUtil.getFullyAuthenticatedUser(); String user = AuthenticationUtil.getFullyAuthenticatedUser();

View File

@@ -58,7 +58,7 @@ public final class FilePlanIdentifierDataExtractor extends AbstractDataExtractor
return nodeService.hasAspect((NodeRef)data, RecordsManagementModel.ASPECT_RECORD_COMPONENT_ID); return nodeService.hasAspect((NodeRef)data, RecordsManagementModel.ASPECT_RECORD_COMPONENT_ID);
} }
public Serializable extractData(Serializable value) throws Throwable public Serializable extractData(Serializable value)
{ {
NodeRef nodeRef = (NodeRef) value; NodeRef nodeRef = (NodeRef) value;

View File

@@ -75,7 +75,7 @@ public final class FilePlanNamePathDataExtractor extends AbstractDataExtractor
/** /**
* @see org.alfresco.repo.audit.extractor.DataExtractor#extractData(java.io.Serializable) * @see org.alfresco.repo.audit.extractor.DataExtractor#extractData(java.io.Serializable)
*/ */
public Serializable extractData(Serializable value) throws Throwable public Serializable extractData(Serializable value)
{ {
NodeRef nodeRef = (NodeRef) value; NodeRef nodeRef = (NodeRef) value;

View File

@@ -68,7 +68,7 @@ public final class FilePlanNodeRefPathDataExtractor extends AbstractDataExtracto
return nodeService.hasAspect((NodeRef)data, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT); return nodeService.hasAspect((NodeRef)data, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT);
} }
public Serializable extractData(Serializable value) throws Throwable public Serializable extractData(Serializable value)
{ {
NodeRef nodeRef = (NodeRef) value; NodeRef nodeRef = (NodeRef) value;

View File

@@ -77,7 +77,7 @@ public class RecordsManagementBootstrap extends AbstractLifecycleBean
{ {
RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>() RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>()
{ {
public Void execute() throws Throwable public Void execute()
{ {
// initialise caveat config // initialise caveat config
caveatConfigService.init(); caveatConfigService.init();

View File

@@ -392,7 +392,7 @@ public class CustomEmailMappingServiceImpl extends AbstractLifecycleBean impleme
{ {
RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>() RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>()
{ {
public Void execute() throws Throwable public Void execute()
{ {
try try
{ {

View File

@@ -173,7 +173,7 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
RetryingTransactionCallback<Boolean> processTranCB = new RetryingTransactionCallback<Boolean>() RetryingTransactionCallback<Boolean> processTranCB = new RetryingTransactionCallback<Boolean>()
{ {
public Boolean execute() throws Throwable public Boolean execute()
{ {
final String dispAction = (String) nodeService.getProperty(currentNode, RecordsManagementModel.PROP_DISPOSITION_ACTION); final String dispAction = (String) nodeService.getProperty(currentNode, RecordsManagementModel.PROP_DISPOSITION_ACTION);

View File

@@ -107,7 +107,7 @@ public class NotifyOfRecordsDueForReviewJobExecuter extends RecordsManagementJob
RetryingTransactionCallback<Boolean> txCallbackSendEmail = new RetryingTransactionCallback<Boolean>() RetryingTransactionCallback<Boolean> txCallbackSendEmail = new RetryingTransactionCallback<Boolean>()
{ {
// Set the notification issued property. // Set the notification issued property.
public Boolean execute() throws Throwable public Boolean execute()
{ {
// Send notification // Send notification
recordsManagementNotificationHelper.recordsDueForReviewEmailNotification(resultNodes); recordsManagementNotificationHelper.recordsDueForReviewEmailNotification(resultNodes);
@@ -119,7 +119,7 @@ public class NotifyOfRecordsDueForReviewJobExecuter extends RecordsManagementJob
RetryingTransactionCallback<Boolean> txUpdateNodesCallback = new RetryingTransactionCallback<Boolean>() RetryingTransactionCallback<Boolean> txUpdateNodesCallback = new RetryingTransactionCallback<Boolean>()
{ {
// Set the notification issued property. // Set the notification issued property.
public Boolean execute() throws Throwable public Boolean execute()
{ {
for (NodeRef node : resultNodes) for (NodeRef node : resultNodes)
{ {

View File

@@ -201,7 +201,7 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
new RetryingTransactionHelper.RetryingTransactionCallback<List<NodeRef>>() new RetryingTransactionHelper.RetryingTransactionCallback<List<NodeRef>>()
{ {
@Override @Override
public List<NodeRef> execute() throws Throwable public List<NodeRef> execute()
{ {
// Build the query string // Build the query string
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@@ -251,7 +251,7 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
new RetryingTransactionHelper.RetryingTransactionCallback<Void>() new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
{ {
@Override @Override
public Void execute() throws Throwable public Void execute()
{ {
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
@@ -287,7 +287,7 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
new RetryingTransactionHelper.RetryingTransactionCallback<Void>() new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
{ {
@Override @Override
public Void execute() throws Throwable public Void execute()
{ {
behaviourFilter.disableBehaviour(nodeRef, TYPE_DISPOSITION_ACTION_DEFINITION); behaviourFilter.disableBehaviour(nodeRef, TYPE_DISPOSITION_ACTION_DEFINITION);
try try
@@ -358,7 +358,7 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
new RetryingTransactionHelper.RetryingTransactionCallback<Void>() new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
{ {
@Override @Override
public Void execute() throws Throwable public Void execute()
{ {
behaviourFilter.disableBehaviour(nodeRef, TYPE_DISPOSITION_ACTION_DEFINITION); behaviourFilter.disableBehaviour(nodeRef, TYPE_DISPOSITION_ACTION_DEFINITION);
try try

View File

@@ -63,7 +63,7 @@ public abstract class RecordsManagementJobExecuter implements RecordsManagementM
retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<Void>() retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<Void>()
{ {
@Override @Override
public Void execute() throws Throwable public Void execute()
{ {
executeImpl(); executeImpl();

View File

@@ -233,7 +233,7 @@ public abstract class AbstractModulePatch implements ModulePatch, BeanNameAware
* @see org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback#execute() * @see org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback#execute()
*/ */
@Override @Override
public Void execute() throws Throwable public Void execute()
{ {
applyInternal(); applyInternal();
return null; return null;

View File

@@ -97,7 +97,7 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executeInternal() throws Throwable protected void executeInternal()
{ {
// get current schema version // get current schema version
int currentSchema = getCurrentSchema(); int currentSchema = getCurrentSchema();

View File

@@ -85,7 +85,7 @@ public abstract class ModulePatchComponent extends AbstractModuleComponent
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executeInternal() throws Throwable protected void executeInternal()
{ {
try try
{ {
@@ -98,7 +98,7 @@ public abstract class ModulePatchComponent extends AbstractModuleComponent
retryingTransactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>() retryingTransactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
{ {
@Override @Override
public Void execute() throws Throwable public Void execute()
{ {
behaviourFilter.disableBehaviour(); behaviourFilter.disableBehaviour();
try try
@@ -132,8 +132,6 @@ public abstract class ModulePatchComponent extends AbstractModuleComponent
/** /**
* Execute patch work. * Execute patch work.
*
* @throws Throwable
*/ */
protected abstract void executePatch() throws Throwable; protected abstract void executePatch();
} }

View File

@@ -126,7 +126,7 @@ public class NotificationTemplatePatch extends ModulePatchComponent
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
NodeRef supersededTemplate = notificationHelper.getSupersededTemplate(); NodeRef supersededTemplate = notificationHelper.getSupersededTemplate();
updateTemplate(supersededTemplate, PATH_SUPERSEDED); updateTemplate(supersededTemplate, PATH_SUPERSEDED);

View File

@@ -106,7 +106,7 @@ public class RMv2FilePlanNodeRefPatch extends ModulePatchComponent
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
Pair<Long, QName> aspectPair = qnameDAO.getQName(RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT); Pair<Long, QName> aspectPair = qnameDAO.getQName(RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT);
if (aspectPair != null) if (aspectPair != null)

View File

@@ -66,7 +66,7 @@ public class RMv2ModelPatch extends ModulePatchComponent
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
updateQName(QName.createQName(DOD_URI, "filePlan"), TYPE_FILE_PLAN, "TYPE"); updateQName(QName.createQName(DOD_URI, "filePlan"), TYPE_FILE_PLAN, "TYPE");
updateQName(QName.createQName(DOD_URI, "recordCategory"), TYPE_RECORD_CATEGORY, "TYPE"); updateQName(QName.createQName(DOD_URI, "recordCategory"), TYPE_RECORD_CATEGORY, "TYPE");

View File

@@ -82,7 +82,7 @@ public class RMv2SavedSearchPatch extends ModulePatchComponent
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
if (siteService.getSite(RM_SITE_ID) != null) if (siteService.getSite(RM_SITE_ID) != null)
{ {

View File

@@ -82,7 +82,7 @@ public class NotificationTemplatePatch_v21 extends RMv21PatchComponent
} }
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, CONFIG_NODEID); NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, CONFIG_NODEID);
// get the parent node // get the parent node

View File

@@ -85,7 +85,7 @@ public class RMv21BehaviorScriptsPatch extends RMv21PatchComponent implements Be
* @see org.alfresco.module.org_alfresco_module_rm.patch.compatibility.ModulePatchComponent#executePatch() * @see org.alfresco.module.org_alfresco_module_rm.patch.compatibility.ModulePatchComponent#executePatch()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
// check that the rm config root has been correctly bootstrapped // check that the rm config root has been correctly bootstrapped
if (!nodeService.exists(RM_CONFIG)) if (!nodeService.exists(RM_CONFIG))

View File

@@ -123,7 +123,7 @@ public class RMv21CapabilityPatch extends RMv21PatchComponent
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
Set<NodeRef> filePlans = getFilePlans(); Set<NodeRef> filePlans = getFilePlans();

View File

@@ -134,7 +134,7 @@ public class RMv21InPlacePatch extends RMv21PatchComponent
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
Set<NodeRef> filePlans = filePlanService.getFilePlans(); Set<NodeRef> filePlans = filePlanService.getFilePlans();

View File

@@ -109,7 +109,7 @@ public class RMv21RMAdminUserPatch extends RMv21PatchComponent implements BeanNa
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
String user = filePlanAuthenticationService.getRmAdminUserName(); String user = filePlanAuthenticationService.getRmAdminUserName();
String firstName = I18NUtil.getMessage(MSG_FIRST_NAME); String firstName = I18NUtil.getMessage(MSG_FIRST_NAME);

View File

@@ -102,7 +102,7 @@ public class RMv21RecordInheritancePatch extends RMv21PatchComponent
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
Pair<Long, QName> aspectPair = qnameDAO.getQName(ASPECT_RECORD); Pair<Long, QName> aspectPair = qnameDAO.getQName(ASPECT_RECORD);
if (aspectPair != null) if (aspectPair != null)

View File

@@ -69,7 +69,7 @@ public class RMv21ReportServicePatch extends RMv21PatchComponent
} }
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
// check whether report dir exists or not // check whether report dir exists or not
if (nodeService.exists(RM_CONFIG_FOLDER) && !nodeService.exists(TEMPLATE_ROOT)) if (nodeService.exists(RM_CONFIG_FOLDER) && !nodeService.exists(TEMPLATE_ROOT))

View File

@@ -67,7 +67,7 @@ public class RMv21RolesPatch extends RMv21PatchComponent implements BeanNameAwar
* @see org.alfresco.module.org_alfresco_module_rm.patch.compatibility.ModulePatchComponent#executePatch() * @see org.alfresco.module.org_alfresco_module_rm.patch.compatibility.ModulePatchComponent#executePatch()
*/ */
@Override @Override
protected void executePatch() throws Throwable protected void executePatch()
{ {
Set<NodeRef> filePlans = filePlanService.getFilePlans(); Set<NodeRef> filePlans = filePlanService.getFilePlans();