if (order != null) { MetadataComparator metadataComparator = new MetadataComparator(order, asc); Collections.sort(metadataList, metadataComparator); }
    public ActionForward exercisesFirstPage(ActionMapping mapping, ActionForm form,            HttpServletRequest request, HttpServletResponse response) throws FenixActionException,            FenixFilterException {        final Integer executionCourseId = getCodeFromRequest(request, "objectCode");        final ExecutionCourse executionCourse = rootDomainObject                .readExecutionCourseByOID(executionCourseId);        List<Metadata> metadataList = new ArrayList<Metadata>();        for (Metadata metadata : executionCourse.getMetadatas()) {            if (metadata.getVisibility()) {                metadataList.add(metadata);            }        }        final String order = request.getParameter("order");        final String asc = request.getParameter("asc");        // if (order != null) {        // MetadataComparator metadataComparator = new MetadataComparator(order,        // asc);        // Collections.sort(infoMetadataList, metadataComparator);        // }        request.setAttribute("badXmls", (List) request.getAttribute("badXmls"));        request.setAttribute("metadataList", metadataList);        request.setAttribute("objectCode", executionCourseId);        request.setAttribute("order", order);        request.setAttribute("asc", asc);        return mapping.findForward("exercisesFirstPage");    }