public static ClassPath[] collectClassPaths(List projects) { ArrayList result = new ArrayList(3); for (int i = 0, max = projects.size(); i < max; i++) { Project project = (Project) projects.get(i); ClassPath cp = project.getPaths().getClassPath(); if (cp instanceof CompoundClassPath) { result.add(((CompoundClassPath) cp).getPaths()[0]); } else { result.add(cp); } } return (ClassPath[]) result.toArray(new ClassPath[result.size()]); }
public static SourcePath[] collectSourcePaths(List projects) { ArrayList result = new ArrayList(3); for (int i = 0, max = projects.size(); i < max; i++) { Project project = (Project) projects.get(i); SourcePath sp = project.getPaths().getSourcePath(); if (sp instanceof CompoundSourcePath) { result.add(((CompoundSourcePath) sp).getPaths()[0]); } else { result.add(sp); } } return (SourcePath[]) result.toArray(new SourcePath[result.size()]); }