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:
Neil McErlean
2015-09-28 12:02:26 +00:00
parent 1a71eafaf5
commit 773f964620
2 changed files with 41 additions and 44 deletions

View File

@@ -578,10 +578,10 @@ public class RecordsManagementSearchBehaviour implements RecordsManagementModel
// Apply the search aspect // Apply the search aspect
applySearchAspect(record); 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) if (events == null)
{ {
events = new ArrayList<String>(1); events = new ArrayList<>(1);
} }
events.add((String)nodeService.getProperty(eventExecution, PROP_EVENT_EXECUTION_NAME)); events.add((String)nodeService.getProperty(eventExecution, PROP_EVENT_EXECUTION_NAME));
nodeService.setProperty(record, PROP_RS_DISPOSITION_EVENTS, (Serializable)events); nodeService.setProperty(record, PROP_RS_DISPOSITION_EVENTS, (Serializable)events);

View File

@@ -116,8 +116,6 @@ public class RecordsManagementSearchServiceImpl implements RecordsManagementSear
try try
{ {
JSONArray jsonArray = new JSONArray(reportsJSON); JSONArray jsonArray = new JSONArray(reportsJSON);
if (jsonArray != null)
{
for (int i=0; i < jsonArray.length(); i++) for (int i=0; i < jsonArray.length(); i++)
{ {
JSONObject report = jsonArray.getJSONObject(i); JSONObject report = jsonArray.getJSONObject(i);
@@ -163,7 +161,6 @@ public class RecordsManagementSearchServiceImpl implements RecordsManagementSear
ReportDetails reportDetails = new ReportDetails(name, description, query, searchParameters); ReportDetails reportDetails = new ReportDetails(name, description, query, searchParameters);
reports.add(reportDetails); reports.add(reportDetails);
} }
}
} }
catch (JSONException exception) catch (JSONException exception)
{ {