Double credits = (editStudentCurricularPlanForm.get("credits") != null) ? (Double .valueOf((String) editStudentCurricularPlanForm.get("credits"))) : 0.0;
Object creditsObj = editStudentCurricularPlanForm.get("credits"); Double credits = (creditsObj != null && ((String)creditsObj).length() > 0) ? (Double .valueOf((String) creditsObj)) : null;
    public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request,            HttpServletResponse response) throws Exception {        HttpSession session = request.getSession(false);        DynaActionForm editStudentCurricularPlanForm = (DynaActionForm) form;        String studentCurricularPlanIdString = request.getParameter("studentCurricularPlanId");        String[] extraCurricularCoursesArray = (String[]) editStudentCurricularPlanForm                .get("extraCurricularCourses");        String currentState = (String) editStudentCurricularPlanForm.get("currentState");        String specialization = (String) editStudentCurricularPlanForm.get("specialization");        Integer branch = (Integer) editStudentCurricularPlanForm.get("branch");        Double credits = (editStudentCurricularPlanForm.get("credits") != null) ? (Double                .valueOf((String) editStudentCurricularPlanForm.get("credits"))) : 0.0;        String startDate = (String) editStudentCurricularPlanForm.get("startDate");        Integer studentCurricularPlanId = new Integer(studentCurricularPlanIdString);        String observations = (String) editStudentCurricularPlanForm.get("observations");        IUserView userView = (IUserView) session.getAttribute(SessionConstants.U_VIEW);        List extraCurricularCourses = new ArrayList();        for (int i = 0; i < extraCurricularCoursesArray.length; i++) {            extraCurricularCourses.add(new Integer(extraCurricularCoursesArray[i]));        }        Object args[] = { userView, studentCurricularPlanId, currentState, credits, startDate,                extraCurricularCourses, observations, branch, specialization };        try {            ServiceManagerServiceFactory.executeService(userView,                    "EditPosGradStudentCurricularPlanStateAndCredits", args);        } catch (FenixServiceException e) {            throw new FenixActionException(e);        }        request.setAttribute("studentCurricularPlanId", studentCurricularPlanId);        return mapping.findForward("ShowStudentCurricularCoursePlan");    }