List infoCurricularCourseScopeList; List infoCurricularCourseList = new ArrayList(); StringBuffer allSiglas = new StringBuffer();  if (executionCourse.getAssociatedCurricularCourses() != null) { for (int i = 0; i < executionCourse.getAssociatedCurricularCourses().size(); i++) { ICurricularCourse curricularCourse = (ICurricularCourse) executionCourse .getAssociatedCurricularCourses().get(i); InfoCurricularCourse infoCurricularCourse = copyFromDomain(curricularCourse); infoCurricularCourseScopeList = new ArrayList(); for (int j = 0; j < curricularCourse.getScopes().size(); j++) { ICurricularCourseScope curricularCourseScope = (ICurricularCourseScope) curricularCourse .getScopes().get(j); InfoCurricularCourseScope infoCurricularCourseScope = copyFromDomain(curricularCourseScope); infoCurricularCourseScopeList.add(infoCurricularCourseScope); }  infoCurricularCourse.setInfoScopes(infoCurricularCourseScopeList);  String currentSigla = infoCurricularCourse.getInfoDegreeCurricularPlan().getInfoDegree().getSigla();  if (!infoCurricularCourseList.isEmpty() && StringUtils.contains(allSiglas.toString(),currentSigla)) { for (int k = 0; k < infoCurricularCourseList.size(); k++) { String sigla = ((InfoDegree) ((InfoDegreeCurricularPlan) ((InfoCurricularCourse) ((List) infoCurricularCourseList.get(k)).get(0)).getInfoDegreeCurricularPlan()).getInfoDegree()).getSigla(); if (sigla.equals(currentSigla)) { ((List)infoCurricularCourseList.get(k)).add(infoCurricularCourse); break; } } } else { List infoCurricularCoursesByDegree = new ArrayList(); infoCurricularCoursesByDegree.add(infoCurricularCourse); infoCurricularCourseList.add(infoCurricularCoursesByDegree); allSiglas.append(currentSigla); } } }  return infoCurricularCourseList;
final List curricularCourses = executionCourse.getAssociatedCurricularCourses(); final int estimatedResultSize = curricularCourses.size();  final List infoCurricularCourses = new ArrayList(estimatedResultSize); final Set degreesCodes = new HashSet(estimatedResultSize); for (final Iterator iterator = curricularCourses.iterator(); iterator.hasNext(); ) { final ICurricularCourse curricularCourse = (ICurricularCourse) iterator.next(); final String degreeCode = curricularCourse.getDegreeCurricularPlan().getDegree().getSigla(); if (!degreesCodes.contains(degreeCode)) { final InfoCurricularCourse infoCurricularCourse = copyFromDomain(curricularCourse);  infoCurricularCourses.add(infoCurricularCourse); infoCurricularCourse.setInfoScopes(new ArrayList());  for (final Iterator scopeIterator = curricularCourse.getScopes().iterator(); scopeIterator.hasNext(); ) { final ICurricularCourseScope curricularCourseScope = (ICurricularCourseScope) scopeIterator.next(); final InfoCurricularCourseScope infoCurricularCourseScope = copyFromDomain(curricularCourseScope); infoCurricularCourse.getInfoScopes().add(infoCurricularCourseScope); }  degreesCodes.add(degreeCode); } }  return infoCurricularCourses;
    private List readCurricularCoursesOrganizedByDegree(IExecutionCourse executionCourse) {		List infoCurricularCourseScopeList;		List infoCurricularCourseList = new ArrayList();			StringBuffer allSiglas = new StringBuffer();				if (executionCourse.getAssociatedCurricularCourses() != null) {			for (int i = 0; i < executionCourse.getAssociatedCurricularCourses().size(); i++) {				ICurricularCourse curricularCourse = (ICurricularCourse) executionCourse				.getAssociatedCurricularCourses().get(i);				InfoCurricularCourse infoCurricularCourse = copyFromDomain(curricularCourse);				infoCurricularCourseScopeList = new ArrayList();				for (int j = 0; j < curricularCourse.getScopes().size(); j++) {					ICurricularCourseScope curricularCourseScope = (ICurricularCourseScope) curricularCourse					.getScopes().get(j);					InfoCurricularCourseScope infoCurricularCourseScope = copyFromDomain(curricularCourseScope);					infoCurricularCourseScopeList.add(infoCurricularCourseScope);				}								infoCurricularCourse.setInfoScopes(infoCurricularCourseScopeList);					String currentSigla = infoCurricularCourse.getInfoDegreeCurricularPlan().getInfoDegree().getSigla();										if (!infoCurricularCourseList.isEmpty() && StringUtils.contains(allSiglas.toString(),currentSigla)) {					for (int k = 0; k < infoCurricularCourseList.size(); k++) {						String sigla = ((InfoDegree) ((InfoDegreeCurricularPlan) ((InfoCurricularCourse) 								((List) infoCurricularCourseList.get(k)).get(0)).getInfoDegreeCurricularPlan()).getInfoDegree()).getSigla();						if (sigla.equals(currentSigla)) {							((List)infoCurricularCourseList.get(k)).add(infoCurricularCourse);							break;						}					}				} else {					List infoCurricularCoursesByDegree = new ArrayList();						infoCurricularCoursesByDegree.add(infoCurricularCourse);					infoCurricularCourseList.add(infoCurricularCoursesByDegree);					allSiglas.append(currentSigla);				}			}						}				return infoCurricularCourseList;	}