From 480783d421688514d9d0ebe6c928dc08aa9a596b Mon Sep 17 00:00:00 2001 From: manisha07 Date: Wed, 6 Nov 2019 15:54:51 +0530 Subject: replacing with the diamond operators Issue-ID: OPTFRA-635 Change-Id: I2cfd17d545a89b0be27bd4b73e402074465bcaa3 Signed-off-by: manisha07 --- .../optf/cmso/service/rs/CmQueryParameters.java | 22 ++++------------------ .../org/onap/optf/cmso/ticketmgt/TmClient.java | 10 +++++----- 2 files changed, 9 insertions(+), 23 deletions(-) (limited to 'cmso-service') diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java index 1e4a46a..ebad49f 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java @@ -120,8 +120,8 @@ public class CmQueryParameters { private static String formatString(String urlName, List values, QueryColumns qc) { StringBuilder clause = new StringBuilder(); - List likes = new ArrayList(); - List in = new ArrayList(); + List likes = new ArrayList<>(); + List in = new ArrayList<>(); for (String value : values) { if (value.contains("%")) { likes.add(value); @@ -170,7 +170,7 @@ public class CmQueryParameters { } private static String formatDate(String urlName, List values, QueryColumns qc) throws CmsoException { - List clauses = new ArrayList(); + List clauses = new ArrayList<>(); for (String value : values) { String[] dates = value.split(","); switch (dates.length) { @@ -232,19 +232,5 @@ public class CmQueryParameters { } } - // public static void main(String argv[]) - // { - // List values = new ArrayList(); - // values.add("2017-07-08T11:12:13Z,2017-07-08T11:12:13Z"); - // values.add("2017-07-09T11:12:13Z,2017-07-09T11:12:13Z"); - // values.add(",2017-07-09T11:12:13Z"); - // values.add(" 2017-07-09T11:12:13Z"); - // try { - // System.out.println(buildClause("request.createDateTime", values)); - // } catch (SchedulerException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } - // - // } + } diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmClient.java b/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmClient.java index 1864da7..b2b4479 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmClient.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmClient.java @@ -234,7 +234,7 @@ public class TmClient { } } - Map variables = new HashMap(); + Map variables = new HashMap<>(); variables.put(Variables.status.toString(), "Closed"); variables.put(Variables.requesterId.toString(), requesterId); @@ -248,7 +248,7 @@ public class TmClient { private Map getCancelVariables(Schedule schedule, String changeId) { String requesterId = schedule.getUserId(); - Map variables = new HashMap(); + Map variables = new HashMap<>(); if (requesterId.length() > Variables.requesterId.getMaxLength()) { requesterId = requesterId.substring(0, Variables.requesterId.getMaxLength()); } @@ -259,7 +259,7 @@ public class TmClient { private Map getUpdateVariables(Schedule schedule, String changeId) { String requesterId = schedule.getUserId(); - Map variables = new HashMap(); + Map variables = new HashMap<>(); if (requesterId.length() > Variables.requesterId.getMaxLength()) { requesterId = requesterId.substring(0, Variables.requesterId.getMaxLength()); } @@ -275,7 +275,7 @@ public class TmClient { Response response = null; debug.debug("postCloseChangeTicket {}", closeChangeRecord.asText()); Observation.report(LogMessages.TM_CLOSE_CHANGE_RECORD, "Begin", scheduleId, changeId); - // response = vtmPost(url, closeChangeRecord, scheduleId); + response = tmPost(Endpoint.CLOSE, closeChangeRecord, scheduleId); Observation.report(LogMessages.TM_CLOSE_CHANGE_RECORD, "End", scheduleId, changeId); switch (response.getStatus()) { @@ -338,7 +338,7 @@ public class TmClient { } private List getAssetList(List vnfNames) { - List assetList = new ArrayList(); + List assetList = new ArrayList<>(); for (String vnfName : vnfNames) { TmAsset asset = new TmAsset(); asset.setAssetId(vnfName); -- cgit 1.2.3-korg