changeApplicationInfoForm.set("identificationDocumentType", infoPerson .getTipoDocumentoIdentificacao().toString());
if(infoPerson.getTipoDocumentoIdentificacao() != null){ changeApplicationInfoForm.set("identificationDocumentType", infoPerson .getTipoDocumentoIdentificacao().toString()); }
    private void populateForm(DynaActionForm changeApplicationInfoForm, InfoPerson infoPerson) {        changeApplicationInfoForm.set("identificationDocumentNumber", infoPerson                .getNumeroDocumentoIdentificacao());        changeApplicationInfoForm.set("identificationDocumentType", infoPerson                .getTipoDocumentoIdentificacao().toString());        changeApplicationInfoForm.set("identificationDocumentIssuePlace", infoPerson                .getLocalEmissaoDocumentoIdentificacao());        changeApplicationInfoForm.set("name", infoPerson.getNome());        Calendar birthDate = Calendar.getInstance();        if (infoPerson.getNascimento() == null) {            changeApplicationInfoForm.set("birthDay", Data.OPTION_DEFAULT);            changeApplicationInfoForm.set("birthMonth", Data.OPTION_DEFAULT);            changeApplicationInfoForm.set("birthYear", Data.OPTION_DEFAULT);        } else {            birthDate.setTime(infoPerson.getNascimento());            changeApplicationInfoForm.set("birthDay", new Integer(birthDate.get(Calendar.DAY_OF_MONTH))                    .toString());            changeApplicationInfoForm.set("birthMonth", new Integer(birthDate.get(Calendar.MONTH))                    .toString());            changeApplicationInfoForm.set("birthYear", new Integer(birthDate.get(Calendar.YEAR))                    .toString());        }        Calendar identificationDocumentIssueDate = Calendar.getInstance();        if (infoPerson.getDataEmissaoDocumentoIdentificacao() == null) {            changeApplicationInfoForm.set("idIssueDateDay", Data.OPTION_DEFAULT);            changeApplicationInfoForm.set("idIssueDateMonth", Data.OPTION_DEFAULT);            changeApplicationInfoForm.set("idIssueDateYear", Data.OPTION_DEFAULT);        } else {            identificationDocumentIssueDate.setTime(infoPerson.getDataEmissaoDocumentoIdentificacao());            changeApplicationInfoForm.set("idIssueDateDay", new Integer(identificationDocumentIssueDate                    .get(Calendar.DAY_OF_MONTH)).toString());            changeApplicationInfoForm.set("idIssueDateMonth", new Integer(                    identificationDocumentIssueDate.get(Calendar.MONTH)).toString());            changeApplicationInfoForm.set("idIssueDateYear", new Integer(identificationDocumentIssueDate                    .get(Calendar.YEAR)).toString());        }        Calendar identificationDocumentExpirationDate = Calendar.getInstance();        if (infoPerson.getDataValidadeDocumentoIdentificacao() == null) {            changeApplicationInfoForm.set("idExpirationDateDay", Data.OPTION_DEFAULT);            changeApplicationInfoForm.set("idExpirationDateMonth", Data.OPTION_DEFAULT);            changeApplicationInfoForm.set("idExpirationDateYear", Data.OPTION_DEFAULT);        } else {            identificationDocumentExpirationDate.setTime(infoPerson                    .getDataValidadeDocumentoIdentificacao());            changeApplicationInfoForm.set("idExpirationDateDay", new Integer(                    identificationDocumentExpirationDate.get(Calendar.DAY_OF_MONTH)).toString());            changeApplicationInfoForm.set("idExpirationDateMonth", new Integer(                    identificationDocumentExpirationDate.get(Calendar.MONTH)).toString());            changeApplicationInfoForm.set("idExpirationDateYear", new Integer(                    identificationDocumentExpirationDate.get(Calendar.YEAR)).toString());        }        changeApplicationInfoForm.set("fatherName", infoPerson.getNomePai());        changeApplicationInfoForm.set("motherName", infoPerson.getNomeMae());        changeApplicationInfoForm.set("nationality", infoPerson.getInfoPais().getNationality());        changeApplicationInfoForm.set("birthPlaceParish", infoPerson.getFreguesiaNaturalidade());        changeApplicationInfoForm.set("birthPlaceMunicipality", infoPerson.getConcelhoNaturalidade());        changeApplicationInfoForm.set("birthPlaceDistrict", infoPerson.getDistritoNaturalidade());        changeApplicationInfoForm.set("address", infoPerson.getMorada());        changeApplicationInfoForm.set("place", infoPerson.getLocalidade());        changeApplicationInfoForm.set("postCode", infoPerson.getCodigoPostal());        changeApplicationInfoForm.set("addressParish", infoPerson.getFreguesiaMorada());        changeApplicationInfoForm.set("addressMunicipality", infoPerson.getConcelhoMorada());        changeApplicationInfoForm.set("addressDistrict", infoPerson.getDistritoMorada());        changeApplicationInfoForm.set("telephone", infoPerson.getTelefone());        changeApplicationInfoForm.set("mobilePhone", infoPerson.getTelemovel());        changeApplicationInfoForm.set("email", infoPerson.getEmail());        changeApplicationInfoForm.set("webSite", infoPerson.getEnderecoWeb());        changeApplicationInfoForm.set("contributorNumber", infoPerson.getNumContribuinte());        changeApplicationInfoForm.set("occupation", infoPerson.getProfissao());        changeApplicationInfoForm.set("username", infoPerson.getUsername());        changeApplicationInfoForm.set("areaOfAreaCode", infoPerson.getLocalidadeCodigoPostal());        if (infoPerson.getSexo() != null)            changeApplicationInfoForm.set("sex", infoPerson.getSexo().toString());        if (infoPerson.getMaritalStatus() != null)            changeApplicationInfoForm.set("maritalStatus", infoPerson.getMaritalStatus().toString());    }