public synchronized IClassFiles[] getClassFiles(IJavaProject project) throws JavaModelException {
Map binpaths = new HashMap();
IPackageFragmentRoot[] roots = project.getPackageFragmentRoots();
for (int j = 0; j < roots.length; j++) {
IPath binpath = getClassFileLocation(roots[j]);
ClassFiles classfiles = (ClassFiles) binpaths.get(binpath);
if (classfiles == null) {
IPackageFragmentRoot[] element = new IPackageFragmentRoot[] { roots[j] };
binpaths.put(binpath, new ClassFiles(element, binpath));
} else {
binpaths.put(binpath, classfiles.addRoot(roots[j]));
}
}
return (IClassFiles[]) binpaths.values().toArray(new IClassFiles[0]);
}