From d8f16a990ccd229cccd042d0b2c5eb0903ac413e Mon Sep 17 00:00:00 2001 From: Tom Page Date: Fri, 8 Sep 2017 14:10:47 +0100 Subject: [PATCH] RM-5611 Code review fixes. Remove nested try catch. Add additional check that we don't have duplicate topics selected. --- .../java/org/alfresco/rest/core/v0/BaseAPI.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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 74ea1bc661..0373fbcc73 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 @@ -404,15 +404,11 @@ public abstract class BaseAPI try { - String bodyString = EntityUtils.toString(response.getEntity()); - try - { - responseBody = new JSONObject(bodyString); - } - catch (JSONException error) - { - LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error); - } + responseBody = new JSONObject(EntityUtils.toString(response.getEntity())); + } + catch (JSONException error) + { + LOGGER.error("Converting message body to JSON failed. Body: {}", responseBody, error); } catch (ParseException | IOException error) {