Skip to content

Commit

Permalink
SAK-50484 Samigo fix incorrect formattedMessage because of bad cast
Browse files Browse the repository at this point in the history
  • Loading branch information
ottenhoff committed Oct 2, 2024
1 parent bd75983 commit d3cbf94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public String processActionKill() {
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_INFO,
parentTool.rb.getFormattedMessage("kill_message",
(Object) new String[] {jec.getJobDetail().getKey().getName()}), null));
(Object[]) new String[] {jec.getJobDetail().getKey().getName()}), null));
}

return "runningJobs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ public ArrayList getTimeStatsVariationArray() {

ArrayList timeStatsStringArray = new ArrayList<>();
timeStatsStringArray.add(counter);
timeStatsStringArray.add(evaluationMessages.getFormattedMessage("questionVariation_title", (Object) new String[]{minimumScore + "%", counter + ""}));
timeStatsStringArray.add(evaluationMessages.getFormattedMessage("questionVariation_title", (Object[]) new String[]{minimumScore + "%", counter + ""}));
timeStatsStringArray.add(timeStringArray);
timeStatsVariationArray.add(timeStatsStringArray);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void processAction(ActionEvent ae) {
double maxScore = deliveryBean.getTableOfContents().getMaxScore();
DecimalFormat twoDecimalsFormat = new DecimalFormat("0.00");
String scorePercentageString = (maxScore == 0) ? "0" : twoDecimalsFormat.format((currentScore / maxScore) * 100);
this.addCellToTable(shortSummaryTable, rb.getFormattedMessage("score_format", (Object) new String[] { twoDecimalsFormat.format(currentScore), twoDecimalsFormat.format(maxScore), scorePercentageString }), 0, 0);
this.addCellToTable(shortSummaryTable, rb.getFormattedMessage("score_format", (Object[]) new String[] { twoDecimalsFormat.format(currentScore), twoDecimalsFormat.format(maxScore), scorePercentageString }), 0, 0);
document.add(shortSummaryTable);
document.add(new Paragraph(Chunk.NEWLINE));

Expand All @@ -142,7 +142,7 @@ public void processAction(ActionEvent ae) {
String questionsNumber = String.valueOf(deliveryPart.getQuestions());
String partScore = twoDecimalsFormat.format(deliveryPart.getPoints());
String partMaxScore = twoDecimalsFormat.format(deliveryPart.getMaxPoints());
document.add(new Paragraph(rb.getFormattedMessage("short_summary.part_title", (Object) new String[]{partNumber, partTitle, answeredQuestions, questionsNumber, partScore, partMaxScore}), blueBoldFont));
document.add(new Paragraph(rb.getFormattedMessage("short_summary.part_title", (Object[]) new String[]{partNumber, partTitle, answeredQuestions, questionsNumber, partScore, partMaxScore}), blueBoldFont));

document.add(new Paragraph("\n"));

Expand Down Expand Up @@ -188,7 +188,7 @@ public void processAction(ActionEvent ae) {
PdfPTable questionTable = new PdfPTable(2);
questionTable.setWidthPercentage(50f);
questionTable.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
this.addCellToTable(questionTable, ( rb.getFormattedMessage("current_question", (Object) new String[]{String.valueOf(++itemsIndex), String.valueOf(questionsCuantity)}) ), 3, 1);
this.addCellToTable(questionTable, ( rb.getFormattedMessage("current_question", (Object[]) new String[]{String.valueOf(++itemsIndex), String.valueOf(questionsCuantity)}) ), 3, 1);
this.addCellToTable(questionTable, (twoDecimalsFormat.format(item.getPoints()) + "/" + twoDecimalsFormat.format(item.getMaxPoints())), 3, 0);
document.add(new Paragraph(Chunk.NEWLINE));
document.add(questionTable);
Expand Down

0 comments on commit d3cbf94

Please sign in to comment.