for (ExecutionCourseView executionCourseView : executionCourseViews) { int curricularYear = executionCourseView.getCurricularYear(); boolean previousExecPeriod = previousExecutionPeriod != null && executionCourseView.getExecutionPeriodOID().equals(previousExecutionPeriod.getIdInternal());  switch (curricularYear) { case 1: case 2: if (previousExecPeriod) { executionCourseViewsTablePrevious1_2.appendToColumn(curricularYear - 1, executionCourseView); } else { executionCourseViewsTableCurrent1_2.appendToColumn(curricularYear - 1, executionCourseView); } break; case 3: case 4: if (previousExecPeriod) { executionCourseViewsTablePrevious3_4.appendToColumn(curricularYear - 3, executionCourseView); } else { executionCourseViewsTableCurrent3_4.appendToColumn(curricularYear - 3, executionCourseView); } break; case 5: if (previousExecPeriod) { executionCourseViewsTablePrevious5.appendToColumn(curricularYear - 5, executionCourseView); } else { executionCourseViewsTableCurrent5.appendToColumn(curricularYear - 5, executionCourseView); } break; } }
for (ExecutionCourseView executionCourseView : executionCourseViews) { int curricularYear = executionCourseView.getCurricularYear(); boolean previousExecPeriod = previousExecutionPeriod != null && executionCourseView.getExecutionPeriodOID().equals(previousExecutionPeriod.getIdInternal());
    private void organizeExecutionCourseViews(HttpServletRequest request, List<ExecutionCourseView> executionCourseViews, InfoExecutionPeriod previousExecutionPeriod) {        Table executionCourseViewsTableCurrent1_2 = new Table(2);        Table executionCourseViewsTableCurrent3_4 = new Table(2);        Table executionCourseViewsTableCurrent5 = new Table(1);        Table executionCourseViewsTablePrevious1_2 = new Table(2);        Table executionCourseViewsTablePrevious3_4 = new Table(2);        Table executionCourseViewsTablePrevious5 = new Table(1);        for (ExecutionCourseView executionCourseView : executionCourseViews) {            int curricularYear = executionCourseView.getCurricularYear();            boolean previousExecPeriod = previousExecutionPeriod != null && executionCourseView.getExecutionPeriodOID().equals(previousExecutionPeriod.getIdInternal());                        switch (curricularYear) {            case 1:            case 2:                if (previousExecPeriod) {                    executionCourseViewsTablePrevious1_2.appendToColumn(curricularYear - 1, executionCourseView);                } else {                    executionCourseViewsTableCurrent1_2.appendToColumn(curricularYear - 1, executionCourseView);                }                break;            case 3:            case 4:                if (previousExecPeriod) {                    executionCourseViewsTablePrevious3_4.appendToColumn(curricularYear - 3, executionCourseView);                } else {                    executionCourseViewsTableCurrent3_4.appendToColumn(curricularYear - 3, executionCourseView);                }                break;            case 5:                if (previousExecPeriod) {                    executionCourseViewsTablePrevious5.appendToColumn(curricularYear - 5, executionCourseView);                } else {                    executionCourseViewsTableCurrent5.appendToColumn(curricularYear - 5, executionCourseView);                }                break;            }        }        request.setAttribute("executionCourseViewsTableCurrent1_2", executionCourseViewsTableCurrent1_2);        request.setAttribute("executionCourseViewsTableCurrent3_4", executionCourseViewsTableCurrent3_4);        request.setAttribute("executionCourseViewsTableCurrent5", executionCourseViewsTableCurrent5);                request.setAttribute("executionCourseViewsTablePrevious1_2", executionCourseViewsTablePrevious1_2);        request.setAttribute("executionCourseViewsTablePrevious3_4", executionCourseViewsTablePrevious3_4);        request.setAttribute("executionCourseViewsTablePrevious5", executionCourseViewsTablePrevious5);    }