diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java
index 20acd4cf57..7438ee5ed6 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java
@@ -89,7 +89,7 @@ public abstract class BaseAPI
private AlfrescoHttpClientFactory alfrescoHttpClientFactory;
@Autowired
- private ContentService contentService;
+ protected ContentService contentService;
public static final String NODE_REF_WORKSPACE_SPACES_STORE = "workspace://SpacesStore/";
private static final String FILE_PLAN_PATH = "/Sites/rm/documentLibrary";
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java
index 3fe9ab67e6..5ca4b9c1ab 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java
@@ -44,7 +44,6 @@ import java.util.Set;
import org.alfresco.dataprep.AlfrescoHttpClient;
import org.alfresco.dataprep.AlfrescoHttpClientFactory;
-import org.alfresco.dataprep.ContentService;
import org.alfresco.dataprep.UserService;
import org.alfresco.rest.core.v0.BaseAPI;
import org.alfresco.rest.core.v0.RMEvents;
@@ -97,9 +96,6 @@ public class RMRolesAndActionsAPI extends BaseAPI
@Autowired
private UserService userService;
- @Autowired
- private ContentService contentService;
-
/**
* Get all the configured RM roles.
*
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RecordFoldersAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RecordFoldersAPI.java
index 82a50deb94..cae9768e39 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RecordFoldersAPI.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RecordFoldersAPI.java
@@ -28,14 +28,12 @@ package org.alfresco.rest.v0;
import static org.apache.http.HttpStatus.SC_OK;
-import org.alfresco.dataprep.ContentService;
import org.alfresco.rest.core.v0.BaseAPI;
import org.apache.http.HttpResponse;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
@@ -49,9 +47,6 @@ public class RecordFoldersAPI extends BaseAPI
{
private static final Logger LOGGER = LoggerFactory.getLogger(RecordFoldersAPI.class);
- @Autowired
- private ContentService contentService;
-
/**
* Close the record folder
*
diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RecordsAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RecordsAPI.java
index ac2fe6933f..0598a95d06 100644
--- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RecordsAPI.java
+++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RecordsAPI.java
@@ -33,7 +33,6 @@ import java.text.MessageFormat;
import java.util.Map;
import org.alfresco.dataprep.CMISUtil.DocumentType;
-import org.alfresco.dataprep.ContentService;
import org.alfresco.rest.core.v0.BaseAPI;
import org.apache.chemistry.opencmis.client.api.CmisObject;
import org.apache.commons.lang3.tuple.Pair;
@@ -42,7 +41,6 @@ import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
@@ -59,9 +57,6 @@ public class RecordsAPI extends BaseAPI
private static final String CREATE_NON_ELECTRONIC_RECORD_API = "{0}type/rma:nonElectronicDocument/formprocessor";
- @Autowired
- private ContentService contentService;
-
/**
* Declare documents as records
*
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java
index de56972ccd..48ec3e4cb6 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java
@@ -675,6 +675,8 @@ public class BaseRMRestTest extends RestTest
this.wait(waitInMilliSeconds);
} catch (InterruptedException e)
{
+ // Restore interrupted state...
+ Thread.currentThread().interrupt();
}
}
@@ -726,6 +728,8 @@ public class BaseRMRestTest extends RestTest
}
catch (InterruptedException e)
{
+ // Restore interrupted state...
+ Thread.currentThread().interrupt();
}
}
@@ -775,6 +779,8 @@ public class BaseRMRestTest extends RestTest
}
catch (InterruptedException e)
{
+ // Restore interrupted state...
+ Thread.currentThread().interrupt();
}
}
result = searchApi.searchForNodePropertyAsUser(user.getUsername(), user.getPassword(), nodeRef,
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareDocumentAsRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareDocumentAsRecordTests.java
index 077703bca5..bfcbf1a635 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareDocumentAsRecordTests.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/files/DeclareDocumentAsRecordTests.java
@@ -156,8 +156,8 @@ public class DeclareDocumentAsRecordTests extends BaseRMRestTest
try
(
InputStream recordInputStream = getRestAPIFactory().getRecordsAPI().getRecordContent(record.getId()).asInputStream();
- InputStream documentInputStream = documentPostFiling.getContentStream().getStream();
- )
+ InputStream documentInputStream = documentPostFiling.getContentStream().getStream()
+ )
{
assertEquals(DigestUtils.sha1(recordInputStream), DigestUtils.sha1(documentInputStream));
}
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordcategories/RecordCategoryTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordcategories/RecordCategoryTests.java
index 9cd8b476b6..8580839556 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordcategories/RecordCategoryTests.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/recordcategories/RecordCategoryTests.java
@@ -775,7 +775,6 @@ public class RecordCategoryTests extends BaseRMRestTest
{
//is unfiled container
containerId = getRestAPIFactory().getUnfiledContainersAPI().getUnfiledContainer(containerAlias).getId();
- ;
}
// Create a record folder
diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/ReadRecordTests.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/ReadRecordTests.java
index 06b513ccac..e2c48d8695 100644
--- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/ReadRecordTests.java
+++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/records/ReadRecordTests.java
@@ -269,7 +269,7 @@ public class ReadRecordTests extends BaseRMRestTest
try
(
InputStream recordContentStream = recordsAPI.getRecordContent(binaryRecordId).asInputStream();
- FileInputStream localFileStream = new FileInputStream(getFile(IMAGE_FILE));
+ FileInputStream localFileStream = new FileInputStream(getFile(IMAGE_FILE))
)
{
assertEquals(DigestUtils.sha1(recordContentStream), DigestUtils.sha1(localFileStream));
diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-condition-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-condition-context.xml
index 7cfa9ae906..d008a44c01 100644
--- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-condition-context.xml
+++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-condition-context.xml
@@ -85,14 +85,12 @@
-
-
@@ -110,7 +108,6 @@
-
-
-
@@ -197,7 +192,6 @@
-
-
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/RecordsManagementServiceImpl.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/RecordsManagementServiceImpl.java
index 20c8d60a2f..6c6a8f0937 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/RecordsManagementServiceImpl.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/RecordsManagementServiceImpl.java
@@ -248,7 +248,7 @@ public class RecordsManagementServiceImpl extends ServiceBaseImpl
@Override
public List getFilePlans()
{
- return new ArrayList(getFilePlanService().getFilePlans());
+ return new ArrayList<>(getFilePlanService().getFilePlans());
}
/**
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/PivotUtil.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/PivotUtil.java
index cb68247654..b15a5e1fc5 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/PivotUtil.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/PivotUtil.java
@@ -42,7 +42,7 @@ import java.util.Map;
static Map> getPivot(Map> source)
{
- Map> pivot = new HashMap>();
+ Map> pivot = new HashMap<>();
for (Map.Entry> entry : source.entrySet())
{
@@ -59,7 +59,7 @@ import java.util.Map;
else
{
// New value
- List list = new ArrayList();
+ List list = new ArrayList<>();
list.add(authority);
pivot.put(value, list);
}
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigComponentImpl.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigComponentImpl.java
index 536a619db8..079e5944a9 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigComponentImpl.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigComponentImpl.java
@@ -106,11 +106,11 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
// Default
private StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
- private List caveatAspectURINames = new ArrayList(0);
- private List caveatAspectQNames = new ArrayList(0);
+ private List caveatAspectURINames = new ArrayList<>(0);
+ private List caveatAspectQNames = new ArrayList<>(0);
- private List caveatModelURINames = new ArrayList(0);
- private List caveatModelQNames = new ArrayList(0);
+ private List caveatModelURINames = new ArrayList<>(0);
+ private List 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 models = new HashSet(1);
- Set props = new HashSet(10);
- Set expectedPrefixes = new HashSet(10);
+ Set models = new HashSet<>(1);
+ Set props = new HashSet<>(10);
+ Set 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 getRMAllowedValues(String constraintName)
{
- List allowedValues = new ArrayList(0);
+ List 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 getRMAllowedValues(String userName, Set userGroupFullNames, String constraintName)
{
- SetallowedValues = new HashSet();
+ SetallowedValues = new HashSet<>();
// note: userName and userGroupNames must not be null
Map> caveatConstraintDef = null;
@@ -602,7 +602,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
}
}
- Listret = new ArrayList();
+ Listret = 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(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> constraint = new HashMap>(0);
- constraint.put(authorityName, new ArrayList(values));
+ Map> constraint = new HashMap<>(0);
+ constraint.put(authorityName, new ArrayList<>(values));
members = constraint;
}
else
{
- members.put(authorityName, new ArrayList(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> emptyConstraint = new HashMap>(0);
+ Map> emptyConstraint = new HashMap<>(0);
caveatConfig.put(listName, emptyConstraint);
members = emptyConstraint;
@@ -918,7 +918,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
List vals = members.get(authority);
if(vals == null)
{
- vals= new ArrayList();
+ 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> members = config.get(listName);
-
- Set authorityNames = members.keySet();
JSONObject listMembers = new JSONObject();
- for (String authorityName : authorityNames)
+ for (Map.Entry> member : members.entrySet())
{
- List authorities = members.get(authorityName);
+ final String authorityName = member.getKey();
+ final List authorities = member.getValue();
try
{
listMembers.put(authorityName, authorities);
@@ -1134,7 +1133,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
try
{
writeLock.lock();
- Map> emptyConstraint = new HashMap>(0);
+ Map> emptyConstraint = new HashMap<>(0);
caveatConfig.put(listName, emptyConstraint);
updateOrCreateCaveatConfig(convertToJSONString(caveatConfig));
}
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigServiceImpl.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigServiceImpl.java
index a42e3cf013..baa7227fa2 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigServiceImpl.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigServiceImpl.java
@@ -150,7 +150,7 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
listName = sb.toString();
}
- ListallowedValues = new ArrayList();
+ ListallowedValues = new ArrayList<>();
for(String value : values)
{
allowedValues.add(value);
@@ -262,9 +262,9 @@ public class RMCaveatConfigServiceImpl implements RMCaveatConfigService
*/
public Set getAllRMConstraints()
{
- Set info = new HashSet();
+ Set info = new HashSet<>();
- List defs = new ArrayList(10);
+ List 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)
{
- ListallowedValueList = new ArrayList();
+ ListallowedValueList = new ArrayList<>();
for(String value : allowedValues)
{
allowedValueList.add(value);
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMListOfValuesConstraint.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMListOfValuesConstraint.java
index e0de5e8dff..a3e03633d8 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMListOfValuesConstraint.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMListOfValuesConstraint.java
@@ -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 allowedForUser = caveatConfigService.getRMAllowedValues(getShortName());
- List filteredList = new ArrayList(allowedForUser.size());
+ List 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 allowedForUser = caveatConfigService.getRMAllowedValues(getType());
- List filteredList = new ArrayList(allowedForUser.size());
+ List 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(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 getParameters()
{
- Map params = new HashMap(2);
+ Map params = new HashMap<>(2);
params.put("caseSensitive", isCaseSensitive());
params.put("allowedValues", getAllowedValues());
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptConstraint.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptConstraint.java
index a17f38dc92..3e815afe1e 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptConstraint.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptConstraint.java
@@ -97,21 +97,15 @@ public class ScriptConstraint implements Serializable
return new ScriptConstraintAuthority[0];
}
- // Here with some data to return
- Set authorities = values.keySet();
-
- ArrayList constraints = new ArrayList(values.size());
- for(String authority : authorities)
+ ArrayList constraints = new ArrayList<>(values.size());
+ for (Map.Entry> 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 aList = new ArrayList();
+ List aList = new ArrayList<>();
for(int j = 0; j < authorities.length();j++)
{
aList.add(authorities.getString(j));
@@ -170,7 +164,7 @@ public class ScriptConstraint implements Serializable
*/
public void deleteAuthority(String authority)
{
-
+ //Do nothing
}
/**
@@ -179,7 +173,7 @@ public class ScriptConstraint implements Serializable
*/
public void deleteValue(String value)
{
-
+ //Do nothing
}
@@ -209,24 +203,21 @@ public class ScriptConstraint implements Serializable
if (details == null)
{
- details = new HashMap>();
+ details = new HashMap<>();
}
// values, authorities
Map> pivot = PivotUtil.getPivot(details);
- // Here with some data to return
- Set values = pivot.keySet();
-
- ArrayList constraints = new ArrayList(pivot.size());
- for(String value : values)
+ ArrayList constraints = new ArrayList<>(pivot.size());
+ for (Map.Entry> entry : pivot.entrySet())
{
ScriptConstraintValue constraint = new ScriptConstraintValue();
- constraint.setValueName(value);
- constraint.setValueTitle(value);
+ constraint.setValueName(entry.getKey());
+ constraint.setValueTitle(entry.getKey());
- Listauthorities = pivot.get(value);
- List sauth = new ArrayList();
+ List authorities = entry.getValue();
+ List 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 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 sauth = new ArrayList();
+ List sauth = new ArrayList<>();
constraint.setAuthorities(sauth);
constraints.add(constraint);
}
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptRMCaveatConfigService.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptRMCaveatConfigService.java
index 2544e04f6e..d126209409 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptRMCaveatConfigService.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptRMCaveatConfigService.java
@@ -93,7 +93,7 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
{
Set values = caveatConfigService.getAllRMConstraints();
- List vals = new ArrayList(values.size());
+ List 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 vals = new ArrayList();
+ List vals = new ArrayList<>();
caveatConfigService.updateRMConstraintListAuthority(listName, authorityName, vals);
}
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/ExtendedSecurityBaseDynamicAuthority.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/ExtendedSecurityBaseDynamicAuthority.java
index 36806134f7..1c60ae5d01 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/ExtendedSecurityBaseDynamicAuthority.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/ExtendedSecurityBaseDynamicAuthority.java
@@ -154,7 +154,7 @@ public abstract class ExtendedSecurityBaseDynamicAuthority implements DynamicAut
boolean result = false;
Map, Boolean> transactionCache = TransactionalResourceHelper.getMap(getTransactionCacheName());
- Pair key = new Pair(nodeRef, userName);
+ Pair key = new Pair<>(nodeRef, userName);
if (transactionCache.containsKey(key))
{
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/ExtendedWriterDynamicAuthority.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/ExtendedWriterDynamicAuthority.java
index 834d6f52d8..2ffed36d1b 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/ExtendedWriterDynamicAuthority.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/ExtendedWriterDynamicAuthority.java
@@ -65,7 +65,7 @@ public class ExtendedWriterDynamicAuthority extends ExtendedSecurityBaseDynamicA
{
if (requiredFor == null)
{
- requiredFor = new HashSet(3);
+ requiredFor = new HashSet<>(3);
Collections.addAll(requiredFor,
getModelDAO().getPermissionReference(null, RMPermissionModel.READ_RECORDS),
getModelDAO().getPermissionReference(null, RMPermissionModel.FILING),
diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/Role.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/Role.java
index 792c997805..3d42518c60 100644
--- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/Role.java
+++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/security/Role.java
@@ -54,7 +54,7 @@ public class Role extends org.alfresco.module.org_alfresco_module_rm.role.Role
*/
public static Set toRoleSet(Set roles)
{
- Set result = new HashSet(roles.size());
+ Set result = new HashSet<>(roles.size());
for (org.alfresco.module.org_alfresco_module_rm.role.Role role : roles)
{
result.add(Role.toRole(role));
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RMActionExecuterAbstractBase.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RMActionExecuterAbstractBase.java
index 135501c1d0..95d5a24161 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RMActionExecuterAbstractBase.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RMActionExecuterAbstractBase.java
@@ -133,7 +133,7 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
private IdentifierService identifierService;
/** List of kinds for which this action is applicable */
- protected Set applicableKinds = new HashSet();
+ protected Set applicableKinds = new HashSet<>();
/**
* Get the transaction service
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionCondition.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionCondition.java
index e671096fc9..81755f456e 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionCondition.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionCondition.java
@@ -43,7 +43,7 @@ public interface RecordsManagementActionCondition
*
* @return String action condition name
*/
- String getName();
+ String getBeanName();
/**
* Get the label of the action condition
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionConditionEvaluatorAbstractBase.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionConditionEvaluatorAbstractBase.java
index ab3c4ada31..30e4f4c0b3 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionConditionEvaluatorAbstractBase.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionConditionEvaluatorAbstractBase.java
@@ -56,7 +56,7 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
private FilePlanService filePlanService;
/** bean name */
- private String name;
+ private String beanName;
/** public condition */
private boolean publicCondition = true;
@@ -145,16 +145,16 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
@Override
public void setBeanName(String name)
{
- this.name = name;
+ this.beanName = name;
super.setBeanName(name);
}
/**
- * @see org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionCondition#getName()
+ * @see org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementActionCondition#getBeanName()
*/
- public String getName()
+ public String getBeanName()
{
- return this.name;
+ return this.beanName;
}
/**
@@ -184,11 +184,11 @@ public abstract class RecordsManagementActionConditionEvaluatorAbstractBase exte
{
if (this.actionConditionDefinition == null)
{
- this.actionConditionDefinition = new RecordsManagementActionConditionDefinitionImpl(name);
+ this.actionConditionDefinition = new RecordsManagementActionConditionDefinitionImpl(beanName);
((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setTitleKey(getTitleKey());
((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setDescriptionKey(getDescriptionKey());
((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setAdhocPropertiesAllowed(getAdhocPropertiesAllowed());
- ((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setConditionEvaluator(name);
+ ((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setConditionEvaluator(beanName);
((RecordsManagementActionConditionDefinitionImpl)actionConditionDefinition).setLocalizedParameterDefinitions(getLocalizedParameterDefinitions());
}
return this.actionConditionDefinition;
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionServiceImpl.java
index b86ea5e3b9..e6262e0787 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionServiceImpl.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/RecordsManagementActionServiceImpl.java
@@ -63,10 +63,10 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
private static Log logger = LogFactory.getLog(RecordsManagementActionServiceImpl.class);
/** Registered records management actions */
- private Map rmActions = new HashMap(13);
- private Map rmConditions = new HashMap(13);
+ private Map rmActions = new HashMap<>(13);
+ private Map rmConditions = new HashMap<>(13);
- private Map dispositionActions = new HashMap(5);
+ private Map dispositionActions = new HashMap<>(5);
/** Policy component */
private PolicyComponent policyComponent;
@@ -142,9 +142,9 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
public void register(RecordsManagementActionCondition rmCondition)
{
- if (!rmConditions.containsKey(rmCondition.getName()))
+ if (!rmConditions.containsKey(rmCondition.getBeanName()))
{
- rmConditions.put(rmCondition.getName(), rmCondition);
+ rmConditions.put(rmCondition.getBeanName(), rmCondition);
}
}
@@ -185,7 +185,7 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
*/
public List getRecordsManagementActions()
{
- List result = new ArrayList(this.rmActions.size());
+ List 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 getRecordsManagementActionConditions()
{
- List result = new ArrayList(rmConditions.size());
+ List 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 getDispositionActions(NodeRef nodeRef)
{
- List result = new ArrayList(this.rmActions.size());
+ List result = new ArrayList<>(this.rmActions.size());
for (RecordsManagementAction action : this.rmActions.values())
{
@@ -225,7 +225,7 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
*/
public List getDispositionActions()
{
- List result = new ArrayList(dispositionActions.size());
+ List result = new ArrayList<>(dispositionActions.size());
result.addAll(dispositionActions.values());
return Collections.unmodifiableList(result);
}
@@ -325,7 +325,7 @@ public class RecordsManagementActionServiceImpl implements RecordsManagementActi
public Map executeRecordsManagementAction(List nodeRefs, String name, Map parameters)
{
// Execute the action on each node in the list
- Map results = new HashMap(nodeRefs.size());
+ Map results = new HashMap<>(nodeRefs.size());
for (NodeRef nodeRef : nodeRefs)
{
RecordsManagementActionResult result = executeRecordsManagementAction(nodeRef, name, parameters);
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/CustomParameterConstraint.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/CustomParameterConstraint.java
index 7a8c7e42cb..28b4769c97 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/CustomParameterConstraint.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/CustomParameterConstraint.java
@@ -58,7 +58,7 @@ public class CustomParameterConstraint extends BaseParameterConstraint
*/
protected Map getAllowableValuesImpl()
{
- Map allowableValues = new HashMap(parameterValues.size());
+ Map allowableValues = new HashMap<>(parameterValues.size());
for (Object parameterValue : parameterValues)
{
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/DispositionActionParameterConstraint.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/DispositionActionParameterConstraint.java
index d228dcad05..5c1d4b393c 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/DispositionActionParameterConstraint.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/DispositionActionParameterConstraint.java
@@ -60,7 +60,7 @@ public class DispositionActionParameterConstraint extends BaseParameterConstrain
{
List rmActions = rmActionService.getDispositionActions();
- Map result = new HashMap(rmActions.size());
+ Map result = new HashMap<>(rmActions.size());
for (RecordsManagementAction rmAction : rmActions)
{
result.put(rmAction.getName(), rmAction.getLabel());
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/ManualEventParameterConstraint.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/ManualEventParameterConstraint.java
index cdc4e055d4..f72ee45b6d 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/ManualEventParameterConstraint.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/ManualEventParameterConstraint.java
@@ -59,7 +59,7 @@ public class ManualEventParameterConstraint extends BaseParameterConstraint
protected Map getAllowableValuesImpl()
{
List events = recordsManagementEventService.getEvents();
- Map result = new HashMap(events.size());
+ Map result = new HashMap<>(events.size());
for (RecordsManagementEvent event : events)
{
RecordsManagementEventType eventType = recordsManagementEventService.getEventType(event.getType());
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/RecordTypeParameterConstraint.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/RecordTypeParameterConstraint.java
index 05d9c0c0fb..a3916715ee 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/RecordTypeParameterConstraint.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/RecordTypeParameterConstraint.java
@@ -108,7 +108,7 @@ public class RecordTypeParameterConstraint extends BaseParameterConstraint
{
Set recordTypes = recordService.getRecordMetadataAspects(filePlan);
- result = new HashMap(recordTypes.size());
+ result = new HashMap<>(recordTypes.size());
for (QName recordType : recordTypes)
{
AspectDefinition aspectDefinition = dictionaryService.getAspect(recordType);
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/VersionParameterConstraint.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/VersionParameterConstraint.java
index bfe114ebb3..d1f400c1fa 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/VersionParameterConstraint.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/constraint/VersionParameterConstraint.java
@@ -48,7 +48,7 @@ public class VersionParameterConstraint extends BaseParameterConstraint
protected Map getAllowableValuesImpl()
{
RecordableVersionPolicy[] recordableVersionPolicies = RecordableVersionPolicy.values();
- Map allowableValues = new HashMap(recordableVersionPolicies.length);
+ Map allowableValues = new HashMap<>(recordableVersionPolicies.length);
for (RecordableVersionPolicy recordableVersionPolicy : recordableVersionPolicies)
{
String policy = recordableVersionPolicy.toString();
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/evaluator/DispositionActionRelativePositions.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/evaluator/DispositionActionRelativePositions.java
index 37c9793115..6efa240d1e 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/evaluator/DispositionActionRelativePositions.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/evaluator/DispositionActionRelativePositions.java
@@ -35,5 +35,5 @@ package org.alfresco.module.org_alfresco_module_rm.action.evaluator;
*/
public enum DispositionActionRelativePositions
{
- ANY, NEXT, PREVIOUS;
+ ANY, NEXT, PREVIOUS
}
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/ApplyCustomTypeAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/ApplyCustomTypeAction.java
index 61a4fdfc3b..b99da6a2b4 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/ApplyCustomTypeAction.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/ApplyCustomTypeAction.java
@@ -114,7 +114,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
{
Map paramValues = action.getParameterValues();
- Map result = new HashMap(paramValues.size());
+ Map result = new HashMap<>(paramValues.size());
for (Map.Entry entry : paramValues.entrySet())
{
QName propQName = QName.createQName(entry.getKey(), this.getNamespaceService());
@@ -138,7 +138,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
Map props = aspectDefinition.getProperties();
- this.parameterDefinitions = new ArrayList(props.size());
+ this.parameterDefinitions = new ArrayList<>(props.size());
for (Map.Entry entry : props.entrySet())
{
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/BroadcastDispositionActionDefinitionUpdateAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/BroadcastDispositionActionDefinitionUpdateAction.java
index 9e68395cef..00e082b45b 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/BroadcastDispositionActionDefinitionUpdateAction.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/BroadcastDispositionActionDefinitionUpdateAction.java
@@ -168,7 +168,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
}
List events = da.getEventCompletionDetails();
- List list = new ArrayList(events.size());
+ List list = new ArrayList<>(events.size());
for (EventCompletionDetails event : events)
{
list.add(event.getEventName());
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/CopyMoveLinkFileToBaseAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/CopyMoveLinkFileToBaseAction.java
index fd08f8e252..87b64617da 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/CopyMoveLinkFileToBaseAction.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/CopyMoveLinkFileToBaseAction.java
@@ -77,7 +77,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
public enum CopyMoveLinkFileToActionMode
{
COPY, MOVE, LINK
- };
+ }
/** Action Mode */
private CopyMoveLinkFileToActionMode mode;
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/RequestInfoAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/RequestInfoAction.java
index 604c83ca8a..d78f65f985 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/RequestInfoAction.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/RequestInfoAction.java
@@ -94,7 +94,7 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
!getRecordService().isDeclared(actionedUponNodeRef))
{
String workflowDefinitionId = workflowService.getDefinitionByName(REQUEST_INFO_WORKFLOW_DEFINITION_NAME).getId();
- Map parameters = new HashMap();
+ Map 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 assigneesList = new ArrayList();
+ List assigneesList = new ArrayList<>();
String assigneesAsString = (String) action.getParameterValue(PARAM_ASSIGNEES);
String[] assignees = StringUtils.split(assigneesAsString, ',');
for (String assignee : assignees)
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/SplitEmailAction.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/SplitEmailAction.java
index f3230b6635..5606f27424 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/SplitEmailAction.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/SplitEmailAction.java
@@ -247,7 +247,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
ContentType contentType = new ContentType(part.getContentType());
- Map docProps = new HashMap(1);
+ Map docProps = new HashMap<>(1);
docProps.put(ContentModel.PROP_NAME, messageTitle + " - " + fileName);
docProps.put(ContentModel.PROP_TITLE, fileName);
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminBase.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminBase.java
index 89a65cf18a..5c604a53ef 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminBase.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminBase.java
@@ -203,7 +203,7 @@ public class RecordsManagementAdminBase implements RecordsManagementCustomModel
*/
protected Map getCustomAssociations()
{
- Map customAssociations = new HashMap();
+ Map customAssociations = new HashMap<>();
AspectDefinition aspectDefn = getDictionaryService().getAspect(ASPECT_CUSTOM_ASSOCIATIONS);
if (aspectDefn != null)
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminServiceImpl.java
index a696f7d85b..91be9ba7ca 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminServiceImpl.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminServiceImpl.java
@@ -329,7 +329,7 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas
{
mandatory("customisableTypes", customisableTypes);
- pendingCustomisableTypes = new ArrayList();
+ 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 result = new HashSet(5);
+ Set 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(7);
+ customisableTypes = new HashMap<>(7);
Collection aspects = getDictionaryService().getAspects(RM_CUSTOM_MODEL);
for (QName aspect : aspects)
{
@@ -636,7 +636,7 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas
*/
public Map getCustomPropertyDefinitions()
{
- Map result = new HashMap();
+ Map result = new HashMap<>();
for (QName customisableType : getCustomisable())
{
Map props = getCustomPropertyDefinitions(customisableType);
@@ -1268,7 +1268,7 @@ public class RecordsManagementAdminServiceImpl extends RecordsManagementAdminBas
}
}
- return new ArrayList(conDefs);
+ return new ArrayList<>(conDefs);
}
/**
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditEntry.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditEntry.java
index 9f0e982da0..073a1a4ebb 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditEntry.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditEntry.java
@@ -251,26 +251,27 @@ public final class RecordsManagementAuditEntry
{
if (this.beforeProperties != null && this.afterProperties != null)
{
- this.changedProperties = new HashMap>(
- this.beforeProperties.size() + this.afterProperties.size());
+ 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 entry : this.beforeProperties.entrySet())
{
- Pair values = new Pair(
- this.beforeProperties.get(valuePropName),
- this.afterProperties.get(valuePropName));
+ final QName valuePropName = entry.getKey();
+ Pair 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 entry : this.afterProperties.entrySet())
{
+ final QName valuePropName = entry.getKey();
if (!this.beforeProperties.containsKey(valuePropName))
{
- Pair values = new Pair(null,
- this.afterProperties.get(valuePropName));
+ Pair values = new Pair<>(null, entry.getValue());
this.changedProperties.put(valuePropName, values);
}
}
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditQueryParameters.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditQueryParameters.java
index 20712b9af7..b9a671967d 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditQueryParameters.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditQueryParameters.java
@@ -55,6 +55,7 @@ public final class RecordsManagementAuditQueryParameters
*/
public RecordsManagementAuditQueryParameters()
{
+ //Default constructor
}
/**
diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java
index 8e816549d8..4321ac0c09 100644
--- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java
+++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java
@@ -210,12 +210,12 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
private List ignoredAuditProperties;
- private List propertiesToBeRemoved = new ArrayList();
+ private List propertiesToBeRemoved = new ArrayList<>();
private RMAuditTxnListener txnListener = new RMAuditTxnListener();
/** Registered and initialised records management auditEvents */
- private Map auditEvents = new HashMap();
+ private Map auditEvents = new HashMap<>();
/**
* Set the component used to bind to behaviour callbacks
@@ -622,7 +622,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
*/
private Map buildAuditMap(NodeRef nodeRef, String eventName, Map propertiesBefore, Map propertiesAfter, boolean removeOnNoPropertyChange)
{
- Map auditMap = new HashMap(13);
+ Map 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 entries = new ArrayList(50);
+ List 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 properties = new HashMap(1);
+ Map 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 getAuditEvents()
{
- List listAuditEvents = new ArrayList(this.auditEvents.size());
+ List