mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fixed minor bugs (Constant Name) reported in Sonar
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@74409 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -36,7 +36,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
public abstract class ModulePatchComponent extends AbstractModuleComponent
|
||||
{
|
||||
/** logger */
|
||||
protected static final Log logger = LogFactory.getLog(ModulePatchComponent.class);
|
||||
protected static final Log LOGGER = LogFactory.getLog(ModulePatchComponent.class);
|
||||
|
||||
/** Retrying transaction helper */
|
||||
protected RetryingTransactionHelper retryingTransactionHelper;
|
||||
@@ -89,9 +89,9 @@ public abstract class ModulePatchComponent extends AbstractModuleComponent
|
||||
{
|
||||
try
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
if (LOGGER.isInfoEnabled())
|
||||
{
|
||||
logger.info("Module patch component '" + getName() + "' is executing ...");
|
||||
LOGGER.info("Module patch component '" + getName() + "' is executing ...");
|
||||
}
|
||||
|
||||
// execute path within an isolated transaction
|
||||
@@ -114,17 +114,17 @@ public abstract class ModulePatchComponent extends AbstractModuleComponent
|
||||
|
||||
}, false, true);
|
||||
|
||||
if (logger.isInfoEnabled())
|
||||
if (LOGGER.isInfoEnabled())
|
||||
{
|
||||
logger.info(" ... completed module patch '" + getName() + "'");
|
||||
LOGGER.info(" ... completed module patch '" + getName() + "'");
|
||||
}
|
||||
}
|
||||
catch (Throwable exception)
|
||||
{
|
||||
// record the exception otherwise it gets swallowed
|
||||
if (logger.isInfoEnabled())
|
||||
if (LOGGER.isInfoEnabled())
|
||||
{
|
||||
logger.info(" ... error encountered. " + exception.getMessage(), exception);
|
||||
LOGGER.info(" ... error encountered. " + exception.getMessage(), exception);
|
||||
}
|
||||
throw exception;
|
||||
}
|
||||
|
@@ -145,9 +145,9 @@ public class NotificationTemplatePatch extends ModulePatchComponent
|
||||
{
|
||||
if (template == null || !nodeService.exists(template))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Skipping template update, because template has not been bootstraped.");
|
||||
LOGGER.debug("Skipping template update, because template has not been bootstraped.");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -156,9 +156,9 @@ public class NotificationTemplatePatch extends ModulePatchComponent
|
||||
String lastPatchUpdate = (String)nodeService.getProperty(template, PROP_LAST_PATCH_UPDATE);
|
||||
if (lastPatchUpdate == null || !name.equals(lastPatchUpdate))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Applying update to template. (template=" + template.toString() + ", templateUpdate=" + templateUpdate + ")");
|
||||
LOGGER.debug("Applying update to template. (template=" + template.toString() + ", templateUpdate=" + templateUpdate + ")");
|
||||
}
|
||||
|
||||
// Make sure the template is versionable
|
||||
@@ -192,9 +192,9 @@ public class NotificationTemplatePatch extends ModulePatchComponent
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Skipping template update, because template has already been patched. (template=" + template.toString() + ")");
|
||||
LOGGER.debug("Skipping template update, because template has already been patched. (template=" + template.toString() + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -113,9 +113,9 @@ public class RMv2FilePlanNodeRefPatch extends ModulePatchComponent
|
||||
{
|
||||
List<Long> filePlanComponents = patchDAO.getNodesByAspectQNameId(aspectPair.getFirst(), 0L, patchDAO.getMaxAdmNodeID());
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating " + filePlanComponents.size() + " items");
|
||||
LOGGER.debug(" ... updating " + filePlanComponents.size() + " items");
|
||||
}
|
||||
|
||||
|
||||
|
@@ -127,16 +127,16 @@ public class RMv2ModelPatch extends ModulePatchComponent
|
||||
|
||||
qnameDAO.updateQName(qnameBefore, qnameAfter);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updated qname " + qnameBefore.toString());
|
||||
LOGGER.debug(" ... updated qname " + qnameBefore.toString());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... no need to update qname " + qnameBefore.toString());
|
||||
LOGGER.debug(" ... no need to update qname " + qnameBefore.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -89,9 +89,9 @@ public class RMv2SavedSearchPatch extends ModulePatchComponent
|
||||
// get the saved searches
|
||||
List<SavedSearchDetails> savedSearches = recordsManagementSearchService.getSavedSearches(RM_SITE_ID);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating " + savedSearches.size() + " saved searches");
|
||||
LOGGER.debug(" ... updating " + savedSearches.size() + " saved searches");
|
||||
}
|
||||
|
||||
for (SavedSearchDetails savedSearchDetails : savedSearches)
|
||||
@@ -106,9 +106,9 @@ public class RMv2SavedSearchPatch extends ModulePatchComponent
|
||||
writer.putContent(refreshedJSON);
|
||||
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updated saved search " + savedSearchDetails.getName() + " (nodeRef=" + nodeRef.toString() + ")");
|
||||
LOGGER.debug(" ... updated saved search " + savedSearchDetails.getName() + " (nodeRef=" + nodeRef.toString() + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -97,9 +97,9 @@ public class RMv21BehaviorScriptsPatch extends RMv21PatchComponent implements Be
|
||||
// check that the behavior scripts folder exists
|
||||
if (!nodeService.exists(newBehaviorScriptsFolder))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... creating RM Behavior Scripts folder");
|
||||
LOGGER.debug(" ... creating RM Behavior Scripts folder");
|
||||
}
|
||||
|
||||
String newBehaviorScriptsFolderName = "Records Management Behavior Scripts";
|
||||
@@ -137,9 +137,9 @@ public class RMv21BehaviorScriptsPatch extends RMv21PatchComponent implements Be
|
||||
|
||||
if (oldBehaviorScripts != null && !oldBehaviorScripts.isEmpty())
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... moving files from RM Scripts folder to RM Behavior Scripts folder");
|
||||
LOGGER.debug(" ... moving files from RM Scripts folder to RM Behavior Scripts folder");
|
||||
}
|
||||
|
||||
for (FileInfo script : oldBehaviorScripts)
|
||||
@@ -147,9 +147,9 @@ public class RMv21BehaviorScriptsPatch extends RMv21PatchComponent implements Be
|
||||
// move the old script to the new location
|
||||
fileFolderService.moveFrom(script.getNodeRef(), OLD_BEHAVIOR_SCRIPTS_FOLDER, RMv21BehaviorScriptsPatch.newBehaviorScriptsFolder, script.getName());
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ...... moved " + script.getName());
|
||||
LOGGER.debug(" ...... moved " + script.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -107,9 +107,9 @@ public class RMv21CapabilityPatch extends RMv21PatchComponent
|
||||
// only update if the capability is missing
|
||||
if (!capabilities.contains(capability))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... adding capability " + capabilityName + " to role " + role.getName());
|
||||
LOGGER.debug(" ... adding capability " + capabilityName + " to role " + role.getName());
|
||||
}
|
||||
|
||||
capabilities.add(capability);
|
||||
@@ -127,16 +127,16 @@ public class RMv21CapabilityPatch extends RMv21PatchComponent
|
||||
{
|
||||
Set<NodeRef> filePlans = getFilePlans();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating " + filePlans.size() + " file plans");
|
||||
LOGGER.debug(" ... updating " + filePlans.size() + " file plans");
|
||||
}
|
||||
|
||||
for (NodeRef filePlan : filePlans)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating file plan " + filePlan.toString());
|
||||
LOGGER.debug(" ... updating file plan " + filePlan.toString());
|
||||
}
|
||||
|
||||
// add new capabilities
|
||||
|
@@ -138,18 +138,18 @@ public class RMv21InPlacePatch extends RMv21PatchComponent
|
||||
{
|
||||
Set<NodeRef> filePlans = filePlanService.getFilePlans();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating " + filePlans.size() + " file plans");
|
||||
LOGGER.debug(" ... updating " + filePlans.size() + " file plans");
|
||||
}
|
||||
|
||||
for (NodeRef filePlan : filePlans)
|
||||
{
|
||||
if (filePlanService.getUnfiledContainer(filePlan) == null)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating file plan " + filePlan.toString());
|
||||
LOGGER.debug(" ... updating file plan " + filePlan.toString());
|
||||
}
|
||||
|
||||
ruleService.disableRules();
|
||||
@@ -194,9 +194,9 @@ public class RMv21InPlacePatch extends RMv21PatchComponent
|
||||
|
||||
private void moveExistingHolds(NodeRef filePlan)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... moving existing holds for file plan " + filePlan.toString());
|
||||
LOGGER.debug(" ... moving existing holds for file plan " + filePlan.toString());
|
||||
}
|
||||
|
||||
NodeRef container = filePlanService.getHoldContainer(filePlan);
|
||||
@@ -212,9 +212,9 @@ public class RMv21InPlacePatch extends RMv21PatchComponent
|
||||
|
||||
private void moveExistingTransfers(NodeRef filePlan)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... moving existing transfers for file plan " + filePlan.toString());
|
||||
LOGGER.debug(" ... moving existing transfers for file plan " + filePlan.toString());
|
||||
}
|
||||
|
||||
NodeRef container = filePlanService.getTransferContainer(filePlan);
|
||||
|
@@ -109,9 +109,9 @@ public class RMv21RecordInheritancePatch extends RMv21PatchComponent
|
||||
{
|
||||
List<Long> records = patchDAO.getNodesByAspectQNameId(aspectPair.getFirst(), 0L, patchDAO.getMaxAdmNodeID());
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating " + records.size() + " records");
|
||||
LOGGER.debug(" ... updating " + records.size() + " records");
|
||||
}
|
||||
|
||||
for (Long record : records)
|
||||
@@ -119,9 +119,9 @@ public class RMv21RecordInheritancePatch extends RMv21PatchComponent
|
||||
Pair<Long, NodeRef> recordPair = nodeDAO.getNodePair(record);
|
||||
NodeRef recordNodeRef = recordPair.getSecond();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating record " + recordNodeRef.toString());
|
||||
LOGGER.debug(" ... updating record " + recordNodeRef.toString());
|
||||
|
||||
// get the primary parent
|
||||
ChildAssociationRef assoc = nodeService.getPrimaryParent(recordNodeRef);
|
||||
|
@@ -74,14 +74,14 @@ public class RMv21ReportServicePatch extends RMv21PatchComponent
|
||||
// check whether report dir exists or not
|
||||
if (nodeService.exists(RM_CONFIG_FOLDER) && !nodeService.exists(TEMPLATE_ROOT))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... adding template root folder");
|
||||
LOGGER.debug(" ... adding template root folder");
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... adding destruction report template");
|
||||
LOGGER.debug(" ... adding destruction report template");
|
||||
}
|
||||
|
||||
// create report templates
|
||||
|
@@ -71,9 +71,9 @@ public class RMv21RolesPatch extends RMv21PatchComponent implements BeanNameAwar
|
||||
{
|
||||
Set<NodeRef> filePlans = filePlanService.getFilePlans();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating " + filePlans.size() + " file plans");
|
||||
LOGGER.debug(" ... updating " + filePlans.size() + " file plans");
|
||||
}
|
||||
|
||||
for (NodeRef filePlan : filePlans)
|
||||
@@ -85,9 +85,9 @@ public class RMv21RolesPatch extends RMv21PatchComponent implements BeanNameAwar
|
||||
String roleGroupName = role.getRoleGroupName();
|
||||
if (!authorityService.getAuthorityZones(roleGroupName).contains(RMAuthority.ZONE_APP_RM))
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... updating " + roleGroupName + " in file plan " + filePlan.toString());
|
||||
LOGGER.debug(" ... updating " + roleGroupName + " in file plan " + filePlan.toString());
|
||||
}
|
||||
|
||||
addAuthorityToZone(roleGroupName);
|
||||
|
Reference in New Issue
Block a user