Fixed minor issues ("Trailing Comment") reported in Sonar

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@71947 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-05-27 21:02:42 +00:00
parent df13731bad
commit a5c415e3b3
9 changed files with 53 additions and 29 deletions

View File

@@ -1239,7 +1239,8 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_LABEL_IN_USE, label)); throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_LABEL_IN_USE, label));
} }
NodeRef modelRef = getCustomModelRef(""); // defaults to RM_CUSTOM_URI // defaults to RM_CUSTOM_URI
NodeRef modelRef = getCustomModelRef("");
M2Model deserializedModel = readCustomContentModel(modelRef); M2Model deserializedModel = readCustomContentModel(modelRef);
String aspectName = RecordsManagementAdminServiceImpl.RMC_CUSTOM_ASSOCS; String aspectName = RecordsManagementAdminServiceImpl.RMC_CUSTOM_ASSOCS;
@@ -1309,7 +1310,8 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
//throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_LABEL_IN_USE, compoundID)); //throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_LABEL_IN_USE, compoundID));
} }
NodeRef modelRef = getCustomModelRef(""); // defaults to RM_CUSTOM_URI // defaults to RM_CUSTOM_URI
NodeRef modelRef = getCustomModelRef("");
M2Model deserializedModel = readCustomContentModel(modelRef); M2Model deserializedModel = readCustomContentModel(modelRef);
String aspectName = RecordsManagementAdminServiceImpl.RMC_CUSTOM_ASSOCS; String aspectName = RecordsManagementAdminServiceImpl.RMC_CUSTOM_ASSOCS;
@@ -1390,7 +1392,8 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CONNOT_FIND_ASSOC_DEF, refQName)); throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CONNOT_FIND_ASSOC_DEF, refQName));
} }
NodeRef modelRef = getCustomModelRef(""); // defaults to RM_CUSTOM_URI // defaults to RM_CUSTOM_URI
NodeRef modelRef = getCustomModelRef("");
M2Model deserializedModel = readCustomContentModel(modelRef); M2Model deserializedModel = readCustomContentModel(modelRef);
M2Aspect customAssocsAspect = deserializedModel.getAspect(RMC_CUSTOM_ASSOCS); M2Aspect customAssocsAspect = deserializedModel.getAspect(RMC_CUSTOM_ASSOCS);

View File

@@ -870,7 +870,8 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
if (values.containsKey(RM_AUDIT_DATA_LOGIN_ERROR)) if (values.containsKey(RM_AUDIT_DATA_LOGIN_ERROR))
{ {
eventName = RM_AUDIT_EVENT_LOGIN_FAILURE; eventName = RM_AUDIT_EVENT_LOGIN_FAILURE;
fullName = user; // The user didn't log in // The user didn't log in
fullName = user;
} }
else else
{ {
@@ -884,7 +885,8 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
if (values.containsKey(DOD5015_AUDIT_DATA_LOGIN_ERROR)) if (values.containsKey(DOD5015_AUDIT_DATA_LOGIN_ERROR))
{ {
eventName = RM_AUDIT_EVENT_LOGIN_FAILURE; eventName = RM_AUDIT_EVENT_LOGIN_FAILURE;
fullName = user; // The user didn't log in // The user didn't log in
fullName = user;
} }
else else
{ {
@@ -908,7 +910,8 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
timestamp, timestamp,
user, user,
fullName, fullName,
userRoles, // A concatenated string of roles // A concatenated string of roles
userRoles,
nodeRef, nodeRef,
nodeName, nodeName,
nodeType, nodeType,
@@ -979,7 +982,8 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
Long toTime = getToDateTime(params.getDateTo()); Long toTime = getToDateTime(params.getDateTo());
NodeRef nodeRef = params.getNodeRef(); NodeRef nodeRef = params.getNodeRef();
int maxEntries = params.getMaxEntries(); int maxEntries = params.getMaxEntries();
boolean forward = maxEntries > 0 ? false : true; // Reverse order if the results are limited // Reverse order if the results are limited
boolean forward = maxEntries > 0 ? false : true;
// start the audit trail report // start the audit trail report
writeAuditTrailHeader(writer, params, reportFormat); writeAuditTrailHeader(writer, params, reportFormat);

View File

@@ -739,9 +739,11 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
logger.debug("\t" + cad.typeString + " test on " + testNodeRef + " from " + nextObject.getClass().getName()); logger.debug("\t" + cad.typeString + " test on " + testNodeRef + " from " + nextObject.getClass().getName());
} }
if (isUnfiltered(testNodeRef)) // Null allows // Null allows
if (isUnfiltered(testNodeRef))
{ {
continue; // Continue to next ConfigAttributeDefintion // Continue to next ConfigAttributeDefintion
continue;
} }
if (allowed && if (allowed &&
@@ -749,7 +751,8 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
checkRead(testNodeRef) != AccessDecisionVoter.ACCESS_GRANTED) checkRead(testNodeRef) != AccessDecisionVoter.ACCESS_GRANTED)
{ {
allowed = false; allowed = false;
break; // No point evaluating more ConfigAttributeDefintions // No point evaluating more ConfigAttributeDefintions
break;
} }
} }
} }

View File

@@ -57,7 +57,8 @@ public class RMSecurityCommon implements ApplicationContextAware
private static Log logger = LogFactory.getLog(RMSecurityCommon.class); private static Log logger = LogFactory.getLog(RMSecurityCommon.class);
/** Services */ /** Services */
protected NodeService nodeService; //This is the internal NodeService -- no permission checks //This is the internal NodeService -- no permission checks
protected NodeService nodeService;
protected PermissionService permissionService; protected PermissionService permissionService;
protected RMCaveatConfigComponent caveatConfigComponent; protected RMCaveatConfigComponent caveatConfigComponent;
private FilePlanService filePlanService; private FilePlanService filePlanService;

View File

@@ -50,12 +50,15 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
private static final String LOV_CONSTRAINT_VALUE = "listconstraint"; private static final String LOV_CONSTRAINT_VALUE = "listconstraint";
private List<String> allowedValues; private List<String> allowedValues;
private List<String> allowedValuesUpper; private List<String> allowedValuesUpper;
private MatchLogic matchLogic = MatchLogic.AND; // defined match logic used by caveat matching (default = "AND") // defined match logic used by caveat matching (default = "AND")
private MatchLogic matchLogic = MatchLogic.AND;
public enum MatchLogic public enum MatchLogic
{ {
AND, // closed marking - all values must match // closed marking - all values must match
OR; // open marking - at least one value must match AND,
// open marking - at least one value must match
OR;
} }
// note: alternative to static init could be to use 'registered' constraint // note: alternative to static init could be to use 'registered' constraint
@@ -140,7 +143,8 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
String runAsUser = AuthenticationUtil.getRunAsUser(); String runAsUser = AuthenticationUtil.getRunAsUser();
if ((runAsUser != null) && (! runAsUser.equals(AuthenticationUtil.getSystemUserName())) && (caveatConfigService != null)) if ((runAsUser != null) && (! runAsUser.equals(AuthenticationUtil.getSystemUserName())) && (caveatConfigService != null))
{ {
List<String> allowedForUser = caveatConfigService.getRMAllowedValues(getType()); // get allowed values for current user // get allowed values for current user
List<String> allowedForUser = caveatConfigService.getRMAllowedValues(getType());
List<String> filteredList = new ArrayList<String>(allowedForUser.size()); List<String> filteredList = new ArrayList<String>(allowedForUser.size());
for (String allowed : allowedForUser) for (String allowed : allowedForUser)

View File

@@ -132,7 +132,8 @@ public class NotifyOfRecordsDueForReviewJobExecuter extends RecordsManagementJob
/** /**
* Now do the work, one action in each transaction * Now do the work, one action in each transaction
*/ */
retryingTransactionHelper.setMaxRetries(0); // don't retry the send email // don't retry the send email
retryingTransactionHelper.setMaxRetries(0);
retryingTransactionHelper.doInTransaction(txCallbackSendEmail); retryingTransactionHelper.doInTransaction(txCallbackSendEmail);
retryingTransactionHelper.setMaxRetries(10); retryingTransactionHelper.setMaxRetries(10);
retryingTransactionHelper.doInTransaction(txUpdateNodesCallback); retryingTransactionHelper.doInTransaction(txUpdateNodesCallback);

View File

@@ -173,9 +173,11 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
// Records management root aspect // Records management root aspect
QName ASPECT_RECORDS_MANAGEMENT_ROOT = QName.createQName(RM_URI, "recordsManagementRoot"); QName ASPECT_RECORDS_MANAGEMENT_ROOT = QName.createQName(RM_URI, "recordsManagementRoot");
@Deprecated // since 2.1 // since 2.1
@Deprecated
QName ASSOC_HOLDS = QName.createQName(RM_URI, "holds"); QName ASSOC_HOLDS = QName.createQName(RM_URI, "holds");
@Deprecated // since 2.1 // since 2.1
@Deprecated
QName ASSOC_TRANSFERS = QName.createQName(RM_URI, "transfers"); QName ASSOC_TRANSFERS = QName.createQName(RM_URI, "transfers");
// Hold type // Hold type

View File

@@ -36,7 +36,8 @@ import org.springframework.extensions.surf.util.I18NUtil;
*/ */
@BehaviourBean @BehaviourBean
( (
defaultType = "rma:ghosted" // optional // optional
defaultType = "rma:ghosted"
) )
public class GhostedAspect extends BaseBehaviourBean public class GhostedAspect extends BaseBehaviourBean
implements ContentServicePolicies.OnContentUpdatePolicy implements ContentServicePolicies.OnContentUpdatePolicy
@@ -52,10 +53,14 @@ public class GhostedAspect extends BaseBehaviourBean
@Override @Override
@Behaviour @Behaviour
( (
kind = BehaviourKind.CLASS, // required, use ASSOC for association behaviors // required, use ASSOC for association behaviors
notificationFrequency = NotificationFrequency.EVERY_EVENT, // (defaults to EVERY_EVENT) kind = BehaviourKind.CLASS,
policy = "alf:onContentUpdate", // (defaults to alf:<methodname>) // (defaults to EVERY_EVENT)
type = "rma:ghosted" // required, unless defaultType set notificationFrequency = NotificationFrequency.EVERY_EVENT,
// (defaults to alf:<methodname>)
policy = "alf:onContentUpdate",
// required, unless defaultType set
type = "rma:ghosted"
// isService (default false) // isService (default false)
// name (only needs to specified if associated behvaiour object needs to be accessed) // name (only needs to specified if associated behvaiour object needs to be accessed)

View File

@@ -203,7 +203,8 @@ public class ImportPost extends DeclarativeWebScript
// copy contents of uploaded file to temp ACP file // copy contents of uploaded file to temp ACP file
FileOutputStream fos = new FileOutputStream(acpFile); FileOutputStream fos = new FileOutputStream(acpFile);
FileCopyUtils.copy(acpContent.getInputStream(), fos); // NOTE: this method closes both streams // NOTE: this method closes both streams
FileCopyUtils.copy(acpContent.getInputStream(), fos);
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {