Bundle[]    bundles    = item.getBundles(); Bitstream[] bitstreams = bundles[0].getBitstreams();   for (int i = 1; i < bitstreams.length; i++)
Bundle[] bundles = item.getBundles();  if (bundles.length > 0)
    private void processVerifyPrune(Context context,        HttpServletRequest request,        HttpServletResponse response,        SubmissionInfo subInfo)        throws ServletException, IOException, SQLException, AuthorizeException    {        if (request.getParameter("do_not_proceed") != null)        {            // User cancelled            doStep(context, request, response, subInfo, INITIAL_QUESTIONS);            return;        }        // User elected to proceed - do the pruning        // Get the values from the form        boolean multipleTitles =            UIUtil.getBoolParameter(request, "multiple_titles");        boolean publishedBefore =            UIUtil.getBoolParameter(request, "published_before");        // Multiple files question does not appear in workflow mode.        // Since the submission will have a license, the answer to        // this question will always be "yes"        boolean multipleFiles = (isWorkflow(subInfo) ||            UIUtil.getBoolParameter(request, "multiple_files"));        Item item = subInfo.submission.getItem();        if (!multipleTitles)        {            item.clearDC("title",                "alternative", Item.ANY);        }        if (publishedBefore == false)        {            item.clearDC("date", "issued", Item.ANY);            item.clearDC("identifier", "citation", Item.ANY);            item.clearDC("publisher", null, Item.ANY);        }        if (multipleFiles == false)        {            // remove all but first bitstream from bundle[0]            // FIXME: Assumes multiple bundles, clean up someday...            // (only messes with the first bundle.)            Bundle[]    bundles    = item.getBundles();            Bitstream[] bitstreams = bundles[0].getBitstreams();                        // Remove all but the first bitstream            for (int i = 1; i < bitstreams.length; i++)            {                bundles[0].removeBitstream(bitstreams[i]);            }        }        // Nothing needs removing, so just make the changes        subInfo.submission.setMultipleTitles(multipleTitles);        subInfo.submission.setPublishedBefore(publishedBefore);        // "Multiple files" irrelevant in workflow mode        if (!isWorkflow(subInfo))        {            subInfo.submission.setMultipleFiles(multipleFiles);        }        subInfo.submission.update();        // Everything went OK if we get to here, so now response        // to the original button press        if (request.getParameter("submit_next") != null)        {            // Update user's progress            userHasReached(subInfo, EDIT_METADATA_1);            // User has clicked "Next"            doStep(context, request, response, subInfo, EDIT_METADATA_1);            context.complete();        }        else        {            // Progress bar button clicked            doStepJump(context, request, response, subInfo);            context.complete();        }    }