Skip to content

Commit

Permalink
Better commenting about the refactored row-construction function.
Browse files Browse the repository at this point in the history
  • Loading branch information
vteague committed Aug 16, 2024
1 parent 3069a76 commit d6dd3f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ public static long custCopyOut(final String sql, OutputStream to, CopyManager cm
/**
* This function deals, somewhat inelegantly, with the problem that the ContestResult data structure
* used in most queries does not have correct values for things like winners, losers, margin, and
* diluted margin. This sets them manually from the GenerateAssertionsSummary table, then flushes
* the database so that the csv reports, which are based on database queries, get the right
* values from the contest_result table.
* diluted margin for IRV contests. This function sets them manually from the
* GenerateAssertionsSummary table, then flushes the database so that the csv reports, which are
* based on database queries, get the right values from the contest_result table.
* @param s The current Hibernate session.
*/
private static void updateIRVContestResults(final Session s) {
Expand All @@ -304,7 +304,7 @@ private static void updateIRVContestResults(final Session s) {
final Set<String> choices = new HashSet<>();
// Get the choices for the contest. These should be the same for all the contests, but
// gather the whole set from all of them just in case.
for(Contest contest : ca.contestResult().getContests()) {
for(final Contest contest : ca.contestResult().getContests()) {
if (contest.description().equals(ContestType.IRV.toString())) {
contest.choices().stream().map(ch -> choices.add(ch.name()));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public Workbook generateExcelWorkbook() {
// very brief summary and a reference to the assertions csv.
for (final CountyContestResult ccr : e.getValue().drivingContestResults()) {

CellStatus status = makeContestSummary(row_number, max_cell_number, ccr, summary_sheet,
final CellStatus status = makeContestSummary(row_number, max_cell_number, ccr, summary_sheet,
bold_style, integer_style, bold_right_style, decimal_style,
standard_style, standard_right_style);

Expand Down Expand Up @@ -701,9 +701,9 @@ public Workbook generateExcelWorkbook() {
* @return a CellStatus record, which tells the ensuing generation function which row it is up to
* and what maximum cell number has been used.
*/
protected static CellStatus makeContestSummary(int row_number, int max_cell_number, CountyContestResult ccr, Sheet summary_sheet,
CellStyle bold_style, CellStyle integer_style, CellStyle bold_right_style, CellStyle decimal_style,
CellStyle standard_style, CellStyle standard_right_style) {
protected static CellStatus makeContestSummary(int row_number, int max_cell_number, final CountyContestResult ccr,
final Sheet summary_sheet, final CellStyle bold_style, final CellStyle integer_style, final CellStyle bold_right_style,
final CellStyle decimal_style, final CellStyle standard_style, final CellStyle standard_right_style) {
row_number++;
Row row = summary_sheet.createRow(row_number++);
int cell_number = 0;
Expand Down

0 comments on commit d6dd3f3

Please sign in to comment.