Skip to content

Commit

Permalink
Fixed regression on JSON lib upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo17 committed Dec 27, 2024
1 parent 89f2d9d commit 1d5c40d
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ final void processRequest(final HttpServletRequest request, final HttpServletRes
ArrayList<CampaignLabel> 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);
Expand Down Expand Up @@ -241,21 +241,21 @@ private List<ScheduleEntry> 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());

Expand Down Expand Up @@ -285,19 +285,19 @@ private List<EventHook> 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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
ArrayList<CampaignLabel> 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));
Expand Down Expand Up @@ -254,22 +254,22 @@ private List<ScheduleEntry> 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());

Expand Down Expand Up @@ -299,19 +299,19 @@ private List<EventHook> 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());

Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down

0 comments on commit 1d5c40d

Please sign in to comment.