Skip to content

Commit

Permalink
Remove the declaration of thrown exception 'java.io.IOException', as …
Browse files Browse the repository at this point in the history
…it cannot be thrown from method's body.
  • Loading branch information
RodrigoZambrana committed Dec 27, 2024
1 parent 235d0f8 commit d96472d
Showing 1 changed file with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.lacnic.elections.ejb.commons.impl;

import java.io.IOException;
import java.io.StringWriter;
import java.sql.SQLException;
import java.util.ArrayList;
Expand Down Expand Up @@ -51,11 +50,15 @@ public class MailsSendingEJBBean implements MailsSendingEJB {
private EntityManager em;

/**
* Creates mails with the information required depending on the template type, from a list of voters or auditors (depending on the template type). If the templates contains VOTE_SuMMARY on the body,
* it adds the vote summary if the template is for auditor, it creates a mail with the auditor information; if not, it creates a mail for the voter.
* Creates mails with the information required depending on the template type,
* from a list of voters or auditors (depending on the template type). If the
* templates contains VOTE_SuMMARY on the body, it adds the vote summary if the
* template is for auditor, it creates a mail with the auditor information; if
* not, it creates a mail for the voter.
*
* @param templateEleccion The email template from which to create the mail
* @param users A collection of either user voter entity of auditor entity with the information for each mail
* @param users A collection of either user voter entity of auditor
* entity with the information for each mail
*
*/
@Override
Expand Down Expand Up @@ -144,8 +147,10 @@ public void queueMassiveSending(List<?> users, ElectionEmailTemplate emailTempla
}

/**
* Creates a mail with the information required depending on the template type. If the templates contains VOTE_SuMMARY on the body, it adds the vote summary if the template is fopr auditor, it creates
* a mail with the auditor information; if not, it creates a mail for the voter.
* Creates a mail with the information required depending on the template type.
* If the templates contains VOTE_SuMMARY on the body, it adds the vote summary
* if the template is fopr auditor, it creates a mail with the auditor
* information; if not, it creates a mail for the voter.
*
* @param templateEleccion The email template from which to create the mail
* @param userVoter The voter of the election
Expand Down Expand Up @@ -219,7 +224,8 @@ public void queueSingleSending(ElectionEmailTemplate emailTemplate, UserVoter us
*
* @param votes A collection of vote entity containing the votes
*
* @return returns a string with all the vote codes and candidate names in the form of "code / name"
* @return returns a string with all the vote codes and candidate names in the
* form of "code / name"
*/
private String addVotes(List<Vote> votes) {
String aux = "";
Expand All @@ -237,7 +243,7 @@ private String addVotes(List<Vote> votes) {
* @return returns a string with the template filled.
*
*/
private String processTemplate(String template, Map<String, Object> variables) throws IOException {
private String processTemplate(String template, Map<String, Object> variables) {
VelocityEngine velocityEngine = new VelocityEngine();
velocityEngine.init();
VelocityContext context = new VelocityContext();
Expand Down Expand Up @@ -272,7 +278,8 @@ public void markEmailsAsSent() {
/**
* Takes a list of unsent emails and re sends them
*
* @param problemEmails A collection of email entity containing the mails that need to be re-sent.
* @param problemEmails A collection of email entity containing the mails that
* need to be re-sent.
*/
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRED)
Expand All @@ -294,7 +301,8 @@ public void moveEmailsToHistory() {
}

/**
* Deletes all the transactional information from the database (email, uservoter, candidate, election )
* Deletes all the transactional information from the database (email,
* uservoter, candidate, election )
*/
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
Expand Down

0 comments on commit d96472d

Please sign in to comment.