Reduce Sonar issues from automation-community-rest-api

This commit is contained in:
cagache
2019-12-16 15:14:31 +02:00
parent d5fbdac23c
commit e2e44eb9c7
8 changed files with 12 additions and 9 deletions

View File

@@ -109,7 +109,7 @@ public class Record extends TestModel implements IRestModel<RestNodeModel>
@Override @Override
public ModelAssertion<RestNodeModel> assertThat() public ModelAssertion<RestNodeModel> assertThat()
{ {
return new ModelAssertion<RestNodeModel>(this); return new ModelAssertion<>(this);
} }
@Override @Override

View File

@@ -53,7 +53,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class RecordCategory extends TestModel public class RecordCategory extends TestModel
{ {
public final static String DEFAULT_FILE_PLAN_ALIAS = "-filePlan-"; public static final String DEFAULT_FILE_PLAN_ALIAS = "-filePlan-";
/*************************/ /*************************/
/** Mandatory parameters */ /** Mandatory parameters */

View File

@@ -53,7 +53,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class RecordCategoryChild extends TestModel public class RecordCategoryChild extends TestModel
{ {
public final static String RECORD_FOLDER_NODE_TYPE = "rma:recordFolder"; public static final String RECORD_FOLDER_NODE_TYPE = "rma:recordFolder";
/*************************/ /*************************/
/** Mandatory parameters */ /** Mandatory parameters */

View File

@@ -28,7 +28,6 @@ package org.alfresco.rest.rm.community.requests.gscore.api;
import static org.alfresco.rest.core.RestRequest.simpleRequest; import static org.alfresco.rest.core.RestRequest.simpleRequest;
import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryString; import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryString;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.springframework.http.HttpMethod.POST; import static org.springframework.http.HttpMethod.POST;
import org.alfresco.rest.core.RMRestWrapper; import org.alfresco.rest.core.RMRestWrapper;

View File

@@ -54,6 +54,10 @@ public class PojoUtility
*/ */
private static final Logger LOGGER = LoggerFactory.getLogger(PojoUtility.class); private static final Logger LOGGER = LoggerFactory.getLogger(PojoUtility.class);
/** Private constructor to prevent instantiation. */
private PojoUtility()
{}
/** /**
* see {@link #toJson(Object, Class, Class)} * see {@link #toJson(Object, Class, Class)}
*/ */
@@ -122,7 +126,7 @@ public class PojoUtility
} }
catch (IOException e) catch (IOException e)
{ {
LOGGER.error("Unable to convert the json into a java object.", e.toString()); LOGGER.error("Unable to convert the json into a java object.", e);
} }
return obj; return obj;
@@ -152,7 +156,7 @@ public class PojoUtility
} }
catch (IOException e) catch (IOException e)
{ {
LOGGER.error("Unable to convert the json array into a java collection.", e.toString()); LOGGER.error("Unable to convert the json array into a java collection.", e);
} }

View File

@@ -105,7 +105,7 @@ public class CustomDefinitionsAPI extends BaseAPI
} }
catch (JSONException error) catch (JSONException error)
{ {
LOGGER.error("Unable to get the refId for the custom reference definition " + customDefinition); LOGGER.error("Unable to get the refId for the custom reference definition {}", customDefinition);
} }
} }
return null; return null;

View File

@@ -76,7 +76,7 @@ public class RMAuditAPI extends BaseAPI
} }
catch (UnsupportedEncodingException e) catch (UnsupportedEncodingException e)
{ {
LOGGER.error("Unable to encode the event name" + e.getMessage()); LOGGER.error("Unable to encode the event name {}", e.getMessage());
} }
JSONArray auditEntries = doGetRequest(user, password, JSONArray auditEntries = doGetRequest(user, password,
MessageFormat.format(RM_AUDIT_LOG_API,"{0}", parameters)).getJSONObject("data").getJSONArray("entries"); MessageFormat.format(RM_AUDIT_LOG_API,"{0}", parameters)).getJSONObject("data").getJSONArray("entries");

View File

@@ -102,7 +102,7 @@ public class SearchAPI extends BaseAPI
String filters, String filters,
String sortby) String sortby)
{ {
List<BasicNameValuePair> searchParameters = new ArrayList<BasicNameValuePair>(); List<BasicNameValuePair> searchParameters = new ArrayList<>();
searchParameters.add(new BasicNameValuePair("query", query)); searchParameters.add(new BasicNameValuePair("query", query));
searchParameters.add(new BasicNameValuePair("filters", filters)); searchParameters.add(new BasicNameValuePair("filters", filters));
if (sortby != null) if (sortby != null)