Fixed minor bugs (Constant Name) reported in Sonar

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@73862 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-06-15 12:26:37 +00:00
parent 20f6fee1db
commit 112973072a
11 changed files with 47 additions and 47 deletions

View File

@@ -43,7 +43,7 @@ import org.apache.commons.logging.LogFactory;
public class DeclarativeCapability extends AbstractCapability
{
/** Logger */
protected static final Log logger = LogFactory.getLog(DeclarativeCapability.class);
protected static final Log LOGGER = LogFactory.getLog(DeclarativeCapability.class);
/** Required permissions */
protected List<String> permissions;
@@ -220,9 +220,9 @@ public class DeclarativeCapability extends AbstractCapability
{
result = false;
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug("FAIL: Condition " + condition.getName() + " failed for capability " + getName() + " on nodeRef " + nodeRef.toString());
LOGGER.debug("FAIL: Condition " + condition.getName() + " failed for capability " + getName() + " on nodeRef " + nodeRef.toString());
}
break;
@@ -308,9 +308,9 @@ public class DeclarativeCapability extends AbstractCapability
result = onEvaluate(nodeRef, result);
// log access denied to help with debug
if (logger.isDebugEnabled() && AccessDecisionVoter.ACCESS_DENIED == result)
if (LOGGER.isDebugEnabled() && AccessDecisionVoter.ACCESS_DENIED == result)
{
logger.debug("FAIL: Capability " + getName() + " returned an Access Denied result during evaluation of node " + nodeRef.toString());
LOGGER.debug("FAIL: Capability " + getName() + " returned an Access Denied result during evaluation of node " + nodeRef.toString());
}
return result;

View File

@@ -65,9 +65,9 @@ public class DeclarativeCompositeCapability extends DeclarativeCapability
// Check each capability using 'OR' logic
for (Capability capability : capabilities)
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug("Evaluating child capability " + capability.getName() + " on nodeRef " + nodeRef.toString() + " for composite capability " + name);
LOGGER.debug("Evaluating child capability " + capability.getName() + " on nodeRef " + nodeRef.toString() + " for composite capability " + name);
}
int capabilityResult = capability.evaluate(nodeRef);
@@ -82,9 +82,9 @@ public class DeclarativeCompositeCapability extends DeclarativeCapability
}
else
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug("Access denied for child capability " + capability.getName() + " on nodeRef " + nodeRef.toString() + " for composite capability " + name);
LOGGER.debug("Access denied for child capability " + capability.getName() + " on nodeRef " + nodeRef.toString() + " for composite capability " + name);
}
}
}

View File

@@ -41,9 +41,9 @@ public final class ViewRecordsCapability extends DeclarativeCapability
}
else
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug("View Records capability abstains, because node is not a file plan component. (nodeRef=" + nodeRef.toString() + ")");
LOGGER.debug("View Records capability abstains, because node is not a file plan component. (nodeRef=" + nodeRef.toString() + ")");
}
}
}

View File

@@ -24,7 +24,7 @@ public abstract class BaseBehaviourBean extends ServiceBaseImpl
BehaviourRegistry
{
/** Logger */
protected static final Log logger = LogFactory.getLog(BaseBehaviourBean.class);
protected static final Log LOGGER = LogFactory.getLog(BaseBehaviourBean.class);
/** behaviour filter */
protected BehaviourFilter behaviourFilter;

View File

@@ -156,9 +156,9 @@ public class RecordCategoryType extends BaseBehaviourBean
)
public void onCreateNode(final ChildAssociationRef childAssocRef)
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug("rma:recordCategory|alf:onCreateNode|this.onCreateNode()|TRANSATION_COMMIT");
LOGGER.debug("rma:recordCategory|alf:onCreateNode|this.onCreateNode()|TRANSATION_COMMIT");
}
// execute behaviour code as system user

View File

@@ -33,7 +33,7 @@ import org.springframework.beans.factory.BeanNameAware;
public abstract class AbstractModulePatch implements ModulePatch, BeanNameAware
{
/** logger */
protected static final Log logger = LogFactory.getLog(ModulePatch.class);
protected static final Log LOGGER = LogFactory.getLog(ModulePatch.class);
/** module patch service */
private ModulePatchExecuter modulePatchExecuter;
@@ -194,13 +194,13 @@ public abstract class AbstractModulePatch implements ModulePatch, BeanNameAware
@Override
public void apply()
{
if (logger.isInfoEnabled())
if (LOGGER.isInfoEnabled())
{
logger.info("Executing module patch \"" + description + "\"");
LOGGER.info("Executing module patch \"" + description + "\"");
}
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug(" ... id=" + id +
LOGGER.debug(" ... id=" + id +
",moduleId=" + moduleId +
",from=" + fixesFromSchema +
",to=" + fixesToSchema +
@@ -212,9 +212,9 @@ public abstract class AbstractModulePatch implements ModulePatch, BeanNameAware
true,
false);
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug(" ... module patch applied");
LOGGER.debug(" ... module patch applied");
}
}

View File

@@ -40,7 +40,7 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent
implements ModulePatchExecuter
{
/** logger */
protected static final Log logger = LogFactory.getLog(ModulePatchExecuterImpl.class);
protected static final Log LOGGER = LogFactory.getLog(ModulePatchExecuterImpl.class);
/** default start schema */
private static final int START_SCHEMA = 0;
@@ -85,9 +85,9 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent
throw new AlfrescoRuntimeException("Unable to register module patch, becuase module id is invalid.");
}
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug("Registering module patch " + modulePatch.getId() + " for module " + getModuleId());
LOGGER.debug("Registering module patch " + modulePatch.getId() + " for module " + getModuleId());
}
modulePatches.put(modulePatch.getId(), modulePatch);
@@ -102,9 +102,9 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent
// get current schema version
int currentSchema = getCurrentSchema();
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug("Running module patch executer (currentSchema=" + currentSchema + ", configuredSchema=" + moduleSchema + ")");
LOGGER.debug("Running module patch executer (currentSchema=" + currentSchema + ", configuredSchema=" + moduleSchema + ")");
}
if (moduleSchema > currentSchema)

View File

@@ -107,9 +107,9 @@ public abstract class CapabilityPatch extends AbstractModulePatch
// 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 abstract class CapabilityPatch extends AbstractModulePatch
{
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());
}
// apply the capability patch to each file plan

View File

@@ -105,9 +105,9 @@ public class RMv22DODModelSeparationModulePatch extends AbstractModulePatch
}
long recordCount = patchDAO.getCountNodesWithAspects(Collections.singleton(ASPECT_RECORD));
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug(" ... updating " + recordCount + " records");
LOGGER.debug(" ... updating " + recordCount + " records");
}
// apply the DOD record aspect to all exiting records
@@ -124,9 +124,9 @@ public class RMv22DODModelSeparationModulePatch extends AbstractModulePatch
}
completed += completed + nodeIds.size();
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
logger.debug(" ... completed " + completed + " of " + recordCount);
LOGGER.debug(" ... completed " + completed + " of " + recordCount);
}
}
}

View File

@@ -68,7 +68,7 @@ public class FilePlanPermissionServiceImpl extends ServiceBaseImpl
protected PolicyComponent policyComponent;
/** Logger */
protected static final Log logger = LogFactory.getLog(FilePlanPermissionServiceImpl.class);
protected static final Log LOGGER = LogFactory.getLog(FilePlanPermissionServiceImpl.class);
/**
* Initialisation method
@@ -432,9 +432,9 @@ public class FilePlanPermissionServiceImpl extends ServiceBaseImpl
}
else
{
if (logger.isWarnEnabled())
if (LOGGER.isWarnEnabled())
{
logger.warn("Setting permissions for this node is not supported. (nodeRef=" + nodeRef + ", authority=" + authority + ", permission=" + permission + ")");
LOGGER.warn("Setting permissions for this node is not supported. (nodeRef=" + nodeRef + ", authority=" + authority + ", permission=" + permission + ")");
}
}

View File

@@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory;
public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
{
/** logger */
protected static final Log logger = LogFactory.getLog(RMMethodSecurityInterceptor.class);
protected static final Log LOGGER = LogFactory.getLog(RMMethodSecurityInterceptor.class);
/**
* Helper class to hold capability report information
@@ -121,7 +121,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
*/
public static void isRMSecurityChecked(boolean newValue)
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
RMMethodSecurityInterceptor.IS_RM_SECURITY_CHECK.set(newValue);
}
@@ -134,7 +134,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
*/
public static void addMessage(String message)
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
List<String> messages = RMMethodSecurityInterceptor.MESSAGES.get();
messages.add(message);
@@ -143,7 +143,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
public static void addMessage(String message, Object ... params)
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
addMessage(MessageFormat.format(message, params));
}
@@ -157,7 +157,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
*/
public static void reportCapabilityStatus(String name, int status)
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
CapabilityReport capability = getCapabilityReport(name);
capability.status = translate(status);
@@ -174,7 +174,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
*/
public static void reportCapabilityCondition(String name, String conditionName, boolean expected, boolean actual)
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
CapabilityReport capability = getCapabilityReport(name);
if (!expected)
@@ -194,7 +194,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
{
String result = null;
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
Collection<CapabilityReport> capabilities = RMMethodSecurityInterceptor.CAPABILITIES.get().values();
@@ -248,7 +248,7 @@ public class RMMethodSecurityInterceptor extends MethodSecurityInterceptor
}
catch (AccessDeniedException exception)
{
if (logger.isDebugEnabled())
if (LOGGER.isDebugEnabled())
{
MethodInvocation mi = (MethodInvocation)object;