stringBuilder.append(registration.calculateCurricularYear());
stringBuilder.append(registration.getCurricularYear());
    public String getDeclarationBody() {        final Person employee = getEmployee();        final Registration registration = getRegistration();        final Person student = registration.getStudent().getPerson();        final StudentCurricularPlan studentCurricularPlan = registration.getActiveStudentCurricularPlan();        final StringBuilder stringBuilder = new StringBuilder();        try {//        if (employee.getGender() == Gender.MALE) {//            stringBuilder.append(resourceBundle.getString("message.declaration.registration.person.title.male"));//        } else if (employee.getGender() == Gender.FEMALE) {            stringBuilder.append(resourceBundle.getString("message.declaration.registration.person.title.female"));//        } else {//            throw new Error("unknown.gender.type.of.employee");//        }        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.person.tail"));        stringBuilder.append("\n");        if (student.getGender() == Gender.MALE) {            stringBuilder.append(resourceBundle.getString("message.declaration.registration.student.number.header.male"));        } else if (student.getGender() == Gender.FEMALE) {            stringBuilder.append(resourceBundle.getString("message.declaration.registration.student.number.header.female"));        } else {            throw new Error("unknown.gender.type.of.student");        }        stringBuilder.append(" ");        stringBuilder.append(registration.getNumber());        stringBuilder.append(resourceBundle.getString("message.declaration.registration.comma"));        stringBuilder.append(" ");        stringBuilder.append(StringUtils.upperCase(student.getName()));        stringBuilder.append(resourceBundle.getString("message.declaration.registration.comma"));        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.document.id.prefix"));        stringBuilder.append(" ");        stringBuilder.append(enumResourceBundle.getString(student.getIdDocumentType().getName()));        stringBuilder.append(" ");        stringBuilder.append(student.getDocumentIdNumber());        stringBuilder.append(resourceBundle.getString("message.declaration.registration.comma"));        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.nationality.prefix"));        stringBuilder.append(" ");        stringBuilder.append(student.getNationality().getName());        stringBuilder.append(resourceBundle.getString("message.declaration.registration.comma"));        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.father.prefix"));        stringBuilder.append(" ");        stringBuilder.append(student.getNameOfFather());        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.mother.prefix"));        stringBuilder.append(" ");        stringBuilder.append(student.getNameOfMother());        stringBuilder.append(resourceBundle.getString("message.declaration.registration.comma"));        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.execution.year.prefix"));        stringBuilder.append(" ");        stringBuilder.append(ExecutionYear.readCurrentExecutionYear().getYear());        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.is.enroled"));        stringBuilder.append(" ");        //stringBuilder.append(resourceBundle.getString("message.declaration.registration.was.enroled"));        stringBuilder.append(resourceBundle.getString("message.declaration.registration.in"));        stringBuilder.append(" ");        stringBuilder.append(registration.calculateCurricularYear());        stringBuilder.append(resourceBundle.getString("message.declaration.registration.degree.prefix"));        stringBuilder.append(" ");        stringBuilder.append(enumResourceBundle.getString(studentCurricularPlan.getDegreeCurricularPlan().getDegree().getTipoCurso().getName()));        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("label.in"));        stringBuilder.append(" ");        stringBuilder.append(studentCurricularPlan.getDegreeCurricularPlan().getDegree().getName());        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.enroled.courses.prefix"));        stringBuilder.append(" ");        stringBuilder.append(studentCurricularPlan.countCurrentEnrolments());        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.enroled.courses.posfix"));        stringBuilder.append("\n \n");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.location.prefix"));        stringBuilder.append(" ");        // TODO : fix this when the new spaces structure is introduced and the location of each campus is known.        if (studentCurricularPlan.getCurrentCampus().getName().equals("Alameda")) {            stringBuilder.append("Lisboa");        } else {            stringBuilder.append("Oeiras");        }        stringBuilder.append(resourceBundle.getString("message.declaration.registration.comma"));        stringBuilder.append(" ");        final YearMonthDay today = new YearMonthDay();        stringBuilder.append(today.getDayOfMonth());        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.of"));        stringBuilder.append(" ");        stringBuilder.append(today.toString(fmt));        stringBuilder.append(" ");        stringBuilder.append(resourceBundle.getString("message.declaration.registration.of"));        stringBuilder.append(" ");        stringBuilder.append(today.getYear());        stringBuilder.append(" ");        stringBuilder.append("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");//        if (employee.getGender() == Gender.MALE) {//            stringBuilder.append(resourceBundle.getString("message.declaration.registration.person.title.male"));//        } else if (employee.getGender() == Gender.FEMALE) {            stringBuilder.append(resourceBundle.getString("message.declaration.registration.person.title.female"));//        } else {//            throw new Error("unknown.gender.type.of.employee");//        }        } catch (Throwable t) {            t.printStackTrace();        }        return stringBuilder.toString();    }