contents.add(new BagElement(Integer.valueOf(id), bagType));
contents.add(new BagElement(new Integer(id), bagType));
    public ActionForward execute(ActionMapping mapping,                                 ActionForm form,                                 HttpServletRequest request,                                 HttpServletResponse response)        throws Exception {        HttpSession session = request.getSession();        Profile profile = (Profile) session.getAttribute(Constants.PROFILE);        ServletContext servletContext = session.getServletContext();        ObjectStore os = (ObjectStore) servletContext.getAttribute(Constants.OBJECTSTORE);        BagUploadConfirmForm confirmForm = (BagUploadConfirmForm) form;        String idsString = confirmForm.getMatchIDs().trim();        String[] ids = StringUtil.split(idsString, " ");        List contents = new ArrayList();                String bagType = confirmForm.getBagType();        for (int i = 0; i < ids.length; i++) {            String idString = ids[i];            int id = Integer.parseInt(idString);            contents.add(new BagElement(Integer.valueOf(id), bagType));        }        ProfileManager profileManager =            (ProfileManager) servletContext.getAttribute(Constants.PROFILE_MANAGER);        ObjectStore profileOs = profileManager.getUserProfileObjectStore();                                                                              String bagName = confirmForm.getBagName();        InterMineBag bag =            new InterMineBag(profile.getUserId(), bagName, bagType, profileOs, os, contents);                int defaultMaxNotLoggedSize = 3;        int maxNotLoggedSize = WebUtil.getIntSessionProperty(session, "max.bag.size.notloggedin",                                                             defaultMaxNotLoggedSize);        profile.saveBag(bagName, bag, maxNotLoggedSize);        ForwardParameters forwardParameters =             new ForwardParameters(mapping.findForward("bagDetails"));        return forwardParameters.addParameter("bagName", bagName).forward();    }