infoGratuityValues.setFinalProofValue(Double.valueOf((String) actionForm.get("thesisPart")));
String thesisPart = (String) actionForm.get("thesisPart"); infoGratuityValues.setFinalProofValue((thesisPart.length() > 0) ? new Double(thesisPart) : 0);
    private InfoGratuityValues fillGratuity(IUserView userView, DynaValidatorForm actionForm) {        InfoPerson infoPerson = new InfoPerson();        infoPerson.setUsername(userView.getUtilizador());        InfoEmployee infoEmployee = new InfoEmployee();        infoEmployee.setPerson(infoPerson);        String degree = (String) actionForm.get("degree");        Integer degreeId = Integer.valueOf(StringUtils.substringAfter(degree, "#"));        InfoExecutionDegree infoExecutionDegree = new InfoExecutionDegree();        infoExecutionDegree.setIdInternal(degreeId);        InfoGratuityValues infoGratuityValues = new InfoGratuityValues();        infoGratuityValues.setInfoExecutionDegree(infoExecutionDegree);        infoGratuityValues.setInfoEmployee(infoEmployee);        if ((String) actionForm.get("gratuityId") != null                && ((String) actionForm.get("gratuityId")).length() > 0) {            infoGratuityValues.setIdInternal(Integer.valueOf((String) actionForm.get("gratuityId")));        }        if (actionForm.get("annualValue") != null                && ((String) actionForm.get("annualValue")).length() > 0) {            infoGratuityValues.setAnualValue(Double.valueOf((String) actionForm.get("annualValue")));        }        if (actionForm.get("scholarPart") != null                && ((String) actionForm.get("scholarPart")).length() > 0) {            infoGratuityValues.setScholarShipValue(Double                    .valueOf((String) actionForm.get("scholarPart")));            infoGratuityValues.setFinalProofValue(Double.valueOf((String) actionForm.get("thesisPart")));        }        if (actionForm.get("unitaryValueCredit") != null                && ((String) actionForm.get("unitaryValueCredit")).length() > 0) {            infoGratuityValues.setCreditValue(Double.valueOf((String) actionForm                    .get("unitaryValueCredit")));        } else {            infoGratuityValues.setCourseValue(Double.valueOf((String) actionForm                    .get("unitaryValueCourse")));        }        infoGratuityValues.setProofRequestPayment((Boolean) actionForm.get("paymentWhen"));        if (actionForm.get("totalPayment") != null                && ((Boolean) actionForm.get("totalPayment")).equals(Boolean.TRUE)) {            infoGratuityValues.setEndPayment(Data.convertStringDate((String) actionForm                    .get("finalDateTotalPayment"), "/"));            if (actionForm.get("initialDateTotalPayment") != null                    && ((String) actionForm.get("initialDateTotalPayment")).length() > 0) {                infoGratuityValues.setStartPayment(Data.convertStringDate((String) actionForm                        .get("initialDateTotalPayment"), "/"));            }        }        if (actionForm.get("partialPayment") != null                && ((Boolean) actionForm.get("partialPayment")).equals(Boolean.TRUE)) {            List infoPaymentPhases = new ArrayList();            if (actionForm.get("registrationPayment") != null                    && ((Boolean) actionForm.get("registrationPayment")).equals(Boolean.TRUE)) {                infoGratuityValues.setRegistrationPayment((Boolean) actionForm                        .get("registrationPayment"));                InfoPaymentPhase infoPaymentPhase = fillAPaymentPhase(actionForm);                infoPaymentPhases.add(infoPaymentPhase);            }            // collect payment phases            String[] paymentPhases = (String[]) actionForm.get("paymentPhases");            for (int i = 0; i < paymentPhases.length; i = i + 3) {                fillPaymentPhasesList(paymentPhases[i], paymentPhases[i + 1], paymentPhases[i + 2],                        infoPaymentPhases);            }            infoGratuityValues.setInfoPaymentPhases(infoPaymentPhases);        }        return infoGratuityValues;    }