diff --git a/source/src/main/java/org/cerberus/core/servlet/crud/testcampaign/CreateCampaign.java b/source/src/main/java/org/cerberus/core/servlet/crud/testcampaign/CreateCampaign.java index 60016be3f..2f209e46c 100644 --- a/source/src/main/java/org/cerberus/core/servlet/crud/testcampaign/CreateCampaign.java +++ b/source/src/main/java/org/cerberus/core/servlet/crud/testcampaign/CreateCampaign.java @@ -204,7 +204,7 @@ final void processRequest(final HttpServletRequest request, final HttpServletRes ArrayList arr = new ArrayList<>(); for (int i = 0; i < labels.length(); i++) { JSONArray bat = labels.getJSONArray(i); - CampaignLabel co = factoryCampaignLabel.create(0, bat.getString(0), Integer.valueOf(bat.getString(2)), request.getRemoteUser(), null, request.getRemoteUser(), null); + CampaignLabel co = factoryCampaignLabel.create(0, bat.getString(0), bat.getInt(2), request.getRemoteUser(), null, request.getRemoteUser(), null); arr.add(co); } ans = campaignLabelService.compareListAndUpdateInsertDeleteElements(campaignName, arr); @@ -241,21 +241,21 @@ private List getScheduleEntryListFromParameter(HttpServletRequest String cronExpression = policy.sanitize(tcsaJson.getString("cronDefinition")); String active = policy.sanitize(tcsaJson.getString("isActive")); String desc = policy.sanitize(tcsaJson.getString("description")); - String strId = tcsaJson.getString("id"); + long id = tcsaJson.getLong("id"); String type = "CAMPAIGN"; String name = campaign; - int id; - if (strId.isEmpty()) { - id = 0; - } else { - try { - id = Integer.parseInt(strId); - } catch (NumberFormatException e) { - LOG.warn("Unable to parse pool size: " + strId + ". Applying default value"); - id = 0; - } - } +// int id; +// if (strId.isEmpty()) { +// id = 0; +// } else { +// try { +// id = Integer.parseInt(strId); +// } catch (NumberFormatException e) { +// LOG.warn("Unable to parse pool size: " + strId + ". Applying default value"); +// id = 0; +// } +// } Timestamp timestampfactice = new Timestamp(System.currentTimeMillis()); @@ -285,19 +285,19 @@ private List getEventHookEntryListFromParameter(HttpServletRequest re String description = policy.sanitize(objJson.getString("description")); boolean isActive = objJson.getBoolean("isActive"); String hookChannel = policy.sanitize(objJson.getString("hookChannel")); - String strId = objJson.getString("id"); - - int id; - if (strId.isEmpty()) { - id = 0; - } else { - try { - id = Integer.parseInt(strId); - } catch (NumberFormatException e) { - LOG.warn("Unable to parse pool size: " + strId + ". Applying default value"); - id = 0; - } - } + int id = objJson.getInt("id"); + +// int id; +// if (strId.isEmpty()) { +// id = 0; +// } else { +// try { +// id = Integer.parseInt(strId); +// } catch (NumberFormatException e) { +// LOG.warn("Unable to parse pool size: " + strId + ". Applying default value"); +// id = 0; +// } +// } Timestamp timestampfactice = new Timestamp(System.currentTimeMillis()); diff --git a/source/src/main/java/org/cerberus/core/servlet/crud/testcampaign/UpdateCampaign.java b/source/src/main/java/org/cerberus/core/servlet/crud/testcampaign/UpdateCampaign.java index f0a12be87..d62599802 100644 --- a/source/src/main/java/org/cerberus/core/servlet/crud/testcampaign/UpdateCampaign.java +++ b/source/src/main/java/org/cerberus/core/servlet/crud/testcampaign/UpdateCampaign.java @@ -220,7 +220,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re ArrayList arr = new ArrayList<>(); for (int i = 0; i < labels.length(); i++) { JSONArray bat = labels.getJSONArray(i); - CampaignLabel co = factoryCampaignLabel.create(0, campaign, Integer.valueOf(bat.getString(2)), request.getRemoteUser(), null, request.getRemoteUser(), null); + CampaignLabel co = factoryCampaignLabel.create(0, campaign, bat.getInt(2), request.getRemoteUser(), null, request.getRemoteUser(), null); arr.add(co); } finalAnswer = AnswerUtil.agregateAnswer(finalAnswer, campaignLabelService.compareListAndUpdateInsertDeleteElements(campaign, arr)); @@ -254,22 +254,22 @@ private List getScheduleEntryListFromParameter(HttpServletRequest boolean delete = tcsaJson.getBoolean("toDelete"); String cronExpression = policy.sanitize(tcsaJson.getString("cronDefinition")); String active = policy.sanitize(tcsaJson.getString("isActive")); - String strId = tcsaJson.getString("id"); + long id = tcsaJson.getLong("id"); String desc = tcsaJson.getString("description"); String type = "CAMPAIGN"; String name = campaign; - int id; - if (strId.isEmpty()) { - id = 0; - } else { - try { - id = Integer.parseInt(strId); - } catch (NumberFormatException e) { - LOG.warn("Unable to parse pool size: " + strId + ". Applying default value"); - id = 0; - } - } +// int id; +// if (strId.isEmpty()) { +// id = 0; +// } else { +// try { +// id = Integer.parseInt(strId); +// } catch (NumberFormatException e) { +// LOG.warn("Unable to parse pool size: " + strId + ". Applying default value"); +// id = 0; +// } +// } Timestamp timestampfactice = new Timestamp(System.currentTimeMillis()); @@ -299,19 +299,19 @@ private List getEventHookEntryListFromParameter(HttpServletRequest re String description = policy.sanitize(objJson.getString("description")); boolean isActive = objJson.getBoolean("isActive"); String hookChannel = policy.sanitize(objJson.getString("hookChannel")); - String strId = objJson.getString("id"); - - int id; - if (strId.isEmpty()) { - id = 0; - } else { - try { - id = Integer.parseInt(strId); - } catch (NumberFormatException e) { - LOG.warn("Unable to parse pool size: " + strId + ". Applying default value"); - id = 0; - } - } + int id = objJson.getInt("id"); + +// int id; +// if (strId.isEmpty()) { +// id = 0; +// } else { +// try { +// id = Integer.parseInt(strId); +// } catch (NumberFormatException e) { +// LOG.warn("Unable to parse pool size: " + strId + ". Applying default value"); +// id = 0; +// } +// } Timestamp timestampfactice = new Timestamp(System.currentTimeMillis()); @@ -340,7 +340,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) } catch (CerberusException ex) { LOG.warn(ex); } catch (JSONException ex) { - LOG.warn(ex); + LOG.warn(ex,ex); } } @@ -361,7 +361,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) } catch (CerberusException ex) { LOG.warn(ex); } catch (JSONException ex) { - LOG.warn(ex); + LOG.warn(ex,ex); } }