if ((infoMasterDegreeCandidate.getMajorDegreeYear().intValue() == 0)) editCandidateForm.set("majorDegreeYear", null); else editCandidateForm.set("majorDegreeYear", String.valueOf(infoMasterDegreeCandidate .getMajorDegreeYear()));
if (infoMasterDegreeCandidate.getMajorDegreeYear() != null) { if ((infoMasterDegreeCandidate.getMajorDegreeYear().intValue() == 0)) editCandidateForm.set("majorDegreeYear", null); else editCandidateForm.set("majorDegreeYear", String.valueOf(infoMasterDegreeCandidate .getMajorDegreeYear())); }
    private void populateForm(DynaActionForm editCandidateForm,            InfoMasterDegreeCandidate infoMasterDegreeCandidate) {        // Fill in The Form        InfoPerson infoPerson = infoMasterDegreeCandidate.getInfoPerson();        editCandidateForm.set("identificationDocumentNumber", infoPerson                .getNumeroDocumentoIdentificacao());        editCandidateForm.set("identificationDocumentType", infoPerson.getTipoDocumentoIdentificacao()                .toString());        editCandidateForm.set("identificationDocumentIssuePlace", infoPerson                .getLocalEmissaoDocumentoIdentificacao());        editCandidateForm.set("name", infoPerson.getNome());        Calendar birthDate = Calendar.getInstance();        if (infoPerson.getNascimento() == null) {            editCandidateForm.set("birthDay", Data.OPTION_DEFAULT);            editCandidateForm.set("birthMonth", Data.OPTION_DEFAULT);            editCandidateForm.set("birthYear", Data.OPTION_DEFAULT);        } else {            birthDate.setTime(infoPerson.getNascimento());            editCandidateForm.set("birthDay", new Integer(birthDate.get(Calendar.DAY_OF_MONTH))                    .toString());            editCandidateForm.set("birthMonth", new Integer(birthDate.get(Calendar.MONTH)).toString());            editCandidateForm.set("birthYear", new Integer(birthDate.get(Calendar.YEAR)).toString());        }        Calendar identificationDocumentIssueDate = Calendar.getInstance();        if (infoPerson.getDataEmissaoDocumentoIdentificacao() == null) {            editCandidateForm.set("idIssueDateDay", Data.OPTION_DEFAULT);            editCandidateForm.set("idIssueDateMonth", Data.OPTION_DEFAULT);            editCandidateForm.set("idIssueDateYear", Data.OPTION_DEFAULT);        } else {            identificationDocumentIssueDate.setTime(infoPerson.getDataEmissaoDocumentoIdentificacao());            editCandidateForm.set("idIssueDateDay", new Integer(identificationDocumentIssueDate                    .get(Calendar.DAY_OF_MONTH)).toString());            editCandidateForm.set("idIssueDateMonth", new Integer(identificationDocumentIssueDate                    .get(Calendar.MONTH)).toString());            editCandidateForm.set("idIssueDateYear", new Integer(identificationDocumentIssueDate                    .get(Calendar.YEAR)).toString());        }        Calendar identificationDocumentExpirationDate = Calendar.getInstance();        if (infoPerson.getDataValidadeDocumentoIdentificacao() == null) {            editCandidateForm.set("idExpirationDateDay", Data.OPTION_DEFAULT);            editCandidateForm.set("idExpirationDateMonth", Data.OPTION_DEFAULT);            editCandidateForm.set("idExpirationDateYear", Data.OPTION_DEFAULT);        } else {            identificationDocumentExpirationDate.setTime(infoPerson                    .getDataValidadeDocumentoIdentificacao());            editCandidateForm.set("idExpirationDateDay", new Integer(                    identificationDocumentExpirationDate.get(Calendar.DAY_OF_MONTH)).toString());            editCandidateForm.set("idExpirationDateMonth", new Integer(                    identificationDocumentExpirationDate.get(Calendar.MONTH)).toString());            editCandidateForm.set("idExpirationDateYear", new Integer(                    identificationDocumentExpirationDate.get(Calendar.YEAR)).toString());        }        editCandidateForm.set("fatherName", infoPerson.getNomePai());        editCandidateForm.set("motherName", infoPerson.getNomeMae());        if (infoPerson.getInfoPais() == null) {            editCandidateForm.set("nationality", null);        } else {            editCandidateForm.set("nationality", infoPerson.getInfoPais().getNationality());        }        editCandidateForm.set("birthPlaceParish", infoPerson.getFreguesiaNaturalidade());        editCandidateForm.set("birthPlaceMunicipality", infoPerson.getConcelhoNaturalidade());        editCandidateForm.set("birthPlaceDistrict", infoPerson.getDistritoNaturalidade());        editCandidateForm.set("address", infoPerson.getMorada());        editCandidateForm.set("place", infoPerson.getLocalidade());        editCandidateForm.set("postCode", infoPerson.getCodigoPostal());        editCandidateForm.set("addressParish", infoPerson.getFreguesiaMorada());        editCandidateForm.set("addressMunicipality", infoPerson.getConcelhoMorada());        editCandidateForm.set("addressDistrict", infoPerson.getDistritoMorada());        editCandidateForm.set("telephone", infoPerson.getTelefone());        editCandidateForm.set("mobilePhone", infoPerson.getTelemovel());        editCandidateForm.set("email", infoPerson.getEmail());        editCandidateForm.set("webSite", infoPerson.getEnderecoWeb());        editCandidateForm.set("contributorNumber", infoPerson.getNumContribuinte());        editCandidateForm.set("occupation", infoPerson.getProfissao());        editCandidateForm.set("username", infoPerson.getUsername());        editCandidateForm.set("areaOfAreaCode", infoPerson.getLocalidadeCodigoPostal());        editCandidateForm.set("situation", infoMasterDegreeCandidate.getInfoCandidateSituation()                .getSituation().toString());        editCandidateForm.set("specializationArea", infoMasterDegreeCandidate.getSpecializationArea());        editCandidateForm.set("average", infoMasterDegreeCandidate.getAverage().toString());        editCandidateForm.set("majorDegree", infoMasterDegreeCandidate.getMajorDegree());        editCandidateForm.set("majorDegreeSchool", infoMasterDegreeCandidate.getMajorDegreeSchool());        editCandidateForm.set("candidateID", infoMasterDegreeCandidate.getIdInternal());        if ((infoPerson.getSexo() != null))            editCandidateForm.set("sex", infoPerson.getSexo().toString());        if (infoPerson.getEstadoCivil() != null)            editCandidateForm.set("maritalStatus", infoPerson.getEstadoCivil().toString());        if ((infoMasterDegreeCandidate.getMajorDegreeYear().intValue() == 0))            editCandidateForm.set("majorDegreeYear", null);        else            editCandidateForm.set("majorDegreeYear", String.valueOf(infoMasterDegreeCandidate                    .getMajorDegreeYear()));    }