Merge remote-tracking branch 'remotes/origin/release/V3.0' into merge-3.1/RM-6892_SonarFixes

This commit is contained in:
cagache
2019-07-04 09:47:50 +03:00
270 changed files with 728 additions and 744 deletions

View File

@@ -248,7 +248,7 @@ public class RecordsManagementServiceImpl extends ServiceBaseImpl
@Override
public List<NodeRef> getFilePlans()
{
return new ArrayList<NodeRef>(getFilePlanService().getFilePlans());
return new ArrayList<>(getFilePlanService().getFilePlans());
}
/**

View File

@@ -42,7 +42,7 @@ import java.util.Map;
static Map<String, List<String>> getPivot(Map<String, List<String>> source)
{
Map<String, List<String>> pivot = new HashMap<String, List<String>>();
Map<String, List<String>> pivot = new HashMap<>();
for (Map.Entry<String, List<String>> entry : source.entrySet())
{
@@ -59,7 +59,7 @@ import java.util.Map;
else
{
// New value
List<String> list = new ArrayList<String>();
List<String> list = new ArrayList<>();
list.add(authority);
pivot.put(value, list);
}

View File

@@ -106,11 +106,11 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
// Default
private StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
private List<String> caveatAspectURINames = new ArrayList<String>(0);
private List<QName> caveatAspectQNames = new ArrayList<QName>(0);
private List<String> caveatAspectURINames = new ArrayList<>(0);
private List<QName> caveatAspectQNames = new ArrayList<>(0);
private List<String> caveatModelURINames = new ArrayList<String>(0);
private List<QName> caveatModelQNames = new ArrayList<QName>(0);
private List<String> caveatModelURINames = new ArrayList<>(0);
private List<QName> caveatModelQNames = new ArrayList<>(0);
private static final String CAVEAT_CONFIG_NAME = "caveatConfig.json";
@@ -307,9 +307,9 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
logger.trace(caveatConfigData);
}
Set<QName> models = new HashSet<QName>(1);
Set<QName> props = new HashSet<QName>(10);
Set<String> expectedPrefixes = new HashSet<String>(10);
Set<QName> models = new HashSet<>(1);
Set<QName> props = new HashSet<>(10);
Set<String> expectedPrefixes = new HashSet<>(10);
if (caveatModelQNames.size() > 0)
{
@@ -553,7 +553,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
// Get allowed values for given caveat (for current user)
public List<String> getRMAllowedValues(String constraintName)
{
List<String> allowedValues = new ArrayList<String>(0);
List<String> allowedValues = new ArrayList<>(0);
String userName = AuthenticationUtil.getRunAsUser();
if (userName != null && !(AuthenticationUtil.isMtEnabled() && AuthenticationUtil.isRunAsUserTheSystemUser()))
@@ -570,7 +570,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
private List<String> getRMAllowedValues(String userName, Set<String> userGroupFullNames, String constraintName)
{
Set<String>allowedValues = new HashSet<String>();
Set<String>allowedValues = new HashSet<>();
// note: userName and userGroupNames must not be null
Map<String, List<String>> caveatConstraintDef = null;
@@ -602,7 +602,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
}
}
List<String>ret = new ArrayList<String>();
List<String>ret = new ArrayList<>();
ret.addAll(allowedValues);
return Collections.unmodifiableList(ret);
}
@@ -676,7 +676,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
Object val = entry.getValue();
if (val instanceof String)
{
propValues = new ArrayList<String>(1);
propValues = new ArrayList<>(1);
propValues.add((String)val);
}
else if (val instanceof List)
@@ -857,13 +857,13 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
if(members == null)
{
// Create the new list, with the authority name
Map<String, List<String>> constraint = new HashMap<String, List<String>>(0);
constraint.put(authorityName, new ArrayList<String>(values));
Map<String, List<String>> constraint = new HashMap<>(0);
constraint.put(authorityName, new ArrayList<>(values));
members = constraint;
}
else
{
members.put(authorityName, new ArrayList<String>(values));
members.put(authorityName, new ArrayList<>(values));
}
caveatConfig.put(listName, members);
@@ -893,7 +893,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
if(members == null)
{
// Members List does not exist
Map<String, List<String>> emptyConstraint = new HashMap<String, List<String>>(0);
Map<String, List<String>> emptyConstraint = new HashMap<>(0);
caveatConfig.put(listName, emptyConstraint);
members = emptyConstraint;
@@ -918,7 +918,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
List<String> vals = members.get(authority);
if(vals == null)
{
vals= new ArrayList<String>();
vals= new ArrayList<>();
members.put(authority, vals);
}
vals.add(valueName);
@@ -1022,13 +1022,12 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
for (String listName : listNames)
{
Map<String, List<String>> members = config.get(listName);
Set<String> authorityNames = members.keySet();
JSONObject listMembers = new JSONObject();
for (String authorityName : authorityNames)
for (Map.Entry<String, List<String>> member : members.entrySet())
{
List<String> authorities = members.get(authorityName);
final String authorityName = member.getKey();
final List<String> authorities = member.getValue();
try
{
listMembers.put(authorityName, authorities);
@@ -1134,7 +1133,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
try
{
writeLock.lock();
Map<String, List<String>> emptyConstraint = new HashMap<String, List<String>>(0);
Map<String, List<String>> emptyConstraint = new HashMap<>(0);
caveatConfig.put(listName, emptyConstraint);
updateOrCreateCaveatConfig(convertToJSONString(caveatConfig));
}

View File

@@ -150,7 +150,7 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
listName = sb.toString();
}
List<String>allowedValues = new ArrayList<String>();
List<String>allowedValues = new ArrayList<>();
for(String value : values)
{
allowedValues.add(value);
@@ -262,9 +262,9 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
*/
public Set<RMConstraintInfo> getAllRMConstraints()
{
Set<RMConstraintInfo> info = new HashSet<RMConstraintInfo>();
Set<RMConstraintInfo> info = new HashSet<>();
List<ConstraintDefinition> defs = new ArrayList<ConstraintDefinition>(10);
List<ConstraintDefinition> defs = new ArrayList<>(10);
for (QName caveatModelQName : rmCaveatConfigComponent.getRMCaveatModels())
{
defs.addAll(recordsManagementAdminService.getCustomConstraintDefinitions(caveatModelQName));
@@ -358,7 +358,7 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
if(allowedValues != null)
{
List<String>allowedValueList = new ArrayList<String>();
List<String>allowedValueList = new ArrayList<>();
for(String value : allowedValues)
{
allowedValueList.add(value);

View File

@@ -64,7 +64,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
// closed marking - all values must match
AND,
// open marking - at least one value must match
OR;
OR
}
// note: alternative to static init could be to use 'registered' constraint
@@ -112,7 +112,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
// get allowed values for current user
List<String> allowedForUser = caveatConfigService.getRMAllowedValues(getShortName());
List<String> filteredList = new ArrayList<String>(allowedForUser.size());
List<String> filteredList = new ArrayList<>(allowedForUser.size());
for (String allowed : allowedForUser)
{
if (this.allowedValues.contains(allowed))
@@ -153,7 +153,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
// 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<>(allowedForUser.size());
for (String allowed : allowedForUser)
{
if (this.allowedValuesUpper.contains(allowed.toUpperCase()))
@@ -186,7 +186,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
this.allowedValues = Collections.unmodifiableList(allowedValues);
// make the upper case versions
this.allowedValuesUpper = new ArrayList<String>(valueCount);
this.allowedValuesUpper = new ArrayList<>(valueCount);
for (String allowedValue : this.allowedValues)
{
allowedValuesUpper.add(allowedValue.toUpperCase());
@@ -202,7 +202,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
@Override
public Map<String, Object> getParameters()
{
Map<String, Object> params = new HashMap<String, Object>(2);
Map<String, Object> params = new HashMap<>(2);
params.put("caseSensitive", isCaseSensitive());
params.put("allowedValues", getAllowedValues());

View File

@@ -97,21 +97,15 @@ public class ScriptConstraint implements Serializable
return new ScriptConstraintAuthority[0];
}
// Here with some data to return
Set<String> authorities = values.keySet();
ArrayList<ScriptConstraintAuthority> constraints = new ArrayList<ScriptConstraintAuthority>(values.size());
for(String authority : authorities)
ArrayList<ScriptConstraintAuthority> constraints = new ArrayList<>(values.size());
for (Map.Entry<String, List<String>> entry : values.entrySet())
{
ScriptConstraintAuthority constraint = new ScriptConstraintAuthority();
constraint.setAuthorityName(authority);
constraint.setValues(values.get(authority));
constraint.setAuthorityName(entry.getKey());
constraint.setValues(entry.getValue());
constraints.add(constraint);
}
ScriptConstraintAuthority[] retVal = constraints.toArray(new ScriptConstraintAuthority[constraints.size()]);
return retVal;
return constraints.toArray(new ScriptConstraintAuthority[constraints.size()]);
}
/**
@@ -144,7 +138,7 @@ public class ScriptConstraint implements Serializable
JSONObject obj = bodge.getJSONObject(i);
String value = obj.getString("value");
JSONArray authorities = obj.getJSONArray("authorities");
List<String> aList = new ArrayList<String>();
List<String> aList = new ArrayList<>();
for(int j = 0; j < authorities.length();j++)
{
aList.add(authorities.getString(j));
@@ -209,24 +203,21 @@ public class ScriptConstraint implements Serializable
if (details == null)
{
details = new HashMap<String, List<String>>();
details = new HashMap<>();
}
// values, authorities
Map<String, List<String>> pivot = PivotUtil.getPivot(details);
// Here with some data to return
Set<String> values = pivot.keySet();
ArrayList<ScriptConstraintValue> constraints = new ArrayList<ScriptConstraintValue>(pivot.size());
for(String value : values)
ArrayList<ScriptConstraintValue> constraints = new ArrayList<>(pivot.size());
for (Map.Entry<String, List<String>> entry : pivot.entrySet())
{
ScriptConstraintValue constraint = new ScriptConstraintValue();
constraint.setValueName(value);
constraint.setValueTitle(value);
constraint.setValueName(entry.getKey());
constraint.setValueTitle(entry.getKey());
List<String>authorities = pivot.get(value);
List<ScriptAuthority> sauth = new ArrayList<ScriptAuthority>();
List<String> authorities = entry.getValue();
List<ScriptAuthority> sauth = new ArrayList<>();
for(String authority : authorities)
{
ScriptAuthority a = new ScriptAuthority();
@@ -250,6 +241,7 @@ public class ScriptConstraint implements Serializable
/**
* Now go through and add any "empty" values
*/
Set<String> values = pivot.keySet();
for(String value : info.getAllowedValues())
{
if(!values.contains(value))
@@ -257,7 +249,7 @@ public class ScriptConstraint implements Serializable
ScriptConstraintValue constraint = new ScriptConstraintValue();
constraint.setValueName(value);
constraint.setValueTitle(value);
List<ScriptAuthority> sauth = new ArrayList<ScriptAuthority>();
List<ScriptAuthority> sauth = new ArrayList<>();
constraint.setAuthorities(sauth);
constraints.add(constraint);
}

View File

@@ -93,7 +93,7 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
{
Set<RMConstraintInfo> values = caveatConfigService.getAllRMConstraints();
List<ScriptConstraint> vals = new ArrayList<ScriptConstraint>(values.size());
List<ScriptConstraint> vals = new ArrayList<>(values.size());
for(RMConstraintInfo value : values)
{
ScriptConstraint c = new ScriptConstraint(value, caveatConfigService, getAuthorityService());
@@ -132,7 +132,7 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
*/
public void updateConstraintValues(String listName, String authorityName, String[]values)
{
List<String> vals = new ArrayList<String>();
List<String> vals = new ArrayList<>();
caveatConfigService.updateRMConstraintListAuthority(listName, authorityName, vals);
}

View File

@@ -154,7 +154,7 @@ public abstract class ExtendedSecurityBaseDynamicAuthority implements DynamicAut
boolean result = false;
Map<Pair<NodeRef, String>, Boolean> transactionCache = TransactionalResourceHelper.getMap(getTransactionCacheName());
Pair<NodeRef, String> key = new Pair<NodeRef, String>(nodeRef, userName);
Pair<NodeRef, String> key = new Pair<>(nodeRef, userName);
if (transactionCache.containsKey(key))
{

View File

@@ -65,7 +65,7 @@ public class ExtendedWriterDynamicAuthority extends ExtendedSecurityBaseDynamicA
{
if (requiredFor == null)
{
requiredFor = new HashSet<PermissionReference>(3);
requiredFor = new HashSet<>(3);
Collections.addAll(requiredFor,
getModelDAO().getPermissionReference(null, RMPermissionModel.READ_RECORDS),
getModelDAO().getPermissionReference(null, RMPermissionModel.FILING),

View File

@@ -54,7 +54,7 @@ public class Role extends org.alfresco.module.org_alfresco_module_rm.role.Role
*/
public static Set<Role> toRoleSet(Set<org.alfresco.module.org_alfresco_module_rm.role.Role> roles)
{
Set<Role> result = new HashSet<Role>(roles.size());
Set<Role> result = new HashSet<>(roles.size());
for (org.alfresco.module.org_alfresco_module_rm.role.Role role : roles)
{
result.add(Role.toRole(role));

View File

@@ -133,7 +133,7 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
private IdentifierService identifierService;
/** List of kinds for which this action is applicable */
protected Set<FilePlanComponentKind> applicableKinds = new HashSet<FilePlanComponentKind>();
protected Set<FilePlanComponentKind> applicableKinds = new HashSet<>();
/**
* Get the transaction service

View File

@@ -63,10 +63,10 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
private static Log logger = LogFactory.getLog(RecordsManagementActionServiceImpl.class);
/** Registered records management actions */
private Map<String, RecordsManagementAction> rmActions = new HashMap<String, RecordsManagementAction>(13);
private Map<String, RecordsManagementActionCondition> rmConditions = new HashMap<String, RecordsManagementActionCondition>(13);
private Map<String, RecordsManagementAction> rmActions = new HashMap<>(13);
private Map<String, RecordsManagementActionCondition> rmConditions = new HashMap<>(13);
private Map<String, RecordsManagementAction> dispositionActions = new HashMap<String, RecordsManagementAction>(5);
private Map<String, RecordsManagementAction> dispositionActions = new HashMap<>(5);
/** Policy component */
private PolicyComponent policyComponent;
@@ -185,7 +185,7 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
*/
public List<RecordsManagementAction> getRecordsManagementActions()
{
List<RecordsManagementAction> result = new ArrayList<RecordsManagementAction>(this.rmActions.size());
List<RecordsManagementAction> result = new ArrayList<>(this.rmActions.size());
result.addAll(this.rmActions.values());
return Collections.unmodifiableList(result);
}
@@ -196,7 +196,7 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
@Override
public List<RecordsManagementActionCondition> getRecordsManagementActionConditions()
{
List<RecordsManagementActionCondition> result = new ArrayList<RecordsManagementActionCondition>(rmConditions.size());
List<RecordsManagementActionCondition> result = new ArrayList<>(rmConditions.size());
result.addAll(rmConditions.values());
return Collections.unmodifiableList(result);
}
@@ -210,7 +210,7 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
@SuppressWarnings("unused")
public List<RecordsManagementAction> getDispositionActions(NodeRef nodeRef)
{
List<RecordsManagementAction> result = new ArrayList<RecordsManagementAction>(this.rmActions.size());
List<RecordsManagementAction> result = new ArrayList<>(this.rmActions.size());
for (RecordsManagementAction action : this.rmActions.values())
{
@@ -225,7 +225,7 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
*/
public List<RecordsManagementAction> getDispositionActions()
{
List<RecordsManagementAction> result = new ArrayList<RecordsManagementAction>(dispositionActions.size());
List<RecordsManagementAction> result = new ArrayList<>(dispositionActions.size());
result.addAll(dispositionActions.values());
return Collections.unmodifiableList(result);
}
@@ -325,7 +325,7 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
public Map<NodeRef, RecordsManagementActionResult> executeRecordsManagementAction(List<NodeRef> nodeRefs, String name, Map<String, Serializable> parameters)
{
// Execute the action on each node in the list
Map<NodeRef, RecordsManagementActionResult> results = new HashMap<NodeRef, RecordsManagementActionResult>(nodeRefs.size());
Map<NodeRef, RecordsManagementActionResult> results = new HashMap<>(nodeRefs.size());
for (NodeRef nodeRef : nodeRefs)
{
RecordsManagementActionResult result = executeRecordsManagementAction(nodeRef, name, parameters);

View File

@@ -58,7 +58,7 @@ public class CustomParameterConstraint extends BaseParameterConstraint
*/
protected Map<String, String> getAllowableValuesImpl()
{
Map<String, String> allowableValues = new HashMap<String, String>(parameterValues.size());
Map<String, String> allowableValues = new HashMap<>(parameterValues.size());
for (Object parameterValue : parameterValues)
{

View File

@@ -60,7 +60,7 @@ public class DispositionActionParameterConstraint extends BaseParameterConstrain
{
List<RecordsManagementAction> rmActions = rmActionService.getDispositionActions();
Map<String, String> result = new HashMap<String, String>(rmActions.size());
Map<String, String> result = new HashMap<>(rmActions.size());
for (RecordsManagementAction rmAction : rmActions)
{
result.put(rmAction.getName(), rmAction.getLabel());

View File

@@ -59,7 +59,7 @@ public class ManualEventParameterConstraint extends BaseParameterConstraint
protected Map<String, String> getAllowableValuesImpl()
{
List<RecordsManagementEvent> events = recordsManagementEventService.getEvents();
Map<String, String> result = new HashMap<String, String>(events.size());
Map<String, String> result = new HashMap<>(events.size());
for (RecordsManagementEvent event : events)
{
RecordsManagementEventType eventType = recordsManagementEventService.getEventType(event.getType());

View File

@@ -108,7 +108,7 @@ public class RecordTypeParameterConstraint extends BaseParameterConstraint
{
Set<QName> recordTypes = recordService.getRecordMetadataAspects(filePlan);
result = new HashMap<String, String>(recordTypes.size());
result = new HashMap<>(recordTypes.size());
for (QName recordType : recordTypes)
{
AspectDefinition aspectDefinition = dictionaryService.getAspect(recordType);

View File

@@ -48,7 +48,7 @@ public class VersionParameterConstraint extends BaseParameterConstraint
protected Map<String, String> getAllowableValuesImpl()
{
RecordableVersionPolicy[] recordableVersionPolicies = RecordableVersionPolicy.values();
Map<String, String> allowableValues = new HashMap<String, String>(recordableVersionPolicies.length);
Map<String, String> allowableValues = new HashMap<>(recordableVersionPolicies.length);
for (RecordableVersionPolicy recordableVersionPolicy : recordableVersionPolicies)
{
String policy = recordableVersionPolicy.toString();

View File

@@ -35,5 +35,5 @@ package org.alfresco.module.org_alfresco_module_rm.action.evaluator;
*/
public enum DispositionActionRelativePositions
{
ANY, NEXT, PREVIOUS;
ANY, NEXT, PREVIOUS
}

View File

@@ -114,7 +114,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
{
Map<String, Serializable> paramValues = action.getParameterValues();
Map<QName, Serializable> result = new HashMap<QName, Serializable>(paramValues.size());
Map<QName, Serializable> result = new HashMap<>(paramValues.size());
for (Map.Entry<String, Serializable> entry : paramValues.entrySet())
{
QName propQName = QName.createQName(entry.getKey(), this.getNamespaceService());
@@ -138,7 +138,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
Map<QName, PropertyDefinition> props = aspectDefinition.getProperties();
this.parameterDefinitions = new ArrayList<ParameterDefinition>(props.size());
this.parameterDefinitions = new ArrayList<>(props.size());
for (Map.Entry<QName, PropertyDefinition> entry : props.entrySet())
{

View File

@@ -168,7 +168,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
}
List<EventCompletionDetails> events = da.getEventCompletionDetails();
List<String> list = new ArrayList<String>(events.size());
List<String> list = new ArrayList<>(events.size());
for (EventCompletionDetails event : events)
{
list.add(event.getEventName());

View File

@@ -94,7 +94,7 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
!getRecordService().isDeclared(actionedUponNodeRef))
{
String workflowDefinitionId = workflowService.getDefinitionByName(REQUEST_INFO_WORKFLOW_DEFINITION_NAME).getId();
Map<QName, Serializable> parameters = new HashMap<QName, Serializable>();
Map<QName, Serializable> parameters = new HashMap<>();
parameters.put(WorkflowModel.ASSOC_PACKAGE, getWorkflowPackage(action, actionedUponNodeRef));
parameters.put(RMWorkflowModel.RM_MIXED_ASSIGNEES, getAssignees(action));
@@ -144,7 +144,7 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
*/
private Serializable getAssignees(Action action)
{
List<NodeRef> assigneesList = new ArrayList<NodeRef>();
List<NodeRef> assigneesList = new ArrayList<>();
String assigneesAsString = (String) action.getParameterValue(PARAM_ASSIGNEES);
String[] assignees = StringUtils.split(assigneesAsString, ',');
for (String assignee : assignees)

View File

@@ -247,7 +247,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
ContentType contentType = new ContentType(part.getContentType());
Map<QName, Serializable> docProps = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> docProps = new HashMap<>(1);
docProps.put(ContentModel.PROP_NAME, messageTitle + " - " + fileName);
docProps.put(ContentModel.PROP_TITLE, fileName);

View File

@@ -203,7 +203,7 @@ public class RecordsManagementAdminBase implements RecordsManagementCustomModel
*/
protected Map<QName, AssociationDefinition> getCustomAssociations()
{
Map<QName, AssociationDefinition> customAssociations = new HashMap<QName,AssociationDefinition>();
Map<QName, AssociationDefinition> customAssociations = new HashMap<>();
AspectDefinition aspectDefn = getDictionaryService().getAspect(ASPECT_CUSTOM_ASSOCIATIONS);
if (aspectDefn != null)

View File

@@ -329,7 +329,7 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas
{
mandatory("customisableTypes", customisableTypes);
pendingCustomisableTypes = new ArrayList<QName>();
pendingCustomisableTypes = new ArrayList<>();
for (String customisableType : customisableTypes)
{
pendingCustomisableTypes.add(QName.createQName(customisableType, getNamespaceService()));
@@ -352,7 +352,7 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas
{
mandatory("nodeRef", nodeRef);
Set<QName> result = new HashSet<QName>(5);
Set<QName> result = new HashSet<>(5);
// Check the nodes hierarchy for customisable types
QName type = getNodeService().getType(nodeRef);
@@ -410,7 +410,7 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas
*/
private void initCustomMap()
{
customisableTypes = new HashMap<QName, QName>(7);
customisableTypes = new HashMap<>(7);
Collection<QName> aspects = getDictionaryService().getAspects(RM_CUSTOM_MODEL);
for (QName aspect : aspects)
{
@@ -636,7 +636,7 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas
*/
public Map<QName, PropertyDefinition> getCustomPropertyDefinitions()
{
Map<QName, PropertyDefinition> result = new HashMap<QName, PropertyDefinition>();
Map<QName, PropertyDefinition> result = new HashMap<>();
for (QName customisableType : getCustomisable())
{
Map<QName, PropertyDefinition> props = getCustomPropertyDefinitions(customisableType);
@@ -1268,7 +1268,7 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas
}
}
return new ArrayList<ConstraintDefinition>(conDefs);
return new ArrayList<>(conDefs);
}
/**

View File

@@ -251,26 +251,27 @@ public final class RecordsManagementAuditEntry
{
if (this.beforeProperties != null && this.afterProperties != null)
{
this.changedProperties = new HashMap<QName, Pair<Serializable, Serializable>>(
this.changedProperties = new HashMap<>(
this.beforeProperties.size() + this.afterProperties.size());
// add all the properties present before the audited action
for (QName valuePropName : this.beforeProperties.keySet())
for (Map.Entry<QName, Serializable> entry : this.beforeProperties.entrySet())
{
Pair<Serializable, Serializable> values = new Pair<Serializable, Serializable>(
this.beforeProperties.get(valuePropName),
final QName valuePropName = entry.getKey();
Pair<Serializable, Serializable> values = new Pair<>(
entry.getValue(),
this.afterProperties.get(valuePropName));
this.changedProperties.put(valuePropName, values);
}
// add all the properties present after the audited action that
// have not already been added
for (QName valuePropName : this.afterProperties.keySet())
for (Map.Entry<QName, Serializable> entry : this.afterProperties.entrySet())
{
final QName valuePropName = entry.getKey();
if (!this.beforeProperties.containsKey(valuePropName))
{
Pair<Serializable, Serializable> values = new Pair<Serializable, Serializable>(null,
this.afterProperties.get(valuePropName));
Pair<Serializable, Serializable> values = new Pair<>(null, entry.getValue());
this.changedProperties.put(valuePropName, values);
}
}

View File

@@ -210,12 +210,12 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
private List<String> ignoredAuditProperties;
private List<QName> propertiesToBeRemoved = new ArrayList<QName>();
private List<QName> propertiesToBeRemoved = new ArrayList<>();
private RMAuditTxnListener txnListener = new RMAuditTxnListener();
/** Registered and initialised records management auditEvents */
private Map<String, AuditEvent> auditEvents = new HashMap<String, AuditEvent>();
private Map<String, AuditEvent> auditEvents = new HashMap<>();
/**
* Set the component used to bind to behaviour callbacks
@@ -622,7 +622,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
*/
private Map<String, Serializable> buildAuditMap(NodeRef nodeRef, String eventName, Map<QName, Serializable> propertiesBefore, Map<QName, Serializable> propertiesAfter, boolean removeOnNoPropertyChange)
{
Map<String, Serializable> auditMap = new HashMap<String, Serializable>(13);
Map<String, Serializable> auditMap = new HashMap<>(13);
auditMap.put(
AuditApplication.buildPath(
RM_AUDIT_SNIPPET_EVENT,
@@ -796,7 +796,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
format == ReportFormat.HTML ? AUDIT_TRAIL_HTML_FILE_SUFFIX : AUDIT_TRAIL_JSON_FILE_SUFFIX);
try (FileOutputStream fileOutputStream = new FileOutputStream(auditTrailFile);
Writer fileWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream,"UTF8"));)
Writer fileWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream,"UTF8")))
{
// Get the results, dumping to file
getAuditTrailImpl(params, null, fileWriter, format);
@@ -817,7 +817,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
{
ParameterCheck.mandatory("params", params);
List<RecordsManagementAuditEntry> entries = new ArrayList<RecordsManagementAuditEntry>(50);
List<RecordsManagementAuditEntry> entries = new ArrayList<>(50);
try
{
getAuditTrailImpl(params, entries, null, null);
@@ -1072,7 +1072,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
NodeRef nodeRef = params.getNodeRef();
int maxEntries = params.getMaxEntries();
// Reverse order if the results are limited
boolean forward = maxEntries > 0 ? false : true;
boolean forward = maxEntries <= 0;
// start the audit trail report
writeAuditTrailHeader(writer, params, reportFormat);
@@ -1255,7 +1255,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
try
{
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> properties = new HashMap<>(1);
properties.put(ContentModel.PROP_NAME, auditTrail.getName());
// file the audit log as an undeclared record
@@ -1292,7 +1292,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
@Override
public List<AuditEvent> getAuditEvents()
{
List<AuditEvent> listAuditEvents = new ArrayList<AuditEvent>(this.auditEvents.size());
List<AuditEvent> listAuditEvents = new ArrayList<>(this.auditEvents.size());
listAuditEvents.addAll(this.auditEvents.values());
Collections.sort(listAuditEvents);
return listAuditEvents;

View File

@@ -47,10 +47,10 @@ import org.alfresco.util.ParameterCheck;
public class CapabilityServiceImpl implements CapabilityService
{
/** Capabilities */
private Map<String, Capability> capabilities = new HashMap<String, Capability>(57);
private Map<String, Capability> capabilities = new HashMap<>(57);
/** Groups */
private Map<String, Group> groups = new HashMap<String, Group>(13);
private Map<String, Group> groups = new HashMap<>(13);
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapability(java.lang.String)
@@ -92,11 +92,11 @@ public class CapabilityServiceImpl implements CapabilityService
Set<Capability> result = null;
if (includePrivate)
{
result = new HashSet<Capability>(capabilities.values());
result = new HashSet<>(capabilities.values());
}
else
{
result = new HashSet<Capability>(capabilities.size());
result = new HashSet<>(capabilities.size());
for (Capability capability : capabilities.values())
{
if (!capability.isPrivate())
@@ -127,7 +127,7 @@ public class CapabilityServiceImpl implements CapabilityService
ParameterCheck.mandatory("nodeRef", nodeRef);
Set<Capability> listOfCapabilites = getCapabilities(includePrivate);
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
HashMap<Capability, AccessStatus> answer = new HashMap<>();
for (Capability capability : listOfCapabilites)
{
AccessStatus status = capability.hasPermission(nodeRef);
@@ -147,7 +147,7 @@ public class CapabilityServiceImpl implements CapabilityService
ParameterCheck.mandatory("nodeRef", nodeRef);
ParameterCheck.mandatory("capabilityNames", capabilityNames);
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
HashMap<Capability, AccessStatus> answer = new HashMap<>();
for (String capabilityName : capabilityNames)
{
Capability capability = capabilities.get(capabilityName);
@@ -189,7 +189,7 @@ public class CapabilityServiceImpl implements CapabilityService
@Override
public List<Group> getGroups()
{
List<Group> groups = new ArrayList<Group>();
List<Group> groups = new ArrayList<>();
for (Map.Entry<String, Group> entry : this.groups.entrySet())
{
groups.add(entry.getValue());
@@ -217,7 +217,7 @@ public class CapabilityServiceImpl implements CapabilityService
String id = this.groups.get(groupId).getId();
List<Capability> capabilities = new ArrayList<Capability>();
List<Capability> capabilities = new ArrayList<>();
for (Capability capability : getCapabilities())
{
Group group = capability.getGroup();

View File

@@ -566,7 +566,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
private QueryEngineResults decide(Authentication authentication, Object object, ConfigAttributeDefinition config, QueryEngineResults returnedObject)
{
Map<Set<String>, ResultSet> map = returnedObject.getResults();
Map<Set<String>, ResultSet> answer = new HashMap<Set<String>, ResultSet>(map.size(), 1.0f);
Map<Set<String>, ResultSet> answer = new HashMap<>(map.size(), 1.0f);
for (Map.Entry<Set<String>, ResultSet> entry : map.entrySet())
{
@@ -630,7 +630,7 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
int count = 0;
// Keep values explicitly
List<Object> keepValues = new ArrayList<Object>(returnedObject.size());
List<Object> keepValues = new ArrayList<>(returnedObject.size());
for (Object nextObject : returnedObject)
{

View File

@@ -80,7 +80,7 @@ public class RMEntryVoter extends RMSecurityCommon
private AuthenticationUtil authenticationUtil;
/** Policy map */
private Map<String, Policy> policies = new HashMap<String, Policy>();
private Map<String, Policy> policies = new HashMap<>();
/**
* @param capabilityService capability service
@@ -404,7 +404,7 @@ public class RMEntryVoter extends RMSecurityCommon
@SuppressWarnings("rawtypes")
private List<ConfigAttributeDefinition> extractSupportedDefinitions(net.sf.acegisecurity.ConfigAttributeDefinition config)
{
List<ConfigAttributeDefinition> definitions = new ArrayList<ConfigAttributeDefinition>(2);
List<ConfigAttributeDefinition> definitions = new ArrayList<>(2);
Iterator iter = config.getConfigAttributes();
while (iter.hasNext())

View File

@@ -227,7 +227,7 @@ public class RMSecurityCommon implements ApplicationContextAware
int result = AccessDecisionVoter.ACCESS_ABSTAIN;
Map<Pair<String, NodeRef>, Integer> transactionCache = TransactionalResourceHelper.getMap("rm.security.checkRMRead");
Pair<String, NodeRef> key = new Pair<String, NodeRef>(AuthenticationUtil.getRunAsUser(), nodeRef);
Pair<String, NodeRef> key = new Pair<>(AuthenticationUtil.getRunAsUser(), nodeRef);
if (transactionCache.containsKey(key))
{
@@ -282,7 +282,7 @@ public class RMSecurityCommon implements ApplicationContextAware
private AccessStatus hasViewCapability(NodeRef filePlan)
{
Map<Pair<String, NodeRef>, AccessStatus> transactionCache = TransactionalResourceHelper.getMap("rm.security.hasViewCapability");
Pair<String, NodeRef> key = new Pair<String, NodeRef>(AuthenticationUtil.getRunAsUser(), filePlan);
Pair<String, NodeRef> key = new Pair<>(AuthenticationUtil.getRunAsUser(), filePlan);
if (transactionCache.containsKey(key))
{

View File

@@ -151,7 +151,7 @@ public class DeclarativeCapability extends AbstractCapability
*/
public void setPermission(String permission)
{
List<String> permissions = new ArrayList<String>(1);
List<String> permissions = new ArrayList<>(1);
permissions.add(permission);
this.permissions = permissions;
}
@@ -273,7 +273,7 @@ public class DeclarativeCapability extends AbstractCapability
{
if (kinds != null && availableKinds == null)
{
availableKinds = new HashSet<FilePlanComponentKind>(kinds.size());
availableKinds = new HashSet<>(kinds.size());
for (String kindString : kinds)
{
FilePlanComponentKind kind = FilePlanComponentKind.valueOf(kindString);

View File

@@ -124,7 +124,7 @@ public class CreateCapability extends DeclarativeCapability
}
// Build the conditions map
Map<String, Boolean> conditions = new HashMap<String, Boolean>(5);
Map<String, Boolean> conditions = new HashMap<>(5);
conditions.put("capabilityCondition.filling", Boolean.TRUE);
conditions.put("capabilityCondition.frozen", Boolean.FALSE);
conditions.put("capabilityCondition.closed", Boolean.FALSE);

View File

@@ -64,7 +64,7 @@ public class ConfigAttributeDefinition
private SimplePermissionReference required;
/** parameter position map */
private Map<Integer, Integer> parameters = new HashMap<Integer, Integer>(2, 1.0f);
private Map<Integer, Integer> parameters = new HashMap<>(2, 1.0f);
/** is parent */
private boolean parent = false;

View File

@@ -76,7 +76,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
private static Log logger = LogFactory.getLog(DataSetServiceImpl.class);
/** Registered data set implementations */
private Map<String, DataSet> dataSets = new HashMap<String, DataSet>();
private Map<String, DataSet> dataSets = new HashMap<>();
/** Spaces store */
private static final StoreRef SPACES_STORE = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
@@ -244,7 +244,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
ParameterCheck.mandatory("excludeLoaded", excludeLoaded);
// Get the list of all available data sets
Map<String, DataSet> dataSets = new HashMap<String, DataSet>(getDataSets());
Map<String, DataSet> dataSets = new HashMap<>(getDataSets());
// Should the list of unloaded data sets be retrieved
if (excludeLoaded)
@@ -330,7 +330,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
ParameterCheck.mandatory("filePlan", filePlan);
// Get the list of available data sets
Map<String, DataSet> availableDataSets = new HashMap<String, DataSet>(getDataSets());
Map<String, DataSet> availableDataSets = new HashMap<>(getDataSets());
// Get the property value of the aspect
Serializable dataSetIds = nodeService.getProperty(filePlan, PROP_LOADED_DATA_SET_IDS);
@@ -353,7 +353,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
return availableDataSets;
}
return new HashMap<String, DataSet>();
return new HashMap<>();
}
/**
@@ -397,7 +397,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
// Create "all" role group for root node
String allRoles = authorityService.createAuthority(AuthorityType.GROUP, allRoleShortName,
RMAuthority.ALL_ROLES_DISPLAY_NAME, new HashSet<String>(Arrays.asList(RMAuthority.ZONE_APP_RM)));
RMAuthority.ALL_ROLES_DISPLAY_NAME, new HashSet<>(Arrays.asList(RMAuthority.ZONE_APP_RM)));
// Put all the role groups in it
Set<Role> roles = filePlanRoleService.getRoles(rmRoot);
@@ -504,7 +504,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
// Check if any data set has been imported
if (dataSetIds == null)
{
Map<QName, Serializable> aspectProperties = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> aspectProperties = new HashMap<>(1);
aspectProperties.put(PROP_LOADED_DATA_SET_IDS, (Serializable) new ArrayList<String>());
nodeService.addAspect(filePlan, ASPECT_LOADED_DATA_SET_ID, aspectProperties);
loadedDataSetIds = (ArrayList<String>) nodeService.getProperty(filePlan, PROP_LOADED_DATA_SET_IDS);
@@ -516,7 +516,7 @@ public class DataSetServiceImpl implements DataSetService, RecordsManagementMode
// Add the new loaded data set id
loadedDataSetIds.add(dataSetId);
Map<QName, Serializable> aspectProperties = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> aspectProperties = new HashMap<>(1);
aspectProperties.put(PROP_LOADED_DATA_SET_IDS, (Serializable) loadedDataSetIds);
nodeService.addAspect(filePlan, ASPECT_LOADED_DATA_SET_ID, aspectProperties);
}

View File

@@ -203,7 +203,7 @@ public class DispositionActionDefinitionImpl implements DispositionActionDefinit
Collection<String> eventNames = (Collection<String>)nodeService.getProperty(this.dispositionActionNodeRef, PROP_DISPOSITION_EVENT);
if (eventNames != null)
{
events = new ArrayList<RecordsManagementEvent>(eventNames.size());
events = new ArrayList<>(eventNames.size());
for (String eventName : eventNames)
{
RecordsManagementEvent event = recordsManagementEventService.getEvent(eventName);

View File

@@ -211,7 +211,7 @@ public class DispositionActionImpl implements DispositionAction,
this.dispositionNodeRef,
ASSOC_EVENT_EXECUTIONS,
RegexQNamePattern.MATCH_ALL);
List<EventCompletionDetails> result = new ArrayList<EventCompletionDetails>(assocs.size());
List<EventCompletionDetails> result = new ArrayList<>(assocs.size());
for (ChildAssociationRef assoc : assocs)
{
result.add(getEventCompletionDetailsFromNodeRef(assoc.getChildRef()));
@@ -236,7 +236,7 @@ public class DispositionActionImpl implements DispositionAction,
String eventName = (String)props.get(PROP_EVENT_EXECUTION_NAME);
// create event completion details
EventCompletionDetails ecd = new EventCompletionDetails(
return new EventCompletionDetails(
nodeRef,
eventName,
services.getRecordsManagementEventService().getEvent(eventName).getDisplayLabel(),
@@ -244,8 +244,6 @@ public class DispositionActionImpl implements DispositionAction,
getBooleanValue(props.get(PROP_EVENT_EXECUTION_COMPLETE), false),
(Date) props.get(PROP_EVENT_EXECUTION_COMPLETED_AT),
(String) props.get(PROP_EVENT_EXECUTION_COMPLETED_BY));
return ecd;
}
/**
@@ -392,7 +390,7 @@ public class DispositionActionImpl implements DispositionAction,
List<String> stepEvents = (List<String>) services.getNodeService().getProperty(getDispositionActionDefinition().getNodeRef(), PROP_DISPOSITION_EVENT);
List<EventCompletionDetails> eventsList = getEventCompletionDetails();
List<String> nextActionEvents = new ArrayList<String>(eventsList.size());
List<String> nextActionEvents = new ArrayList<>(eventsList.size());
for (EventCompletionDetails event : eventsList)
{
@@ -456,7 +454,7 @@ public class DispositionActionImpl implements DispositionAction,
@Override
public void addEventCompletionDetails(RecordsManagementEvent event)
{
Map<QName, Serializable> eventProps = new HashMap<QName, Serializable>(7);
Map<QName, Serializable> eventProps = new HashMap<>(7);
eventProps.put(PROP_EVENT_EXECUTION_NAME, event.getName());
// TODO display label
eventProps.put(PROP_EVENT_EXECUTION_AUTOMATIC, event.getRecordsManagementEventType().isAutomaticEvent());

View File

@@ -179,10 +179,10 @@ public class DispositionScheduleImpl implements DispositionSchedule,
this.dispositionDefinitionNodeRef,
ASSOC_DISPOSITION_ACTION_DEFINITIONS,
RegexQNamePattern.MATCH_ALL);
this.actions = new ArrayList<DispositionActionDefinition>(assocs.size());
this.actionsById = new HashMap<String, DispositionActionDefinition>(assocs.size());
this.actionsByName = new HashMap<String, DispositionActionDefinition>(assocs.size());
this.actionsByDispositionActionName = new HashMap<String, DispositionActionDefinition>(assocs.size());
this.actions = new ArrayList<>(assocs.size());
this.actionsById = new HashMap<>(assocs.size());
this.actionsByName = new HashMap<>(assocs.size());
this.actionsByDispositionActionName = new HashMap<>(assocs.size());
int index = 0;
for (ChildAssociationRef assoc : assocs)
{

View File

@@ -95,7 +95,7 @@ public class DispositionSelectionStrategy implements RecordsManagementModel
}
else
{
SortedSet<NodeRef> sortedFolders = new TreeSet<NodeRef>(new DispositionableNodeRefComparator());
SortedSet<NodeRef> sortedFolders = new TreeSet<>(new DispositionableNodeRefComparator());
sortedFolders.addAll(recordFolders);
recordFolder = sortedFolders.first();
}

View File

@@ -116,7 +116,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
private FreezeService freezeService;
/** Disposition properties */
private Map<QName, DispositionProperty> dispositionProperties = new HashMap<QName, DispositionProperty>(4);
private Map<QName, DispositionProperty> dispositionProperties = new HashMap<>(4);
/**
* Set node service
@@ -254,7 +254,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
public Collection<DispositionProperty> getDispositionProperties(boolean isRecordLevel, String dispositionAction)
{
Collection<DispositionProperty> values = dispositionProperties.values();
List<DispositionProperty> result = new ArrayList<DispositionProperty>(values.size());
List<DispositionProperty> result = new ArrayList<>(values.size());
for (DispositionProperty dispositionProperty : values)
{
boolean test = dispositionProperty.applies(isRecordLevel, dispositionAction);
@@ -524,7 +524,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
private List<NodeRef> getDisposableItemsImpl(boolean isRecordLevelDisposition, NodeRef rmContainer)
{
List<NodeRef> items = filePlanService.getAllContained(rmContainer);
List<NodeRef> result = new ArrayList<NodeRef>(items.size());
List<NodeRef> result = new ArrayList<>(items.size());
for (NodeRef item : items)
{
if (recordFolderService.isRecordFolder(item))
@@ -706,7 +706,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
}
// Create the properties
Map<QName, Serializable> props = new HashMap<QName, Serializable>(10);
Map<QName, Serializable> props = new HashMap<>(10);
Date asOfDate = calculateAsOfDate(nodeRef, dispositionActionDefinition);
@@ -925,7 +925,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
public List<DispositionAction> getCompletedDispositionActions(NodeRef nodeRef)
{
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(nodeRef, ASSOC_DISPOSITION_ACTION_HISTORY, RegexQNamePattern.MATCH_ALL);
List<DispositionAction> result = new ArrayList<DispositionAction>(assocs.size());
List<DispositionAction> result = new ArrayList<>(assocs.size());
for (ChildAssociationRef assoc : assocs)
{
NodeRef dispositionActionNodeRef = assoc.getChildRef();
@@ -1192,7 +1192,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
public Void doWork()
{
// Apply the cut off aspect and set cut off date
Map<QName, Serializable> cutOffProps = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> cutOffProps = new HashMap<>(1);
cutOffProps.put(PROP_CUT_OFF_DATE, new Date());
nodeService.addAspect(nodeRef, ASPECT_CUT_OFF, cutOffProps);

View File

@@ -166,7 +166,7 @@ public class CustomEmailMappingServiceImpl extends AbstractLifecycleBean impleme
}
else
{
customMappings = new HashSet<CustomMapping>();
customMappings = new HashSet<>();
// load the contents of the extractors property file
Map<String, Set<QName>> currentMapping = extracter.getCurrentMapping();
@@ -293,14 +293,14 @@ public class CustomEmailMappingServiceImpl extends AbstractLifecycleBean impleme
private void updateExtractor()
{
// convert the mapping information into the form understood by the extractor
Map<String, Set<QName>> newMapping = new HashMap<String, Set<QName>>(17);
Map<String, Set<QName>> newMapping = new HashMap<>(17);
for(CustomMapping mapping : getCustomMappings())
{
QName newQName = QName.createQName(mapping.getTo(), nspr);
Set<QName> values = newMapping.get(mapping.getFrom());
if(values == null)
{
values = new HashSet<QName>();
values = new HashSet<>();
newMapping.put(mapping.getFrom(), values);
}
values.add(newQName);
@@ -317,7 +317,7 @@ public class CustomEmailMappingServiceImpl extends AbstractLifecycleBean impleme
*/
private Set<CustomMapping> loadConfig()
{
Set<CustomMapping> result = new HashSet<CustomMapping>();
Set<CustomMapping> result = new HashSet<>();
ContentReader cr = contentService.getReader(CONFIG_NODE_REF, ContentModel.PROP_CONTENT);
if (cr != null)
{
@@ -353,7 +353,7 @@ public class CustomEmailMappingServiceImpl extends AbstractLifecycleBean impleme
if (!nodeService.exists(CONFIG_NODE_REF))
{
// create the config node
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(2);
Map<QName, Serializable> properties = new HashMap<>(2);
properties.put(ContentModel.PROP_NAME, CONFIG_NAME);
properties.put(ContentModel.PROP_NODE_UUID, CONFIG_NODE_REF.getId());
nodeService.createNode(
@@ -463,7 +463,7 @@ public class CustomEmailMappingServiceImpl extends AbstractLifecycleBean impleme
*/
private Set<CustomMapping> readOldConfig(NodeRef nodeRef)
{
Set<CustomMapping> newMappings = new HashSet<CustomMapping>();
Set<CustomMapping> newMappings = new HashSet<>();
ContentReader cr = contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);
if (cr != null)

View File

@@ -79,7 +79,7 @@ public class RFC822MetadataExtracter extends org.alfresco.repo.content.metadata.
if (!nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_RECORD))
{
// Remove all rm namespace properties from the system map
Map<QName, Serializable> clone = new HashMap<QName, Serializable>(systemProperties);
Map<QName, Serializable> clone = new HashMap<>(systemProperties);
for (QName propName : clone.keySet())
{
if (RecordsManagementModel.RM_URI.equals(propName.getNamespaceURI()))

View File

@@ -131,7 +131,7 @@ public class OnReferenceCreateEventType extends SimpleRecordsManagementEventType
rmEvent.getType().equals(getName()))
{
// Complete the event
Map<String, Serializable> params = new HashMap<String, Serializable>(3);
Map<String, Serializable> params = new HashMap<>(3);
params.put(CompleteEventAction.PARAM_EVENT_NAME, event.getEventName());
params.put(CompleteEventAction.PARAM_EVENT_COMPLETED_BY, AuthenticationUtil.getFullyAuthenticatedUser());
params.put(CompleteEventAction.PARAM_EVENT_COMPLETED_AT, new Date());

View File

@@ -246,7 +246,7 @@ public class OnReferencedRecordActionedUpon extends SimpleRecordsManagementEvent
rmEvent.getType().equals(getName()))
{
// Complete the event
Map<String, Serializable> params = new HashMap<String, Serializable>(3);
Map<String, Serializable> params = new HashMap<>(3);
params.put(CompleteEventAction.PARAM_EVENT_NAME, event.getEventName());
params.put(CompleteEventAction.PARAM_EVENT_COMPLETED_BY, AuthenticationUtil.getFullyAuthenticatedUser());
params.put(CompleteEventAction.PARAM_EVENT_COMPLETED_AT, new Date());

View File

@@ -66,7 +66,7 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
private ContentService contentService;
/** Registered event types */
private Map<String, RecordsManagementEventType> eventTypes = new HashMap<String, RecordsManagementEventType>(7);
private Map<String, RecordsManagementEventType> eventTypes = new HashMap<>(7);
/** Available events */
private Map<String, RecordsManagementEvent> events;
@@ -104,7 +104,7 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
*/
public List<RecordsManagementEventType> getEventTypes()
{
return new ArrayList<RecordsManagementEventType>(this.eventTypes.values());
return new ArrayList<>(this.eventTypes.values());
}
/**
@@ -112,7 +112,7 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
*/
public List<RecordsManagementEvent> getEvents()
{
return new ArrayList<RecordsManagementEvent>(this.getEventMap().values());
return new ArrayList<>(this.getEventMap().values());
}
/**
@@ -300,7 +300,7 @@ public class RecordsManagementEventServiceImpl implements RecordsManagementEvent
JSONObject configJSON = new JSONObject(jsonString);
JSONArray eventsJSON = configJSON.getJSONArray("events");
events = new HashMap<String, RecordsManagementEvent>(eventsJSON.length());
events = new HashMap<>(eventsJSON.length());
for (int i = 0; i < eventsJSON.length(); i++)
{

View File

@@ -51,5 +51,5 @@ public enum FilePlanComponentKind
HOLD_CONTAINER,
DISPOSITION_SCHEDULE,
UNFILED_RECORD_CONTAINER,
UNFILED_RECORD_FOLDER;
UNFILED_RECORD_FOLDER
}

View File

@@ -182,8 +182,8 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
{
ParameterCheck.mandatory("storeRef", storeRef);
final Set<NodeRef> results = new HashSet<NodeRef>();
Set<QName> aspects = new HashSet<QName>(1);
final Set<NodeRef> results = new HashSet<>();
Set<QName> aspects = new HashSet<>(1);
aspects.add(ASPECT_RECORDS_MANAGEMENT_ROOT);
getNodeDAO().getNodesWithAspects(aspects, Long.MIN_VALUE, Long.MAX_VALUE, new NodeDAO.NodeRefQueryCallback()
{
@@ -275,7 +275,7 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
}
NodeRef result = null;
Pair<NodeRef, String> key = new Pair<NodeRef, String>(filePlan, containerName);
Pair<NodeRef, String> key = new Pair<>(filePlan, containerName);
if (!rootContainerCache.contains(key))
{
@@ -344,7 +344,7 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
String allRoles = getFilePlanRoleService().getAllRolesContainerGroup(filePlan);
// create the properties map
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> properties = new HashMap<>(1);
properties.put(ContentModel.PROP_NAME, containerName);
// create the unfiled container
@@ -389,7 +389,7 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
}
// Build map of properties
Map<QName, Serializable> rmRootProps = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> rmRootProps = new HashMap<>(1);
if (properties != null && properties.size() != 0)
{
rmRootProps.putAll(properties);
@@ -439,7 +439,7 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
*/
public List<NodeRef> getNodeRefPath(NodeRef nodeRef)
{
LinkedList<NodeRef> nodeRefPath = new LinkedList<NodeRef>();
LinkedList<NodeRef> nodeRefPath = new LinkedList<>();
try
{
getNodeRefPathRecursive(nodeRef, nodeRefPath);
@@ -501,7 +501,7 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
}
// Set the properties for the record category
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> props = new HashMap<>(1);
if (properties != null && properties.size() != 0)
{
props.putAll(properties);
@@ -576,7 +576,7 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CONTAINER_EXPECTED));
}
List<NodeRef> result = new ArrayList<NodeRef>(1);
List<NodeRef> result = new ArrayList<>(1);
List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(container, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef assoc : assocs)
{

View File

@@ -127,7 +127,7 @@ public class FreezeServiceImpl extends ServiceBaseImpl
@Deprecated
public Set<NodeRef> getFrozen(NodeRef hold)
{
return new HashSet<NodeRef>(getHoldService().getHeld(hold));
return new HashSet<>(getHoldService().getHeld(hold));
}
/**
@@ -168,7 +168,7 @@ public class FreezeServiceImpl extends ServiceBaseImpl
NodeRef hold = null;
if (!nodeRefs.isEmpty())
{
List<NodeRef> list = new ArrayList<NodeRef>(nodeRefs);
List<NodeRef> list = new ArrayList<>(nodeRefs);
hold = createHold(list.get(0), reason);
getHoldService().addToHold(hold, list);
}
@@ -260,7 +260,7 @@ public class FreezeServiceImpl extends ServiceBaseImpl
{
ParameterCheck.mandatory("filePlan", filePlan);
return new HashSet<NodeRef>(getHoldService().getHolds(filePlan));
return new HashSet<>(getHoldService().getHolds(filePlan));
}
/**
@@ -312,7 +312,7 @@ public class FreezeServiceImpl extends ServiceBaseImpl
}
// add aspect and set count
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> props = new HashMap<>(1);
props.put(PROP_HELD_CHILDREN_COUNT, heldCount);
getInternalNodeService().addAspect(nodeRef, ASPECT_HELD_CHILDREN, props);

View File

@@ -253,7 +253,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
{
ParameterCheck.mandatory("filePlan", filePlan);
List<NodeRef> holds = new ArrayList<NodeRef>();
List<NodeRef> holds = new ArrayList<>();
// get the root hold container
NodeRef holdContainer = filePlanService.getHoldContainer(filePlan);
@@ -305,11 +305,11 @@ public class HoldServiceImpl extends ServiceBaseImpl
// invert list to get list of holds that do not contain this node
NodeRef filePlan = filePlanService.getFilePlan(nodeRef);
List<NodeRef> allHolds = getHolds(filePlan);
result = ListUtils.subtract(allHolds, new ArrayList<NodeRef>(holdsNotIncludingNodeRef));
result = ListUtils.subtract(allHolds, new ArrayList<>(holdsNotIncludingNodeRef));
}
else
{
result = new ArrayList<NodeRef>(holdsNotIncludingNodeRef);
result = new ArrayList<>(holdsNotIncludingNodeRef);
}
return result;
@@ -324,7 +324,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
private Set<NodeRef> getParentHolds(NodeRef nodeRef)
{
List<ChildAssociationRef> holdsAssocs = nodeService.getParentAssocs(nodeRef, ASSOC_FROZEN_RECORDS, ASSOC_FROZEN_RECORDS);
Set<NodeRef> holds = new HashSet<NodeRef>(holdsAssocs.size());
Set<NodeRef> holds = new HashSet<>(holdsAssocs.size());
for (ChildAssociationRef holdAssoc : holdsAssocs)
{
holds.add(holdAssoc.getParentRef());
@@ -362,7 +362,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
public List<NodeRef> getHeld(NodeRef hold)
{
ParameterCheck.mandatory("hold", hold);
List<NodeRef> children = new ArrayList<NodeRef>();
List<NodeRef> children = new ArrayList<>();
if (!isHold(hold))
{
@@ -395,7 +395,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
NodeRef holdContainer = filePlanService.getHoldContainer(filePlan);
// create map of properties
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(3);
Map<QName, Serializable> properties = new HashMap<>(3);
properties.put(ContentModel.PROP_NAME, name);
properties.put(PROP_HOLD_REASON, reason);
if (description != null && !description.isEmpty())
@@ -468,7 +468,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
}
});
List<String> heldNames = new ArrayList<String>();
List<String> heldNames = new ArrayList<>();
for (NodeRef nodeRef : held)
{
try
@@ -510,7 +510,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
ParameterCheck.mandatory("hold", hold);
ParameterCheck.mandatory("nodeRef", nodeRef);
List<NodeRef> holds = new ArrayList<NodeRef>(1);
List<NodeRef> holds = new ArrayList<>(1);
holds.add(hold);
addToHolds(Collections.unmodifiableList(holds), nodeRef);
}
@@ -576,7 +576,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
public Void doWork()
{
// gather freeze properties
Map<QName, Serializable> props = new HashMap<QName, Serializable>(2);
Map<QName, Serializable> props = new HashMap<>(2);
props.put(PROP_FROZEN_AT, new Date());
props.put(PROP_FROZEN_BY, AuthenticationUtil.getFullyAuthenticatedUser());
@@ -651,7 +651,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
ParameterCheck.mandatory("hold", hold);
ParameterCheck.mandatory("nodeRef", nodeRef);
List<NodeRef> holds = new ArrayList<NodeRef>(1);
List<NodeRef> holds = new ArrayList<>(1);
holds.add(hold);
removeFromHolds(Collections.unmodifiableList(holds), nodeRef);
}

View File

@@ -51,7 +51,7 @@ public class IdentifierServiceImpl implements IdentifierService
private static Log logger = LogFactory.getLog(IdentifierServiceImpl.class);
/** Registry map */
private Map<QName, IdentifierGenerator> register = new HashMap<QName, IdentifierGenerator>(5);
private Map<QName, IdentifierGenerator> register = new HashMap<>(5);
/** Node service */
private NodeService nodeService;
@@ -88,7 +88,7 @@ public class IdentifierServiceImpl implements IdentifierService
ParameterCheck.mandatory("type", type);
// Build the context
Map<String, Serializable> context = new HashMap<String, Serializable>(2);
Map<String, Serializable> context = new HashMap<>(2);
if (parent != null)
{
context.put(CONTEXT_PARENT_NODEREF, parent);
@@ -107,7 +107,7 @@ public class IdentifierServiceImpl implements IdentifierService
{
ParameterCheck.mandatory("nodeRef", nodeRef);
Map<String, Serializable> context = new HashMap<String, Serializable>(3);
Map<String, Serializable> context = new HashMap<>(3);
// Set the original type
QName type = nodeService.getType(nodeRef);

View File

@@ -226,7 +226,7 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
ChildAssociationRef parent = nodeService.getPrimaryParent(actionNode);
if (parent.getTypeQName().equals(RecordsManagementModel.ASSOC_NEXT_DISPOSITION_ACTION))
{
Map<String, Serializable> props = new HashMap<String, Serializable>(1);
Map<String, Serializable> props = new HashMap<>(1);
props.put(RMDispositionActionExecuterAbstractBase.PARAM_NO_ERROR_CHECK,
Boolean.FALSE);

View File

@@ -89,7 +89,7 @@ public class DispositionActionDefinitionPublishExecutor extends BasePublishExecu
List<QName> updatedProps = (List<QName>)nodeService.getProperty(nodeRef, RecordsManagementModel.PROP_UPDATED_PROPERTIES);
if (updatedProps != null)
{
Map<String, Serializable> params = new HashMap<String, Serializable>();
Map<String, Serializable> params = new HashMap<>();
params.put(BroadcastDispositionActionDefinitionUpdateAction.CHANGED_PROPERTIES, (Serializable)updatedProps);
rmActionService.executeRecordsManagementAction(nodeRef, BroadcastDispositionActionDefinitionUpdateAction.NAME, params);
}

View File

@@ -38,7 +38,7 @@ import java.util.Map;
public class PublishExecutorRegistry
{
/** Map of publish executors */
private Map<String, PublishExecutor> publishExectors = new HashMap<String, PublishExecutor>(3);
private Map<String, PublishExecutor> publishExectors = new HashMap<>(3);
/**
* Register a publish executor

View File

@@ -214,7 +214,7 @@ public abstract class BaseEvaluator implements RecordsManagementModel, BeanNameA
*/
public void setCapability(String capability)
{
List<String> list = new ArrayList<String>(1);
List<String> list = new ArrayList<>(1);
list.add(capability);
this.capabilities = list;
}

View File

@@ -117,10 +117,10 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
private DispositionService dispositionService;
/** Indicators */
private List<BaseEvaluator> indicators = new ArrayList<BaseEvaluator>();
private List<BaseEvaluator> indicators = new ArrayList<>();
/** Actions */
private List<BaseEvaluator> actions = new ArrayList<BaseEvaluator>();
private List<BaseEvaluator> actions = new ArrayList<>();
/** The policy component */
private PolicyComponent policyComponent;
@@ -469,7 +469,7 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
{
public Map<String, Object> doWork() throws Exception
{
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> result = new HashMap<>();
// File plan node reference
NodeRef filePlan = filePlanService.getFilePlan(nodeRef);

View File

@@ -65,7 +65,7 @@ public abstract class BaseBehaviourBean extends ServiceBaseImpl
protected BehaviourFilter behaviourFilter;
/** behaviour map */
protected Map<String, org.alfresco.repo.policy.Behaviour> behaviours = new HashMap<String, org.alfresco.repo.policy.Behaviour>(7);
protected Map<String, org.alfresco.repo.policy.Behaviour> behaviours = new HashMap<>(7);
/**
* @param behaviourFilter behaviour filter

View File

@@ -667,7 +667,7 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
List<EventCompletionDetails> eventsList = da.getEventCompletionDetails();
if (eventsList.size() > 0)
{
eventNames = new ArrayList<String>(eventsList.size());
eventNames = new ArrayList<>(eventsList.size());
for (EventCompletionDetails event : eventsList)
{
eventNames.add(event.getEventName());
@@ -750,7 +750,7 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
// Only care about record folders
if (nodeService.exists(nodeRef) && recordFolderService.isRecordFolder(nodeRef))
{
Set<QName> props = new HashSet<QName>(1);
Set<QName> props = new HashSet<>(1);
props.add(PROP_REVIEW_PERIOD);
Set<QName> changed = determineChangedProps(before, after);
changed.retainAll(props);
@@ -893,7 +893,7 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
*/
private Set<QName> determineChangedProps(Map<QName, Serializable> oldProps, Map<QName, Serializable> newProps)
{
Set<QName> result = new HashSet<QName>();
Set<QName> result = new HashSet<>();
for (Map.Entry<QName, Serializable> entry : oldProps.entrySet())
{
QName qn = entry.getKey();
@@ -921,7 +921,7 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
*/
private List<NodeRef> getRecordFolders(NodeRef recordCategoryNode)
{
List<NodeRef> results = new ArrayList<NodeRef>(8);
List<NodeRef> results = new ArrayList<>(8);
List<ChildAssociationRef> folderAssocs = nodeService.getChildAssocs(recordCategoryNode,
ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);

View File

@@ -158,7 +158,7 @@ public class FilePlanComponentAspect extends BaseBehaviourBean
{
List<NodeRef> scriptRefs = lookupScripts(oldProps, newProps);
Map<String, Object> objectModel = new HashMap<String, Object>(1);
Map<String, Object> objectModel = new HashMap<>(1);
objectModel.put("node", nodeWithChangedProperties);
objectModel.put("oldProperties", oldProps);
objectModel.put("newProperties", newProps);
@@ -180,7 +180,7 @@ public class FilePlanComponentAspect extends BaseBehaviourBean
*/
private List<NodeRef> lookupScripts(Map<QName, Serializable> oldProps, Map<QName, Serializable> newProps)
{
List<NodeRef> result = new ArrayList<NodeRef>();
List<NodeRef> result = new ArrayList<>();
Map<QName, Serializable> changedProps = PropertyMap.getChangedProperties(oldProps, newProps);
for (QName propQName : changedProps.keySet())

View File

@@ -335,7 +335,7 @@ public class RecordAspect extends AbstractDisposableItem
NodeRef scriptNodeRef = nodeService.getChildByName(scriptsFolderNodeRef, ContentModel.ASSOC_CONTAINS, expectedScriptName);
if (scriptNodeRef != null)
{
Map<String, Object> objectModel = new HashMap<String, Object>(1);
Map<String, Object> objectModel = new HashMap<>(1);
objectModel.put("node", from);
objectModel.put("toNode", to);
objectModel.put("policy", policy);

View File

@@ -75,13 +75,13 @@ public class DispositionActionDefinitionType extends BaseBehaviourBean
if (nodeService.exists(nodeRef))
{
// Determine the properties that have changed
Set<QName> changedProps = new HashSet<QName>(PropertyMap.getChangedProperties(before, after).keySet());
Set<QName> changedProps = new HashSet<>(PropertyMap.getChangedProperties(before, after).keySet());
changedProps.addAll(PropertyMap.getAddedProperties(before, after).keySet());
if (!nodeService.hasAspect(nodeRef, ASPECT_UNPUBLISHED_UPDATE))
{
// Apply the unpublished aspect
Map<QName, Serializable> props = new HashMap<QName, Serializable>();
Map<QName, Serializable> props = new HashMap<>();
props.put(PROP_UPDATE_TO, UPDATE_TO_DISPOSITION_ACTION_DEFINITION);
props.put(PROP_UPDATED_PROPERTIES, (Serializable)changedProps);
nodeService.addAspect(nodeRef, ASPECT_UNPUBLISHED_UPDATE, props);

View File

@@ -64,7 +64,7 @@ public class RecordCategoryType extends BaseBehaviourBean
implements NodeServicePolicies.OnCreateChildAssociationPolicy,
NodeServicePolicies.OnCreateNodePolicy
{
private final static List<QName> ACCEPTED_UNIQUE_CHILD_TYPES = new ArrayList<QName>();
private final static List<QName> ACCEPTED_UNIQUE_CHILD_TYPES = new ArrayList<>();
private final static List<QName> ACCEPTED_NON_UNIQUE_CHILD_TYPES = Arrays.asList(TYPE_RECORD_CATEGORY, TYPE_RECORD_FOLDER);
/** vital record service */
@@ -226,7 +226,7 @@ public class RecordCategoryType extends BaseBehaviourBean
@Override
public boolean getMustCopy(QName classQName, CopyDetails copyDetails)
{
return nodeService.getType(copyDetails.getTargetParentNodeRef()).equals(TYPE_RECORD_FOLDER) ? false : true;
return !nodeService.getType(copyDetails.getTargetParentNodeRef()).equals(TYPE_RECORD_FOLDER);
}
};
}

View File

@@ -96,7 +96,7 @@ public class RmSiteType extends BaseBehaviourBean
private FilePlanType filePlanType;
/** Map of file plan type's key'ed by corresponding site types */
protected Map<QName, QName> mapFilePlanType = new HashMap<QName, QName>(3);
protected Map<QName, QName> mapFilePlanType = new HashMap<>(3);
/**
* Set the site service
@@ -329,7 +329,7 @@ public class RmSiteType extends BaseBehaviourBean
{
final NodeRef child = childAssocRef.getChildRef();
final NodeRef parent = childAssocRef.getParentRef();
List<QName> acceptedUniqueChildTypes = new ArrayList<QName>();
List<QName> acceptedUniqueChildTypes = new ArrayList<>();
SiteInfo siteInfo = siteService.getSite(parent);
acceptedUniqueChildTypes.add(getFilePlanType(siteInfo));
// check the created child is of an accepted type

View File

@@ -73,10 +73,10 @@ public class ModelSecurityServiceImpl extends BaseBehaviourBean
private FilePlanService filePlanService;
/** Map of protected properties keyed by name */
private Map<QName, ProtectedProperty> protectedProperties = new HashMap<QName, ProtectedProperty>(21);
private Map<QName, ProtectedProperty> protectedProperties = new HashMap<>(21);
/** Map of protected aspects keyed by name */
private Map<QName, ProtectedAspect> protectedAspects= new HashMap<QName, ProtectedAspect>(21);
private Map<QName, ProtectedAspect> protectedAspects= new HashMap<>(21);
/**
* @see org.alfresco.module.org_alfresco_module_rm.model.security.ModelSecurityService#setEnabled(boolean)

View File

@@ -88,8 +88,7 @@ public abstract class ProtectedModelArtifact
*/
public void setName(String name)
{
QName qname = QName.createQName(name, namespaceService);
this.name = qname;
this.name = QName.createQName(name, namespaceService);
}
/**
@@ -123,7 +122,7 @@ public abstract class ProtectedModelArtifact
{
if (capabilityNames == null && capabilities != null)
{
capabilityNames = new HashSet<String>(capabilities.size());
capabilityNames = new HashSet<>(capabilities.size());
for (Capability capability : capabilities)
{
capabilityNames.add(capability.getName());

View File

@@ -257,7 +257,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
notificationContext.setIgnoreNotificationFailure(true);
notificationContext.setBodyTemplate(getDueForReviewTemplate().toString());
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
Map<String, Serializable> args = new HashMap<>(1, 1.0f);
args.put("records", (Serializable) records);
args.put("site", getSiteName(root));
notificationContext.setTemplateArgs(args);
@@ -300,7 +300,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
notificationContext.setIgnoreNotificationFailure(true);
notificationContext.setBodyTemplate(supersededTemplate.toString());
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
Map<String, Serializable> args = new HashMap<>(1, 1.0f);
args.put("record", record);
args.put("site", getSiteName(root));
notificationContext.setTemplateArgs(args);
@@ -335,7 +335,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
Date rejectDate = (Date) nodeService.getProperty(record, PROP_RECORD_REJECTION_DATE);
String recordName = (String) nodeService.getProperty(record, ContentModel.PROP_NAME);
Map<String, Serializable> args = new HashMap<String, Serializable>(8);
Map<String, Serializable> args = new HashMap<>(8);
args.put("record", record);
args.put("site", site);
args.put("recordCreator", recordCreator);

View File

@@ -64,7 +64,7 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent
protected AttributeService attributeService;
/** module patches */
protected Map<String, ModulePatch> modulePatches = new HashMap<String, ModulePatch>(21);
protected Map<String, ModulePatch> modulePatches = new HashMap<>(21);
/**
* @param attributeService attribute service
@@ -119,7 +119,7 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent
if (moduleSchema > currentSchema)
{
// determine what patches should be applied
List<ModulePatch> patchesToApply = new ArrayList<ModulePatch>(13);
List<ModulePatch> patchesToApply = new ArrayList<>(13);
for (ModulePatch modulePatch : modulePatches.values())
{
if (modulePatch.getFixesFromSchema() <= currentSchema &&

View File

@@ -176,7 +176,7 @@ public class NotificationTemplatePatch extends ModulePatchComponent
nodeService.addAspect(template, ContentModel.ASPECT_VERSIONABLE, null);
// Create version (before template is updated)
Map<String, Serializable> versionProperties = new HashMap<String, Serializable>(2);
Map<String, Serializable> versionProperties = new HashMap<>(2);
versionProperties.put(Version.PROP_DESCRIPTION, "Initial version");
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MINOR);
versionService.createVersion(template, versionProperties);

View File

@@ -101,7 +101,7 @@ public class NotificationTemplatePatch_v21 extends RMv21PatchComponent
NodeRef parent = nodeService.getPrimaryParent(supersededTemplate).getParentRef();
// build the node properties
Map<QName, Serializable> props = new HashMap<QName, Serializable>(4);
Map<QName, Serializable> props = new HashMap<>(4);
props.put(ContentModel.PROP_DESCRIPTION, "Record superseded email template.");
props.put(ContentModel.PROP_TITLE, "record-rejected-email.ftl");
props.put(ContentModel.PROP_NAME, "record-rejected-email.ftl");

View File

@@ -120,7 +120,7 @@ public class RMv21BehaviorScriptsPatch extends RMv21PatchComponent implements Be
String newBehaviorScriptsNodeUUID = "rm_behavior_scripts";
String newBehaviorScriptsAssocQName = "records_management_behavior_scripts";
Map<QName, Serializable> newBehaviorScriptsFolderProps = new HashMap<QName, Serializable>();
Map<QName, Serializable> newBehaviorScriptsFolderProps = new HashMap<>();
newBehaviorScriptsFolderProps.put(ContentModel.PROP_NODE_UUID, newBehaviorScriptsNodeUUID);
newBehaviorScriptsFolderProps.put(ContentModel.PROP_NAME, newBehaviorScriptsFolderName);
newBehaviorScriptsFolderProps.put(ContentModel.PROP_TITLE, newBehaviorScriptsFolderName);

View File

@@ -186,7 +186,7 @@ public class RMv21InPlacePatch extends RMv21PatchComponent
private Set<Capability> getCapabilities(String[] capabilityNames)
{
Set<Capability> capabilities = new HashSet<Capability>(3);
Set<Capability> capabilities = new HashSet<>(3);
for (String capabilityName : capabilityNames)
{
capabilities.add(capabilityService.getCapability(capabilityName));

View File

@@ -127,7 +127,7 @@ public class RMv21ReportServicePatch extends RMv21PatchComponent
private NodeRef createNode(NodeRef parent, QName type, String id, String name, String assocName, String title, String description)
{
Map<QName, Serializable> props = new HashMap<QName, Serializable>(4);
Map<QName, Serializable> props = new HashMap<>(4);
props.put(ContentModel.PROP_DESCRIPTION, description);
props.put(ContentModel.PROP_TITLE, title);
props.put(ContentModel.PROP_NAME, name);

View File

@@ -113,6 +113,6 @@ public class RMv21RolesPatch extends RMv21PatchComponent implements BeanNameAwar
private void addAuthorityToZone(String roleGroupName)
{
authorityService.addAuthorityToZones(roleGroupName, new HashSet<String>(Arrays.asList(RMAuthority.ZONE_APP_RM)));
authorityService.addAuthorityToZones(roleGroupName, new HashSet<>(Arrays.asList(RMAuthority.ZONE_APP_RM)));
}
}

View File

@@ -121,7 +121,7 @@ public class RMv22GhostOnDestroyDispositionActionPatch extends AbstractModulePat
*/
private void processFilePlan(NodeRef filePlan)
{
Set<DispositionSchedule> dispositionSchedules = new HashSet<DispositionSchedule>();
Set<DispositionSchedule> dispositionSchedules = new HashSet<>();
getDispositionSchedules(filePlan, dispositionSchedules);
for (DispositionSchedule dispositionSchedule : dispositionSchedules)
{
@@ -178,7 +178,7 @@ public class RMv22GhostOnDestroyDispositionActionPatch extends AbstractModulePat
RecordsManagementModel.PROP_DISPOSITION_ACTION_GHOST_ON_DESTROY);
if (ghostOnDestroyValue == null)
{
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> props = new HashMap<>(1);
props.put(RecordsManagementModel.PROP_DISPOSITION_ACTION_GHOST_ON_DESTROY,
this.ghostingEnabled ? "ghost" : "destroy");
this.dispositionService.updateDispositionActionDefinition(actionDefinition, props);

View File

@@ -93,7 +93,7 @@ public class RMv22HoldReportPatch extends AbstractModulePatch
QName assocQName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, QName.createValidLocalName("report_rmr_holdReport.html.ftl"));
// build the node properties
Map<QName, Serializable> props = new HashMap<QName, Serializable>(4);
Map<QName, Serializable> props = new HashMap<>(4);
props.put(ContentModel.PROP_DESCRIPTION, "Hold report template.");
props.put(ContentModel.PROP_TITLE, "Hold Report Template");
props.put(ContentModel.PROP_NAME, "report_rmr_holdReport.html.ftl");

View File

@@ -97,7 +97,7 @@ public class RMv22ReportTemplatePatch extends AbstractModulePatch
QName assocQName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, QName.createValidLocalName("report_rmr_transferReport.html.ftl"));
// build the node properties
Map<QName, Serializable> props = new HashMap<QName, Serializable>(4);
Map<QName, Serializable> props = new HashMap<>(4);
props.put(ContentModel.PROP_DESCRIPTION, "Transfer report template.");
props.put(ContentModel.PROP_TITLE, "Transfer Report Template");
props.put(ContentModel.PROP_NAME, "report_rmr_transferReport.html.ftl");

View File

@@ -101,7 +101,7 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
if (pair != null)
{
// create query params
Map<String, Object> params = new HashMap<String, Object>(2);
Map<String, Object> params = new HashMap<>(2);
params.put("qnameId", pair.getFirst());
params.put("idValue", identifierValue);

View File

@@ -711,7 +711,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
if (recordMetaDataAspects == null)
{
// create map
recordMetaDataAspects = new HashMap<QName, Set<QName>>();
recordMetaDataAspects = new HashMap<>();
// init with legacy aspects
initRecordMetaDataMap();
@@ -765,7 +765,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
else
{
// create a new set for the file plan type
filePlanTypes = new HashSet<QName>(1);
filePlanTypes = new HashSet<>(1);
getRecordMetadataAspectsMap().put(recordMetadataAspect, filePlanTypes);
}
@@ -835,7 +835,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
@Override
public Set<QName> getRecordMetadataAspects(QName filePlanType)
{
Set<QName> result = new HashSet<QName>(getRecordMetadataAspectsMap().size());
Set<QName> result = new HashSet<>(getRecordMetadataAspectsMap().size());
for (Entry<QName, Set<QName>> entry : getRecordMetadataAspectsMap().entrySet())
{
@@ -926,7 +926,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
}
// save the information about the originating details
Map<QName, Serializable> aspectProperties = new HashMap<QName, Serializable>(3);
Map<QName, Serializable> aspectProperties = new HashMap<>(3);
aspectProperties.put(PROP_RECORD_ORIGINATING_LOCATION, parentAssoc.getParentRef());
aspectProperties.put(PROP_RECORD_ORIGINATING_USER_ID, owner);
aspectProperties.put(PROP_RECORD_ORIGINATING_CREATION_DATE, new Date());
@@ -1797,7 +1797,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
{
ParameterCheck.mandatory("recordFolder", recordFolder);
List<NodeRef> result = new ArrayList<NodeRef>(1);
List<NodeRef> result = new ArrayList<>(1);
if (recordFolderService.isRecordFolder(recordFolder))
{
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(recordFolder, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);

View File

@@ -81,7 +81,7 @@ public class RecordableVersionConfigServiceImpl implements RecordableVersionConf
mandatory("nodeRef", nodeRef);
RecordableVersionPolicy[] recordableVersionPolicies = RecordableVersionPolicy.values();
List<Version> versions = new ArrayList<Version>(recordableVersionPolicies.length);
List<Version> versions = new ArrayList<>(recordableVersionPolicies.length);
for (RecordableVersionPolicy recordableVersionPolicy : recordableVersionPolicies)
{

View File

@@ -220,7 +220,7 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_RECORD_FOLDER_TYPE, type.toString()));
}
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
Map<QName, Serializable> props = new HashMap<>(1);
if (properties != null && properties.size() != 0)
{
props.putAll(properties);
@@ -270,7 +270,7 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
{
ParameterCheck.mandatory("record", record);
List<NodeRef> result = new ArrayList<NodeRef>(1);
List<NodeRef> result = new ArrayList<>(1);
if (recordService.isRecord(record))
{
List<ChildAssociationRef> assocs = nodeService.getParentAssocs(record, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);

View File

@@ -39,5 +39,5 @@ import org.alfresco.api.AlfrescoPublicApi;
public enum RelationshipType
{
BIDIRECTIONAL,
PARENTCHILD;
PARENTCHILD
}

View File

@@ -52,7 +52,7 @@ public class ReportServiceImpl extends ServiceBaseImpl
protected RecordService recordService;
/** report generator registry */
private Map<QName, ReportGenerator> registry = new HashMap<QName, ReportGenerator>();
private Map<QName, ReportGenerator> registry = new HashMap<>();
/**
* @param recordService record service

View File

@@ -251,7 +251,7 @@ public class DeclarativeReportGenerator extends BaseReportGenerator
*/
protected Map<String, Serializable> createTemplateModel(NodeRef templateNodeRef, NodeRef reportedUponNodeRef, Map<String, Serializable> properties)
{
Map<String, Serializable> model = new HashMap<String, Serializable>();
Map<String, Serializable> model = new HashMap<>();
// build the default model
NodeRef person = repository.getPerson();

View File

@@ -49,7 +49,7 @@ import org.springframework.extensions.surf.util.ParameterCheck;
private String reportName;
private Map<QName, Serializable> reportProperties = new HashMap<QName, Serializable>(21);
private Map<QName, Serializable> reportProperties = new HashMap<>(21);
/** content reader */
private ContentReader reportContent;

View File

@@ -78,7 +78,7 @@ public class TransferReportGenerator extends DeclarativeReportGenerator
String dispositionAuthority = getDispositionAuthority(transferNodes);
// Save to the properties map
Map<String, Serializable> properties = new HashMap<String, Serializable>(2);
Map<String, Serializable> properties = new HashMap<>(2);
properties.put("transferNodes", (ArrayList<TransferNode>) transferNodes);
properties.put("dispositionAuthority", dispositionAuthority);
@@ -94,7 +94,7 @@ public class TransferReportGenerator extends DeclarativeReportGenerator
private List<TransferNode> getTransferNodes(NodeRef nodeRef)
{
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(nodeRef, RecordsManagementModel.ASSOC_TRANSFERRED, RegexQNamePattern.MATCH_ALL);
List<TransferNode> transferNodes = new ArrayList<TransferNode>(assocs.size());
List<TransferNode> transferNodes = new ArrayList<>(assocs.size());
for (ChildAssociationRef assoc : assocs)
{
NodeRef childRef = assoc.getChildRef();
@@ -112,7 +112,7 @@ public class TransferReportGenerator extends DeclarativeReportGenerator
*/
private Map<String, Serializable> getTransferNodeProperties(NodeRef childRef)
{
Map<String, Serializable> transferNodeProperties = new HashMap<String, Serializable>(6);
Map<String, Serializable> transferNodeProperties = new HashMap<>(6);
boolean isFolder = dictionaryService.isSubClass(nodeService.getType(childRef), ContentModel.TYPE_FOLDER);
transferNodeProperties.put("isFolder", isFolder);
@@ -139,7 +139,7 @@ public class TransferReportGenerator extends DeclarativeReportGenerator
*/
private List<TransferNode> getRecords(NodeRef childRef)
{
List<TransferNode> records = new ArrayList<TransferNode>(4);
List<TransferNode> records = new ArrayList<>(4);
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(childRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef child : assocs)
{
@@ -162,7 +162,7 @@ public class TransferReportGenerator extends DeclarativeReportGenerator
*/
private Map<String, Serializable> getCommonProperties(NodeRef nodeRef)
{
Map<String, Serializable> transferNodeProperties = new HashMap<String, Serializable>(3);
Map<String, Serializable> transferNodeProperties = new HashMap<>(3);
Map<QName, Serializable> properties = nodeService.getProperties(nodeRef);
String name = (String) properties.get(ContentModel.PROP_NAME);
@@ -182,7 +182,7 @@ public class TransferReportGenerator extends DeclarativeReportGenerator
*/
private Map<String, Serializable> getFolderProperties(NodeRef folder)
{
Map<String, Serializable> transferNodeProperties = new HashMap<String, Serializable>(3);
Map<String, Serializable> transferNodeProperties = new HashMap<>(3);
Map<String, Serializable> commonProperties = getCommonProperties(folder);
ArrayList<TransferNode> records = (ArrayList<TransferNode>) getRecords(folder);
@@ -200,7 +200,7 @@ public class TransferReportGenerator extends DeclarativeReportGenerator
*/
private Map<String, Serializable> getRecordProperties(NodeRef record)
{
Map<String, Serializable> transferNodeProperties = new HashMap<String, Serializable>(5);
Map<String, Serializable> transferNodeProperties = new HashMap<>(5);
Map<QName, Serializable> properties = nodeService.getProperties(record);
String declaredBy = (String) properties.get(RecordsManagementModel.PROP_DECLARED_BY);

View File

@@ -176,7 +176,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
{
public List<NodeRef> doWork()
{
List<NodeRef> systemContainers = new ArrayList<NodeRef>(3);
List<NodeRef> systemContainers = new ArrayList<>(3);
//In a multi tenant store we need to initialize the rm config if it has been done yet
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, CONFIG_NODEID);
@@ -190,7 +190,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
AuthorityType.GROUP,
getAllRolesGroupShortName(filePlan),
I18NUtil.getMessage(MSG_ALL_ROLES),
new HashSet<String>(Arrays.asList(RMAuthority.ZONE_APP_RM)));
new HashSet<>(Arrays.asList(RMAuthority.ZONE_APP_RM)));
// Set the permissions
permissionService.setInheritParentPermissions(filePlan, false);
@@ -314,7 +314,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
}
// Get the roles capabilities
Set<Capability> capabilities = new HashSet<Capability>(30);
Set<Capability> capabilities = new HashSet<>(30);
if (object.has(JSON_CAPABILITIES))
{
JSONArray arrCaps = object.getJSONArray(JSON_CAPABILITIES);
@@ -408,7 +408,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
{
public Set<Role> doWork()
{
Set<Role> result = new HashSet<Role>(13);
Set<Role> result = new HashSet<>(13);
Set<String> roleAuthorities = authorityService.getAllAuthoritiesInZone(getZoneName(rmRootNode), AuthorityType.GROUP);
for (String roleAuthority : roleAuthorities)
@@ -453,7 +453,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
{
public Set<Role> doWork()
{
Set<Role> result = new HashSet<Role>(13);
Set<Role> result = new HashSet<>(13);
Set<String> roleAuthorities = authorityService.getAllAuthoritiesInZone(getZoneName(rmRootNode), AuthorityType.GROUP);
for (String roleAuthority : roleAuthorities)
@@ -550,7 +550,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
private Set<Capability> getCapabilitiesImpl(NodeRef rmRootNode, String roleAuthority)
{
Set<AccessPermission> permissions = permissionService.getAllSetPermissions(rmRootNode);
Set<Capability> capabilities = new HashSet<Capability>(52);
Set<Capability> capabilities = new HashSet<>(52);
for (AccessPermission permission : permissions)
{
if (permission.getAuthority().equals(roleAuthority))
@@ -628,7 +628,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
}
// Create a group that relates to the records management role
Set<String> zones = new HashSet<String>(2);
Set<String> zones = new HashSet<>(2);
zones.add(getZoneName(filePlan));
zones.add(RMAuthority.ZONE_APP_RM);
@@ -791,7 +791,7 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
ParameterCheck.mandatory("filePlan", filePlan);
ParameterCheck.mandatory("roleName", role);
Set<String> result = new HashSet<String>(21);
Set<String> result = new HashSet<>(21);
result.addAll(getUsersAssignedToRole(filePlan, role));
result.addAll(getGroupsAssignedToRole(filePlan, role));
return result;

View File

@@ -132,7 +132,7 @@ public class ApplyDodCertModelFixesGet extends DeclarativeWebScript
//MOB-1621. Custom fields should be created as untokenized by default.
LOGGER.info("MOB-1621. Custom fields should be created as untokenized by default.");
List<String> allCustomPropertiesAspects = new ArrayList<String>(4);
List<String> allCustomPropertiesAspects = new ArrayList<>(4);
allCustomPropertiesAspects.add(RMC_CUSTOM_RECORD_SERIES_PROPERTIES);
allCustomPropertiesAspects.add(RMC_CUSTOM_RECORD_CATEGORY_PROPERTIES);
allCustomPropertiesAspects.add(RMC_CUSTOM_RECORD_FOLDER_PROPERTIES);
@@ -155,7 +155,7 @@ public class ApplyDodCertModelFixesGet extends DeclarativeWebScript
LOGGER.info("Completed application of webscript-based patches to RM custom model in the repo.");
Map<String, Object> model = new HashMap<String, Object>(1, 1.0f);
Map<String, Object> model = new HashMap<>(1, 1.0f);
model.put("success", true);
return model;

View File

@@ -106,7 +106,7 @@ public class ApplyFixMob1573Get extends DeclarativeWebScript
writeCustomContentModel(customModel);
Map<String, Object> model = new HashMap<String, Object>(1, 1.0f);
Map<String, Object> model = new HashMap<>(1, 1.0f);
model.put("success", true);
return model;

View File

@@ -51,7 +51,7 @@ public class AuditLogDelete extends BaseAuditAdminWebScript
this.rmAuditService.clearAuditLog(getDefaultFilePlan());
// create model object with the audit status model
Map<String, Object> model = new HashMap<String, Object>(1);
Map<String, Object> model = new HashMap<>(1);
model.put("auditstatus", createAuditStatusModel());
return model;
}

View File

@@ -138,7 +138,7 @@ public class AuditLogGet extends BaseAuditRetrievalWebScript
boolean attach = false;
String attachFileName = null;
String export = req.getParameter(PARAM_EXPORT);
if (export != null && Boolean.parseBoolean(export))
if (Boolean.parseBoolean(export))
{
attach = true;
attachFileName = auditTrail.getName();

View File

@@ -78,7 +78,7 @@ public class AuditLogPut extends BaseAuditAdminWebScript
}
// create model object with the audit status model
Map<String, Object> model = new HashMap<String, Object>(1);
Map<String, Object> model = new HashMap<>(1);
model.put("auditstatus", createAuditStatusModel());
return model;
}

View File

@@ -76,7 +76,7 @@ public class AuditLogStatusGet extends DeclarativeWebScript
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
Map<String, Object> model = new HashMap<String, Object>(1);
Map<String, Object> model = new HashMap<>(1);
model.put("enabled", Boolean.valueOf(rmAuditService.isAuditLogEnabled(getDefaultFilePlan())));
return model;
}

View File

@@ -75,7 +75,7 @@ public class BaseAuditAdminWebScript extends DeclarativeWebScript
*/
protected Map<String, Object> createAuditStatusModel()
{
Map<String, Object> auditStatus = new HashMap<String, Object>(3);
Map<String, Object> auditStatus = new HashMap<>(3);
auditStatus.put("started", ISO8601DateFormat.format(rmAuditService.getDateAuditLogLastStarted(getDefaultFilePlan())));
auditStatus.put("stopped", ISO8601DateFormat.format(rmAuditService.getDateAuditLogLastStopped(getDefaultFilePlan())));

View File

@@ -83,7 +83,7 @@ public abstract class BaseTransferWebScript extends StreamACP
// construct model for template
Status status = new Status();
Cache cache = new Cache(getDescription().getRequiredCache());
Map<String, Object> model = new HashMap<String, Object>();
Map<String, Object> model = new HashMap<>();
model.put("status", status);
model.put("cache", cache);

View File

@@ -219,7 +219,7 @@ public class BootstrapTestDataGet extends DeclarativeWebScript
recordsManagementSearchBehaviour,
dispositionService, recordFolderService);
Map<String, Object> model = new HashMap<String, Object>(1, 1.0f);
Map<String, Object> model = new HashMap<>(1, 1.0f);
model.put("success", true);
return model;
@@ -269,7 +269,7 @@ public class BootstrapTestDataGet extends DeclarativeWebScript
String allRoles = authorityService.createAuthority(AuthorityType.GROUP,
allRoleShortName,
RMAuthority.ALL_ROLES_DISPLAY_NAME,
new HashSet<String>(Arrays.asList(RMAuthority.ZONE_APP_RM)));
new HashSet<>(Arrays.asList(RMAuthority.ZONE_APP_RM)));
// Put all the role groups in it
Set<Role> roles = recordsManagementSecurityService.getRoles(rmRoot);

View File

@@ -111,7 +111,7 @@ public class CustomPropertyDefinitionDelete extends AbstractRmWebScript
*/
protected Map<String, Object> removePropertyDefinition(QName propQName) throws JSONException
{
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> result = new HashMap<>();
rmAdminService.removeCustomPropertyDefinition(propQName);

View File

@@ -91,7 +91,7 @@ public class CustomPropertyDefinitionPost extends BaseCustomPropertyWebScript
catch (CustomMetadataException e)
{
status.setCode(Status.STATUS_BAD_REQUEST);
ftlModel = new HashMap<String, Object>();
ftlModel = new HashMap<>();
ftlModel.put(MESSAGE, e.getMessage());
}
}
@@ -115,7 +115,7 @@ public class CustomPropertyDefinitionPost extends BaseCustomPropertyWebScript
protected Map<String, Object> createPropertyDefinition(WebScriptRequest req, JSONObject json)
throws JSONException, CustomMetadataException
{
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> result = new HashMap<>();
Map<String, Serializable> params = getParamsFromUrlAndJson(req, json);
QName propertyQName = createNewPropertyDefinition(params);
@@ -134,7 +134,7 @@ public class CustomPropertyDefinitionPost extends BaseCustomPropertyWebScript
throws JSONException
{
Map<String, Serializable> params;
params = new HashMap<String, Serializable>();
params = new HashMap<>();
params.put(PARAM_ELEMENT, req.getParameter(PARAM_ELEMENT));
for (Iterator iter = json.keys(); iter.hasNext(); )

View File

@@ -84,7 +84,7 @@ public class CustomPropertyDefinitionPut extends BaseCustomPropertyWebScript
catch (CustomMetadataException e)
{
status.setCode(Status.STATUS_BAD_REQUEST);
ftlModel = new HashMap<String, Object>();
ftlModel = new HashMap<>();
ftlModel.put(MESSAGE, e.getMessage());
}
}
@@ -109,7 +109,7 @@ public class CustomPropertyDefinitionPut extends BaseCustomPropertyWebScript
protected Map<String, Object> handlePropertyDefinitionUpdate(WebScriptRequest req, JSONObject json)
throws JSONException, CustomMetadataException
{
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> result = new HashMap<>();
Map<String, Serializable> params = getParamsFromUrlAndJson(req, json);
@@ -161,7 +161,7 @@ public class CustomPropertyDefinitionPut extends BaseCustomPropertyWebScript
if (constraintRef == null)
{
result = rmAdminService.removeCustomPropertyDefinitionConstraints(propQName);
updated = constraints.isEmpty() ? false : true;
updated = !constraints.isEmpty();
}
else
{
@@ -209,7 +209,7 @@ public class CustomPropertyDefinitionPut extends BaseCustomPropertyWebScript
throws JSONException
{
Map<String, Serializable> params;
params = new HashMap<String, Serializable>();
params = new HashMap<>();
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
String propId = templateVars.get(PROP_ID);

View File

@@ -73,7 +73,7 @@ public class CustomPropertyDefinitionsGet extends BaseCustomPropertyWebScript
@Override
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
Map<String, Object> model = new HashMap<String, Object>();
Map<String, Object> model = new HashMap<>();
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
String propId = templateVars.get(PROP_ID);
@@ -90,7 +90,7 @@ public class CustomPropertyDefinitionsGet extends BaseCustomPropertyWebScript
// If propId has been provided then this is a request for a single custom-property-defn.
// else it is a request for all defined on the specified element.
List<PropertyDefinition> propData = new ArrayList<PropertyDefinition>();
List<PropertyDefinition> propData = new ArrayList<>();
if (propId != null)
{
QName propQName = rmAdminService.getQNameForClientId(propId);

View File

@@ -108,7 +108,7 @@ public class CustomRefDelete extends AbstractRmWebScript
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
Map<String, Object> model = new HashMap<String, Object>(1);
Map<String, Object> model = new HashMap<>(1);
try
{
getRuleService().disableRuleType(RuleType.OUTBOUND);

View File

@@ -109,7 +109,7 @@ public class CustomRefPost extends AbstractRmWebScript
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
Map<String, Object> model = new HashMap<String, Object>(1);
Map<String, Object> model = new HashMap<>(1);
try
{
getRuleService().disableRuleType(RuleType.INBOUND);

View File

@@ -60,7 +60,7 @@ public class CustomReferenceDefinitionPost extends CustomReferenceDefinitionBase
RelationshipDisplayName displayName = createDisplayName(requestContent);
RelationshipDefinition relationshipDefinition = getRelationshipService().createRelationshipDefinition(displayName);
Map<String, Object> model = new HashMap<String, Object>();
Map<String, Object> model = new HashMap<>();
String servicePath = req.getServicePath();
Map<String, Object> customRelationshipData = createRelationshipDefinitionData(relationshipDefinition, servicePath);
model.putAll(customRelationshipData);
@@ -77,7 +77,7 @@ public class CustomReferenceDefinitionPost extends CustomReferenceDefinitionBase
*/
private Map<String, Object> createRelationshipDefinitionData(RelationshipDefinition relationshipDefinition, String servicePath)
{
Map<String, Object> relationshipDefinitionData = new HashMap<String, Object>(4);
Map<String, Object> relationshipDefinitionData = new HashMap<>(4);
String uniqueName = relationshipDefinition.getUniqueName();
relationshipDefinitionData.put(REFERENCE_TYPE, relationshipDefinition.getType().toString());
relationshipDefinitionData.put(REF_ID, uniqueName);

Some files were not shown because too many files have changed in this diff Show More