List avaliableEquivalencies = new LinkedList(); for (Iterator iterator= disciplines.iterator(); iterator.hasNext();) { InfoCurricularCourse curricularCourse= (InfoCurricularCourse) iterator.next(); for (Iterator equivalencyIterator= seminary.getEquivalencies().iterator(); equivalencyIterator.hasNext();) { InfoEquivalency equivalency= (InfoEquivalency) equivalencyIterator.next(); if (equivalency.getCurricularCourseIdInternal().equals(curricularCourse.getIdInternal())) { avaliableEquivalencies.add(equivalency); break; } } } System.out.println("E no final temos " + avaliableEquivalencies); seminary.setEquivalencies(avaliableEquivalencies);
	public ActionForward execute(		ActionMapping mapping,		ActionForm form,		HttpServletRequest request,		HttpServletResponse response)		throws FenixActionException	{		HttpSession session= this.getSession(request);		IUserView userView= (IUserView) session.getAttribute(SessionConstants.U_VIEW);		String seminaryIDString= (String) request.getParameter("objectCode");        Integer seminaryID;        if (seminaryIDString == null)            throw new FenixActionException(mapping.findForward("invalidQueryString"));        try        {		  seminaryID= new Integer(seminaryIDString);        }        catch (Exception ex)        {            throw new FenixActionException(mapping.findForward("invalidQueryString"));        }		InfoSeminary seminary= null;		InfoStudent student= null;		List disciplines= null;		ActionForward destiny= null;		try		{			Object[] argsReadSeminary= { seminaryID };			Object[] argsReadStudent= { userView.getUtilizador()};			GestorServicos gestor= GestorServicos.manager();			seminary= (InfoSeminary) gestor.executar(userView, "Seminaries.GetSeminary", argsReadSeminary);			student= (InfoStudent) gestor.executar(userView, "ReadStudentByUsername", argsReadStudent);			Object[] ReadCurricularCoursesByUsername= { userView.getUtilizador()};			disciplines=				(List) gestor.executar(					userView,					"student.ReadCurricularCoursesByUsername",					ReadCurricularCoursesByUsername);            Object[] argsReadCandidacies= { student.getIdInternal() };                                List candidacies = (List) gestor.executar(userView, "Seminaries.GetCandidaciesByStudentID", argsReadCandidacies);            if (candidacies.size() >= seminary.getAllowedCandidaciesPerStudent().intValue())            {                destiny = mapping.findForward("candidaciesLimitReached");                request.setAttribute("limit",seminary.getAllowedCandidaciesPerStudent());            }            else            {                destiny= mapping.findForward("showCandidacyOptions");                request.setAttribute("seminary", seminary);            }                        		}		catch (Exception e)		{            throw new FenixActionException();		}           		return destiny;	}