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:
Tuna Aksoy
2014-06-22 14:56:44 +00:00
parent ac49d095b7
commit 44975523e5
11 changed files with 55 additions and 55 deletions

View File

@@ -36,7 +36,7 @@ import org.apache.commons.logging.LogFactory;
public abstract class ModulePatchComponent extends AbstractModuleComponent public abstract class ModulePatchComponent extends AbstractModuleComponent
{ {
/** logger */ /** logger */
protected static final Log logger = LogFactory.getLog(ModulePatchComponent.class); protected static final Log LOGGER = LogFactory.getLog(ModulePatchComponent.class);
/** Retrying transaction helper */ /** Retrying transaction helper */
protected RetryingTransactionHelper retryingTransactionHelper; protected RetryingTransactionHelper retryingTransactionHelper;
@@ -89,9 +89,9 @@ public abstract class ModulePatchComponent extends AbstractModuleComponent
{ {
try 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 // execute path within an isolated transaction
@@ -114,17 +114,17 @@ public abstract class ModulePatchComponent extends AbstractModuleComponent
}, false, true); }, false, true);
if (logger.isInfoEnabled()) if (LOGGER.isInfoEnabled())
{ {
logger.info(" ... completed module patch '" + getName() + "'"); LOGGER.info(" ... completed module patch '" + getName() + "'");
} }
} }
catch (Throwable exception) catch (Throwable exception)
{ {
// record the exception otherwise it gets swallowed // 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; throw exception;
} }

View File

@@ -145,9 +145,9 @@ public class NotificationTemplatePatch extends ModulePatchComponent
{ {
if (template == null || !nodeService.exists(template)) 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 else
@@ -156,9 +156,9 @@ public class NotificationTemplatePatch extends ModulePatchComponent
String lastPatchUpdate = (String)nodeService.getProperty(template, PROP_LAST_PATCH_UPDATE); String lastPatchUpdate = (String)nodeService.getProperty(template, PROP_LAST_PATCH_UPDATE);
if (lastPatchUpdate == null || !name.equals(lastPatchUpdate)) 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 // Make sure the template is versionable
@@ -192,9 +192,9 @@ public class NotificationTemplatePatch extends ModulePatchComponent
} }
else 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() + ")");
} }
} }
} }

View File

@@ -113,9 +113,9 @@ public class RMv2FilePlanNodeRefPatch extends ModulePatchComponent
{ {
List<Long> filePlanComponents = patchDAO.getNodesByAspectQNameId(aspectPair.getFirst(), 0L, patchDAO.getMaxAdmNodeID()); 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");
} }

View File

@@ -127,16 +127,16 @@ public class RMv2ModelPatch extends ModulePatchComponent
qnameDAO.updateQName(qnameBefore, qnameAfter); qnameDAO.updateQName(qnameBefore, qnameAfter);
if (logger.isDebugEnabled()) if (LOGGER.isDebugEnabled())
{ {
logger.debug(" ... updated qname " + qnameBefore.toString()); LOGGER.debug(" ... updated qname " + qnameBefore.toString());
} }
} }
else 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());
} }
} }

View File

@@ -89,9 +89,9 @@ public class RMv2SavedSearchPatch extends ModulePatchComponent
// get the saved searches // get the saved searches
List<SavedSearchDetails> savedSearches = recordsManagementSearchService.getSavedSearches(RM_SITE_ID); 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) for (SavedSearchDetails savedSearchDetails : savedSearches)
@@ -106,9 +106,9 @@ public class RMv2SavedSearchPatch extends ModulePatchComponent
writer.putContent(refreshedJSON); 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() + ")");
} }
} }
} }

View File

@@ -97,9 +97,9 @@ public class RMv21BehaviorScriptsPatch extends RMv21PatchComponent implements Be
// check that the behavior scripts folder exists // check that the behavior scripts folder exists
if (!nodeService.exists(newBehaviorScriptsFolder)) 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"; String newBehaviorScriptsFolderName = "Records Management Behavior Scripts";
@@ -137,9 +137,9 @@ public class RMv21BehaviorScriptsPatch extends RMv21PatchComponent implements Be
if (oldBehaviorScripts != null && !oldBehaviorScripts.isEmpty()) 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) for (FileInfo script : oldBehaviorScripts)
@@ -147,9 +147,9 @@ public class RMv21BehaviorScriptsPatch extends RMv21PatchComponent implements Be
// move the old script to the new location // move the old script to the new location
fileFolderService.moveFrom(script.getNodeRef(), OLD_BEHAVIOR_SCRIPTS_FOLDER, RMv21BehaviorScriptsPatch.newBehaviorScriptsFolder, script.getName()); 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());
} }
} }

View File

@@ -107,9 +107,9 @@ public class RMv21CapabilityPatch extends RMv21PatchComponent
// only update if the capability is missing // only update if the capability is missing
if (!capabilities.contains(capability)) 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); capabilities.add(capability);
@@ -127,16 +127,16 @@ public class RMv21CapabilityPatch extends RMv21PatchComponent
{ {
Set<NodeRef> filePlans = getFilePlans(); 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) 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 // add new capabilities

View File

@@ -138,18 +138,18 @@ public class RMv21InPlacePatch extends RMv21PatchComponent
{ {
Set<NodeRef> filePlans = filePlanService.getFilePlans(); 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) for (NodeRef filePlan : filePlans)
{ {
if (filePlanService.getUnfiledContainer(filePlan) == null) 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(); ruleService.disableRules();
@@ -194,9 +194,9 @@ public class RMv21InPlacePatch extends RMv21PatchComponent
private void moveExistingHolds(NodeRef filePlan) 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); NodeRef container = filePlanService.getHoldContainer(filePlan);
@@ -212,9 +212,9 @@ public class RMv21InPlacePatch extends RMv21PatchComponent
private void moveExistingTransfers(NodeRef filePlan) 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); NodeRef container = filePlanService.getTransferContainer(filePlan);

View File

@@ -109,9 +109,9 @@ public class RMv21RecordInheritancePatch extends RMv21PatchComponent
{ {
List<Long> records = patchDAO.getNodesByAspectQNameId(aspectPair.getFirst(), 0L, patchDAO.getMaxAdmNodeID()); 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) for (Long record : records)
@@ -119,9 +119,9 @@ public class RMv21RecordInheritancePatch extends RMv21PatchComponent
Pair<Long, NodeRef> recordPair = nodeDAO.getNodePair(record); Pair<Long, NodeRef> recordPair = nodeDAO.getNodePair(record);
NodeRef recordNodeRef = recordPair.getSecond(); 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 // get the primary parent
ChildAssociationRef assoc = nodeService.getPrimaryParent(recordNodeRef); ChildAssociationRef assoc = nodeService.getPrimaryParent(recordNodeRef);

View File

@@ -74,14 +74,14 @@ public class RMv21ReportServicePatch extends RMv21PatchComponent
// 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))
{ {
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 // create report templates

View File

@@ -71,9 +71,9 @@ public class RMv21RolesPatch extends RMv21PatchComponent implements BeanNameAwar
{ {
Set<NodeRef> filePlans = filePlanService.getFilePlans(); 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) for (NodeRef filePlan : filePlans)
@@ -85,9 +85,9 @@ public class RMv21RolesPatch extends RMv21PatchComponent implements BeanNameAwar
String roleGroupName = role.getRoleGroupName(); String roleGroupName = role.getRoleGroupName();
if (!authorityService.getAuthorityZones(roleGroupName).contains(RMAuthority.ZONE_APP_RM)) 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); addAuthorityToZone(roleGroupName);