mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fixing findbugs errors: "Method checks the result of a new allocation" and "Overzealous casting".
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@113200 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -578,10 +578,10 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
|
||||
// Apply the search aspect
|
||||
applySearchAspect(record);
|
||||
|
||||
Collection<String> events = (List<String>)nodeService.getProperty(record, PROP_RS_DISPOSITION_EVENTS);
|
||||
Collection<String> events = (Collection<String>)nodeService.getProperty(record, PROP_RS_DISPOSITION_EVENTS);
|
||||
if (events == null)
|
||||
{
|
||||
events = new ArrayList<String>(1);
|
||||
events = new ArrayList<>(1);
|
||||
}
|
||||
events.add((String)nodeService.getProperty(eventExecution, PROP_EVENT_EXECUTION_NAME));
|
||||
nodeService.setProperty(record, PROP_RS_DISPOSITION_EVENTS, (Serializable)events);
|
||||
|
@@ -116,54 +116,51 @@ public class RecordsManagementSearchServiceImpl implements RecordsManagementSear
|
||||
try
|
||||
{
|
||||
JSONArray jsonArray = new JSONArray(reportsJSON);
|
||||
if (jsonArray != null)
|
||||
{
|
||||
for (int i=0; i < jsonArray.length(); i++)
|
||||
{
|
||||
JSONObject report = jsonArray.getJSONObject(i);
|
||||
for (int i=0; i < jsonArray.length(); i++)
|
||||
{
|
||||
JSONObject report = jsonArray.getJSONObject(i);
|
||||
|
||||
// Get the name
|
||||
if (!report.has(SavedSearchDetails.NAME))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to load report details because name has not been specified. \n" + reportsJSON);
|
||||
}
|
||||
String name = report.getString(SavedSearchDetails.NAME);
|
||||
String translatedName = I18NUtil.getMessage(name);
|
||||
if (translatedName != null)
|
||||
{
|
||||
name = translatedName;
|
||||
}
|
||||
// Get the name
|
||||
if (!report.has(SavedSearchDetails.NAME))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to load report details because name has not been specified. \n" + reportsJSON);
|
||||
}
|
||||
String name = report.getString(SavedSearchDetails.NAME);
|
||||
String translatedName = I18NUtil.getMessage(name);
|
||||
if (translatedName != null)
|
||||
{
|
||||
name = translatedName;
|
||||
}
|
||||
|
||||
// Get the query
|
||||
if (!report.has(SavedSearchDetails.SEARCH))
|
||||
// Get the query
|
||||
if (!report.has(SavedSearchDetails.SEARCH))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to load report details because search has not been specified for report " + name + ". \n" + reportsJSON);
|
||||
}
|
||||
String query = report.getString(SavedSearchDetails.SEARCH);
|
||||
|
||||
// Get the description
|
||||
String description = "";
|
||||
if (report.has(SavedSearchDetails.DESCRIPTION))
|
||||
{
|
||||
description = report.getString(SavedSearchDetails.DESCRIPTION);
|
||||
String translatedDescription = I18NUtil.getMessage(description);
|
||||
if (translatedDescription != null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to load report details because search has not been specified for report " + name + ". \n" + reportsJSON);
|
||||
description = translatedDescription;
|
||||
}
|
||||
String query = report.getString(SavedSearchDetails.SEARCH);
|
||||
}
|
||||
|
||||
// Get the description
|
||||
String description = "";
|
||||
if (report.has(SavedSearchDetails.DESCRIPTION))
|
||||
{
|
||||
description = report.getString(SavedSearchDetails.DESCRIPTION);
|
||||
String translatedDescription = I18NUtil.getMessage(description);
|
||||
if (translatedDescription != null)
|
||||
{
|
||||
description = translatedDescription;
|
||||
}
|
||||
}
|
||||
RecordsManagementSearchParameters searchParameters = new RecordsManagementSearchParameters();
|
||||
if (report.has("searchparams"))
|
||||
{
|
||||
searchParameters = RecordsManagementSearchParameters.createFromJSON(report.getJSONObject("searchparams"), namespaceService);
|
||||
}
|
||||
|
||||
RecordsManagementSearchParameters searchParameters = new RecordsManagementSearchParameters();
|
||||
if (report.has("searchparams"))
|
||||
{
|
||||
searchParameters = RecordsManagementSearchParameters.createFromJSON(report.getJSONObject("searchparams"), namespaceService);
|
||||
}
|
||||
|
||||
// Create the report details and add to list
|
||||
ReportDetails reportDetails = new ReportDetails(name, description, query, searchParameters);
|
||||
reports.add(reportDetails);
|
||||
}
|
||||
}
|
||||
// Create the report details and add to list
|
||||
ReportDetails reportDetails = new ReportDetails(name, description, query, searchParameters);
|
||||
reports.add(reportDetails);
|
||||
}
|
||||
}
|
||||
catch (JSONException exception)
|
||||
{
|
||||
|
Reference in New Issue
Block a user