final SortedSet<Homepage> degreeHomepages; if (homepages.containsKey(degree)) { degreeHomepages = homepages.get(degree); } else { degreeHomepages = new TreeSet<Homepage>(Homepage.HOMEPAGE_COMPARATOR_BY_NAME); homepages.put(degree, degreeHomepages); } final Homepage homepage = person.getHomepage(); if (studentCurricularPlan.getCurrentState() == StudentCurricularPlanState.CONCLUDED && homepage != null && homepage.getActivated().booleanValue()) { degreeHomepages.add(homepage);
if (person != null) { final SortedSet<Homepage> degreeHomepages; if (homepages.containsKey(degree)) { degreeHomepages = homepages.get(degree); } else { degreeHomepages = new TreeSet<Homepage>(Homepage.HOMEPAGE_COMPARATOR_BY_NAME); homepages.put(degree, degreeHomepages); } final Homepage homepage = person.getHomepage(); if (studentCurricularPlan.getCurrentState() == StudentCurricularPlanState.CONCLUDED && homepage != null && homepage.getActivated().booleanValue()) { degreeHomepages.add(homepage); }
    public ActionForward listAlumni(ActionMapping mapping, ActionForm actionForm,            HttpServletRequest request, HttpServletResponse response) throws Exception {    	final SortedMap<Degree, SortedSet<Homepage>> homepages = new TreeMap<Degree, SortedSet<Homepage>>(Degree.DEGREE_COMPARATOR_BY_NAME_AND_DEGREE_TYPE);    	for (final Student student : rootDomainObject.getStudentsSet()) {    		for (final StudentCurricularPlan studentCurricularPlan : student.getStudentCurricularPlansSet()) {   				final DegreeCurricularPlan degreeCurricularPlan = studentCurricularPlan.getDegreeCurricularPlan();   				final Degree degree = degreeCurricularPlan.getDegree();   				final Person person = student.getPerson();   				final SortedSet<Homepage> degreeHomepages;   				if (homepages.containsKey(degree)) {   					degreeHomepages = homepages.get(degree);   				} else {   					degreeHomepages = new TreeSet<Homepage>(Homepage.HOMEPAGE_COMPARATOR_BY_NAME);   					homepages.put(degree, degreeHomepages);   				}   				final Homepage homepage = person.getHomepage();   				if (studentCurricularPlan.getCurrentState() == StudentCurricularPlanState.CONCLUDED   						&& homepage != null && homepage.getActivated().booleanValue()) {   					degreeHomepages.add(homepage);   				}    		}    	}    	request.setAttribute("homepages", homepages);    	final String selectedPage = request.getParameter("selectedPage");    	if (selectedPage != null) {    		request.setAttribute("selectedPage", selectedPage);    	}        return mapping.findForward("list-homepages-alumni");    }